Documentation
¶
Overview ¶
Package otel adapts the core hook.Hooks callbacks to OpenTelemetry spans and attributes. It is the only place that imports the otel packages; core stays free of any observability backend. Initialize a tracer provider in main for spans to be exported; with no provider, otel uses a no-op tracer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHooks ¶
NewHooks returns hook.Hooks that emit OpenTelemetry spans for tool calls and record errors and gate/authorize decisions as span attributes. It uses the global tracer provider; initialize one (e.g. an OTLP exporter) in main for spans to be exported. Without a provider, otel uses a no-op tracer.
func Setup ¶ added in v0.1.6
Setup initializes the global TracerProvider from the standard OTLP environment variables so the spans emitted by NewHooks are actually exported. When neither OTEL_EXPORTER_OTLP_ENDPOINT nor OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is set, it leaves the no-op global provider untouched and returns a no-op shutdown. The exporter speaks OTLP over HTTP/protobuf; endpoint, headers, and TLS come from the standard OTEL_EXPORTER_OTLP_* variables read by the exporter itself.
Types ¶
This section is empty.