Documentation
¶
Overview ¶
Package diagnostics carries source-owned execution evidence independently of application state. Adding an event never requires a consumer-side vocabulary.
Index ¶
- Constants
- type Fields
- type Record
- func (record Record) At(at time.Time) Record
- func (record Record) Correlate(fields Fields) Record
- func (record Record) Correlation() Value
- func (record Record) Name() string
- func (record Record) ObservedAt() time.Time
- func (record Record) Payload() Value
- func (record Record) Scope() Scope
- func (record Record) Valid() bool
- func (record Record) With(fields Fields) Record
- type Scope
- type Sink
- type Source
- type Stream
- type Value
- func Array(values ...Value) Value
- func Bool(value bool) Value
- func Failure(snapshot diagnosticerror.Snapshot) Value
- func Hex(value []byte) Value
- func Identity(value []byte) Value
- func Int(value int64) Value
- func Millis(value time.Duration) Value
- func Number(value float64) Value
- func Object(fields Fields) Value
- func Text(value string) Value
- func Uint(value uint64) Value
Constants ¶
const MaximumTextBytes = 16 * 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record is immutable after construction. A sink adds ownership without interpreting the event's payload or replacing its source timestamp.
func (Record) Correlation ¶
func (Record) ObservedAt ¶
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
Sink is an injected, nonblocking publication capability. It cannot execute consumer code on a protocol or transfer goroutine. Its zero value is disabled.
type Source ¶
type Source interface{ DiagnosticRecord() Record }
Source owns its event name and detached attributes. Disabled sinks never ask it to encode, keeping diagnostics off the ordinary transfer allocation path.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) Capture ¶ added in v0.1.5
Capture gives one recording interval its own revocable sink. Stopping it leaves already queued records available and never reactivates old producers when another capture starts on the shared stream.
func (*Stream) Close ¶
func (stream *Stream) Close() observationstream.Completion
Close belongs to the host, after its engines stop. One task cannot close a shared recorder or wait for a detached consumer.
func (*Stream) Controlled ¶ added in v0.1.5
Controlled returns a sink whose publication follows set(enabled). Use Capture for task-scoped intervals that must never reactivate after stopping.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value admits only detached JSON values. Native objects, callbacks and errors cannot escape into a recorder or retain a connection through its queue.
func Failure ¶
func Failure(snapshot diagnosticerror.Snapshot) Value
func Number ¶
Nonfinite measurements retain their diagnostic spelling instead of rejecting the record.