Documentation
¶
Overview ¶
Package telemetry corresponds to pi's packages/telemetry/src.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributeValue ¶
type AttributeValue any
AttributeValue is a span attribute value: string, number, boolean, or a slice of one of those.
type SpanAttributes ¶
type SpanAttributes map[string]AttributeValue
SpanAttributes are span attributes keyed by name; a nil value omits the key.
type SpanOptions ¶
type SpanOptions struct {
Name string
Attributes SpanAttributes
}
SpanOptions start one span.
type SpanStatus ¶
type SpanStatus struct {
Kind SpanStatusKind `json:"status"`
Error *SpanStatusError `json:"error,omitempty"`
}
type SpanStatusError ¶
type SpanStatusKind ¶
type SpanStatusKind string
SpanStatusKind discriminates how a span ended.
const ( SpanStatusKindOK SpanStatusKind = "ok" SpanStatusKindError SpanStatusKind = "error" )
type TelemetryContext ¶
type TelemetryContext interface {
StartSpan(options SpanOptions, callback func(span TelemetrySpan) error) error
}
TelemetryContext is an explicit parent for spans produced by one logical request. pi's generic StartSpan result propagates through the callback's return value; in Go the callback reports an error and other values cross via the closure.
var NoopTelemetryContext TelemetryContext = noopSpan{}
NoopTelemetryContext is the NOOP_TELEMETRY_CONTEXT counterpart: spans are created and immediately discarded.
type TelemetrySpan ¶
type TelemetrySpan interface {
TelemetryContext
AddEvent(name string, attributes SpanAttributes)
SetAttributes(attributes SpanAttributes)
SetStatus(status SpanStatus)
}
TelemetrySpan is a running span; it also starts child spans.