Documentation
¶
Overview ¶
Package otelobserver implements the credbound.Observer port with OpenTelemetry: every observed operation becomes a span, a "credbound.operations" counter increment, a "credbound.operation.duration" histogram sample and a log record, all attributed with the operation name and outcome. Operation records carry no secrets, so the telemetry is safe to export.
Wire it into credbound.Config.Observer:
observer, err := otelobserver.New(otelobserver.Config{})
A zero Config uses the process-global OTEL providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// TracerProvider produces the per-operation spans. Defaults to
// otel.GetTracerProvider().
TracerProvider trace.TracerProvider
// MeterProvider backs the operation counter and duration histogram.
// Defaults to otel.GetMeterProvider().
MeterProvider metric.MeterProvider
// LoggerProvider receives one log record per operation. Defaults to
// the global log provider.
LoggerProvider logapi.LoggerProvider
}
Config selects the OpenTelemetry providers to emit through. Each nil field falls back to the corresponding process-global provider.
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer forwards credbound.Operation records to OpenTelemetry traces, metrics and logs. It is safe for concurrent use and implements credbound.Observer.