Documentation
¶
Overview ¶
Package telemetry provides OpenTelemetry tracing for bosun. When BOSUN_OTEL_ENDPOINT is configured, spans are exported via OTLP HTTP. When unconfigured, a noop provider is used (zero overhead).
Index ¶
- func BoolAttr(key string, value bool) attribute.KeyValue
- func Init(ctx context.Context, serviceName, serviceVersion, endpoint string) (func(context.Context) error, error)
- func IntAttr(key string, value int) attribute.KeyValue
- func SpanError(span trace.Span, err error)
- func SpanOK(span trace.Span)
- func StringAttr(key, value string) attribute.KeyValue
- func Tracer(name string) trace.Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(ctx context.Context, serviceName, serviceVersion, endpoint string) (func(context.Context) error, error)
Init initializes the OTel tracer provider with an OTLP HTTP exporter. If endpoint is empty, installs a noop provider (zero overhead). Returns a shutdown function that flushes pending spans.
func SpanError ¶
SpanError records an error on a span and sets its status to Error. No-op if err is nil.
func StringAttr ¶
StringAttr is a convenience wrapper for attribute.String.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.