Versions in this module Expand all Collapse all v0 v0.1.0 Aug 9, 2026 Changes in this version + const AreaBrain + const AreaContext + const AreaHarness + const AreaInference + const AreaModelTasks + const AreaRegistry + const AttrAfterTools + const AttrAgentID + const AttrArea + const AttrBrainDegrade + const AttrBrainHits + const AttrBrainOp + const AttrContextMsgs + const AttrContextToolPairs + const AttrErrorClass + const AttrErrorCode + const AttrGenAIInputTokens + const AttrGenAIOperationName + const AttrGenAIOutputTokens + const AttrGenAIProviderName + const AttrGenAIRequestModel + const AttrHTTPStatus + const AttrLoadSession + const AttrModelPhase + const AttrModelSeq + const AttrOpenTodos + const AttrOutcome + const AttrSessionID + const AttrThreadID + const AttrToolNS + const AttrToolName + const AttrToolStatus + const AttrTurnKind + const BrainDegradeContainmentOnly + const BrainDegradeLexicalOnly + const BrainDegradeNone + const BrainOpContinue + const BrainOpExpand + const BrainOpExpandMany + const BrainOpFindExact + const BrainOpFindLinks + const BrainOpFindObjects + const BrainOpSearch + const ErrorClassCancelled + const ErrorClassMaxTokens + const ErrorClassOK + const ErrorClassOther + const ErrorClassProvider4xx + const ErrorClassProvider5xx + const ErrorClassTimeout + const EventAttrBodySnip + const EventAttrInputItems + const EventAttrOutcome + const EventAttrPromptLen + const EventAttrResumeInterruptCount + const EventModelAfterTools + const EventPromptReceived + const EventProviderFailed + const EventResumeReceived + const EventTurnEnded + const GenAIOperationChat + const GenAIProviderAzure + const GenAIProviderOpenAI + const GenAIProviderUnknown + const HandoffOutcomeError + const HandoffOutcomeFallback + const HandoffOutcomeOK + const InstrumentationName + const LabelAgentID + const LabelBrainOp + const LabelDegrade + const LabelEmpty + const LabelErrorClass + const LabelKind + const LabelModelPhase + const LabelOutcome + const LabelStatus + const LabelTool + const LabelToolNS + const LabelTurnKind + const MetricBrainDuration + const MetricBrainTotal + const MetricCheckpointSave + const MetricCompressTotal + const MetricHandoffTotal + const MetricInterruptTotal + const MetricModelDuration + const MetricModelTotal + const MetricSessionCreated + const MetricTokensInput + const MetricTokensOutput + const MetricTokensReasoning + const MetricToolCalls + const MetricToolDuration + const MetricTurnActive + const MetricTurnDuration + const MetricTurnTotal + const ModelPhaseCompress + const ModelPhaseHandoff + const ModelPhaseTurn + const OutcomeCancelled + const OutcomeError + const OutcomeOK + const SpanBrain + const SpanContextHandoff + const SpanModel + const SpanPlanInstall + const SpanTool + const SpanTurn + func AgentIDFromContext(ctx context.Context) string + func ContextWithAfterTools(ctx context.Context) context.Context + func ContextWithAgentID(ctx context.Context, agentID string) context.Context + func ContextWithInstruments(ctx context.Context, inst *Instruments) context.Context + func ContextWithMeter(ctx context.Context, m metric.Meter) context.Context + func ContextWithModelIdentity(ctx context.Context, id ModelIdentity) context.Context + func ContextWithTracer(ctx context.Context, t trace.Tracer) context.Context + func DefaultResource(serviceName, serviceVersion string) (*resource.Resource, error) + func EmitEvent(ctx context.Context, name string, attrs ...log.KeyValue) + func EmitEventSeverity(ctx context.Context, name string, severity log.Severity, attrs ...log.KeyValue) + func Init(ctx context.Context, cfg Config) (shutdown func(context.Context) error, err error) + func InstallDefault(base slog.Handler) + func InstallDefaultWithOTLP(base, otlp slog.Handler) + func Logger() log.Logger + func Meter() metric.Meter + func MeterFromContext(ctx context.Context) metric.Meter + func MeterFromProvider(mp metric.MeterProvider) metric.Meter + func MeterProviderFromPrometheusRegisterer(reg prometheus.Registerer, serviceName, serviceVersion string) (*sdkmetric.MeterProvider, error) + func NewBrainObserver() brain.Observer + func NewLogger(base slog.Handler) *slog.Logger + func NewOTLPSlogHandler(name string) slog.Handler + func SetMeterProvider(mp metric.MeterProvider) + func SetTracerProvider(tp trace.TracerProvider) + func Tracer() trace.Tracer + func TracerFromContext(ctx context.Context) trace.Tracer + func TracerFromProvider(tp trace.TracerProvider) trace.Tracer + type BrainObserver struct + func (BrainObserver) StartOp(ctx context.Context, op brain.Op) (context.Context, brain.OpSpan) + type BrainSpan struct + func StartBrainSpan(ctx context.Context, op string) (context.Context, *BrainSpan) + func (b *BrainSpan) End(hits int, degrade string, err error) + type Config struct + DisableLogs bool + DisableMetrics bool + Insecure bool + OTLPEndpoint string + Protocol string + SampleRatio float64 + ServiceName string + ServiceVersion string + type HandoffSpan struct + func StartHandoffSpan(ctx context.Context, openTodos int) (context.Context, *HandoffSpan) + func (s *HandoffSpan) End(outcome string, err error) + type Instruments struct + func InstrumentsFromContext(ctx context.Context) *Instruments + func MustInstruments(m metric.Meter) *Instruments + func NewInstruments(m metric.Meter) (*Instruments, error) + func (i *Instruments) RecordBrain(ctx context.Context, agentID, op, outcome, degrade string, empty bool, ...) + func (i *Instruments) RecordCheckpointSave(ctx context.Context, outcome string) + func (i *Instruments) RecordCompress(ctx context.Context, agentID string) + func (i *Instruments) RecordHandoff(ctx context.Context, agentID, outcome string) + func (i *Instruments) RecordInterrupt(ctx context.Context, agentID, kind string) + func (i *Instruments) RecordModel(ctx context.Context, agentID, phase, outcome, errClass string, d time.Duration) + func (i *Instruments) RecordSessionCreated(ctx context.Context) + func (i *Instruments) RecordTokens(ctx context.Context, agentID string, input, output, reasoning int) + func (i *Instruments) RecordTool(ctx context.Context, agentID, tool, namespace, status string, d time.Duration) + func (i *Instruments) RecordTurnEnd(ctx context.Context, agentID, turnKind, outcome string, d time.Duration) + func (i *Instruments) RecordTurnStart(ctx context.Context, agentID string) + type ModelIdentity struct + Model string + Operation string + Provider string + func NewModelIdentity(model, baseURL string) ModelIdentity + type ModelSpan struct + func StartModelSpan(ctx context.Context, phase string, seq int, shape WindowShape) (context.Context, *ModelSpan) + func (m *ModelSpan) End(err error, usage TokenUsage) + type MultiHandler []slog.Handler + func (m MultiHandler) Enabled(ctx context.Context, level slog.Level) bool + func (m MultiHandler) Handle(ctx context.Context, r slog.Record) error + func (m MultiHandler) WithAttrs(attrs []slog.Attr) slog.Handler + func (m MultiHandler) WithGroup(name string) slog.Handler + type PlanInstallSpan struct + func StartPlanInstallSpan(ctx context.Context, sessionID string) (context.Context, *PlanInstallSpan) + func (s *PlanInstallSpan) End(err error) + type SpanHandler struct + func NewSpanHandler(base slog.Handler) *SpanHandler + func (h *SpanHandler) Enabled(ctx context.Context, level slog.Level) bool + func (h *SpanHandler) Handle(ctx context.Context, r slog.Record) error + func (h *SpanHandler) WithAttrs(attrs []slog.Attr) slog.Handler + func (h *SpanHandler) WithGroup(name string) slog.Handler + type StdioWatchDog struct + func NewStdioWatchDog() *StdioWatchDog + func (s *StdioWatchDog) RecordError(err error) error + func (s *StdioWatchDog) RecordOutput(msg *streaming.Message) error + func (s *StdioWatchDog) RecordThinking(msg *streaming.Message) error + func (s *StdioWatchDog) RecordTokens(input, output int) error + func (s *StdioWatchDog) RecordToolCalls(msg *streaming.Message) error + func (s *StdioWatchDog) RecordToolResult(msg *streaming.Message) error + type TokenUsage struct + Input int + Output int + Reasoning int + type ToolSpan struct + func StartToolSpan(ctx context.Context, name, namespace string) (context.Context, *ToolSpan) + func (t *ToolSpan) Finish(status string, err error) + type TurnAttrs struct + AgentID string + Kind string + LoadSession bool + SessionID string + ThreadID string + type TurnSpan struct + func StartTurnSpan(ctx context.Context, a TurnAttrs) (context.Context, *TurnSpan) + func (t *TurnSpan) End(outcome string, err error) + type WindowShape struct + Messages int + ToolPairs int