Documentation
¶
Overview ¶
Package observability defines bounded library observation events without binding protocol code to a telemetry implementation.
Index ¶
- func Observe(ctx context.Context, sink Sink, event Event)
- type Algorithm
- type Bucket
- type CacheResult
- type ErrorClass
- type Event
- func (e Event) Algorithm() Algorithm
- func (e Event) CacheResult() CacheResult
- func (e Event) ChainLengthBucket() Bucket
- func (e Event) DurationBucket() Bucket
- func (e Event) ErrorClass() ErrorClass
- func (Event) Format(state fmt.State, _ rune)
- func (Event) GoString() string
- func (e Event) Kind() Kind
- func (e Event) MessageSizeBucket() Bucket
- func (e Event) Operation() Operation
- func (e Event) Reason() Reason
- func (e Event) RecipientCountBucket() Bucket
- func (e Event) Result() Result
- func (e Event) SignatureCountBucket() Bucket
- func (Event) String() string
- func (e Event) Valid() bool
- type Kind
- type NoopSink
- type Operation
- type Reason
- type Result
- type Sink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Algorithm ¶
type Algorithm uint8
Algorithm identifies a closed signature algorithm family.
const ( // AlgorithmNone indicates that no algorithm fact applies. AlgorithmNone Algorithm = iota + 1 // AlgorithmRSA identifies RSA-SHA256. AlgorithmRSA // AlgorithmEd25519 identifies Ed25519-SHA256. AlgorithmEd25519 // AlgorithmUnknown identifies a bounded unsupported family. AlgorithmUnknown // AlgorithmMLDSA44 identifies pure ML-DSA-44. It is appended after // AlgorithmUnknown so existing numeric values stay stable. AlgorithmMLDSA44 )
type Bucket ¶
type Bucket uint8
Bucket identifies a bounded duration, size, or count bucket.
const ( // BucketNone indicates that the optional bucket is disabled or unavailable. BucketNone Bucket = iota + 1 // BucketSmall identifies the smallest bounded class. BucketSmall // BucketMedium identifies the middle bounded class. BucketMedium // BucketLarge identifies the largest bounded class. BucketLarge // BucketOverflow identifies values above the largest regular class. BucketOverflow )
type CacheResult ¶
type CacheResult uint8
CacheResult identifies one bounded cache outcome.
const ( // CacheNotUsed indicates that no cache fact applies. CacheNotUsed CacheResult = iota + 1 // CacheHit identifies a cache hit. CacheHit // CacheMiss identifies a cache miss. CacheMiss )
type ErrorClass ¶
type ErrorClass uint8
ErrorClass identifies a bounded failure class without carrying an error.
const ( // ErrorNone indicates that no error class applies. ErrorNone ErrorClass = iota + 1 // ErrorCanceled identifies caller cancellation. ErrorCanceled // ErrorDeadline identifies deadline exhaustion. ErrorDeadline // ErrorTemporary identifies a classified temporary dependency failure. ErrorTemporary // ErrorPermanent identifies a classified permanent dependency failure. ErrorPermanent // ErrorInternal identifies a contained invariant failure. ErrorInternal )
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is one immutable validated library observation.
func NewEvent ¶
func NewEvent(kind Kind, operation Operation, result Result, reason Reason, errorClass ErrorClass, algorithm Algorithm, cache CacheResult, duration, message, recipients, signatures, chain Bucket) (Event, bool)
NewEvent constructs one exact event after validating every closed fact.
func (Event) CacheResult ¶
func (e Event) CacheResult() CacheResult
CacheResult returns the bounded cache outcome.
func (Event) ChainLengthBucket ¶
ChainLengthBucket returns the optional chain-length class.
func (Event) DurationBucket ¶
DurationBucket returns the bounded duration class.
func (Event) ErrorClass ¶
func (e Event) ErrorClass() ErrorClass
ErrorClass returns the closed error class.
func (Event) MessageSizeBucket ¶
MessageSizeBucket returns the optional message-size class.
func (Event) RecipientCountBucket ¶
RecipientCountBucket returns the optional recipient-count class.
func (Event) SignatureCountBucket ¶
SignatureCountBucket returns the optional signature-count class.
type Result ¶
type Result uint8
Result identifies a bounded operational result class.
const ( // ResultSuccess identifies a successful completed operation. ResultSuccess Result = iota + 1 // ResultFailure identifies a completed protocol or provider failure. ResultFailure // ResultTemporary identifies a bounded temporary failure. ResultTemporary // ResultInternal identifies a contained internal failure. ResultInternal )