Versions in this module Expand all Collapse all v0 v0.0.13 Apr 23, 2026 v0.0.12 Apr 16, 2026 Changes in this version + const ClassBilling + const ClassCLINotFound + const ClassExecution + const ClassOverload + const ClassParseError + const ClassProcessError + const ClassPromptTooLong + var HookEventKey = attribute.Key("hook.event") + var OutcomeKey = attribute.Key("outcome") + var ThinkingTokensKey = attribute.Key("thinking.tokens") + func ClassifyHTTPStatus(status int) agenterrclass.Class + func FinishReasons(reasons ...string) attribute.KeyValue + func HookEvent(v string) attribute.KeyValue + func NewPrometheusMeterProvider(reg prometheus.Registerer) (metric.MeterProvider, error) + func Outcome(v string) attribute.KeyValue + func ThinkingTokens(v int64) attribute.KeyValue + type Config struct + Logger *slog.Logger + MeterProvider metric.MeterProvider + TracerProvider trace.TracerProvider + type Observer struct + func New(cfg Config) (*Observer, error) + func Noop() *Observer + func (o *Observer) Classify(err error) agenterrclass.Class + func (o *Observer) RecordCost(ctx context.Context, costUSD float64, model string) + func (o *Observer) RecordHookDuration(ctx context.Context, seconds float64, event, outcome string) + func (o *Observer) RecordOperationDuration(ctx context.Context, seconds float64, ...) + func (o *Observer) RecordTTFT(ctx context.Context, seconds float64, model string) + func (o *Observer) RecordTokenUsage(ctx context.Context, tokens int64, tokenType upstreamgenai.TokenTypeAttr, ...) + func (o *Observer) RecordToolCall(ctx context.Context, toolName, outcome string) + func (o *Observer) RecordToolCallDuration(ctx context.Context, seconds float64, toolName string) + func (o *Observer) RegisterMatcher(matcher agenterrclass.Matcher) + func (o *Observer) RegisterSentinel(err error, class agenterrclass.Class) + func (o *Observer) StartHookSpan(ctx context.Context, event string) (context.Context, *agenttracer.Span) + func (o *Observer) StartQuerySpan(ctx context.Context, operationName upstreamgenai.OperationNameAttr, ...) (context.Context, *agenttracer.Span) + func (o *Observer) StartSessionSpan(ctx context.Context, model, sessionID string) (context.Context, *agenttracer.Span) + func (o *Observer) StartToolSpan(ctx context.Context, toolName, callID string) (context.Context, *agenttracer.Span)