Documentation
¶
Overview ¶
Package telemetry provides bounded, payload-free operational events for hosts that need to observe CRDT transport boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidConfig reports a nil sink or invalid bounded queue size. ErrInvalidConfig = errors.New("crdt telemetry: invalid configuration") )
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Time time.Time
Component string
Operation string
Outcome Outcome
Duration time.Duration
ErrorCode crdt.ErrorCode
}
Event describes an operational boundary without including replica IDs, group IDs, endpoints, headers, payloads, or application values. Component and Operation should be fixed names chosen by the library or host.
type Options ¶
Options configures one bounded Reporter. QueueSize defaults to 256. Sink is required so construction cannot silently create a background no-op worker.
type Outcome ¶
type Outcome string
Outcome is the privacy-safe result category for one operational event.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter asynchronously delivers a bounded stream of operational events. Record never waits for Sink and never changes application behavior. It is safe for concurrent use. Call Close during host shutdown to request delivery shutdown; Close does not wait for a blocked third-party sink.
func (*Reporter) Close ¶
func (reporter *Reporter) Close()
Close stops normal event acceptance and requests that the worker exit. One event that raced with Close may still reach Sink. Close is idempotent and returns immediately even when a third-party Sink has blocked.
func (*Reporter) Done ¶
func (reporter *Reporter) Done() <-chan struct{}
Done closes after the delivery goroutine exits. It can remain open when a third-party Sink blocks, which is why Close never waits for it.