Expand description
OpenTelemetry instrumentation for neuron using GenAI semantic conventions.
Implements ObservabilityHook with the OTel GenAI semantic conventions
(gen_ai.* namespace). Emits tracing spans — users bring their own
tracing-opentelemetry subscriber for OTel export.
§Usage
use neuron_otel::{OtelHook, OtelConfig};
let hook = OtelHook::new(OtelConfig {
capture_input: false,
capture_output: false,
});
// Pass to AgentLoop::builder(...).hook(hook).build()§Span hierarchy
| Span name | OTel convention | When |
|---|---|---|
gen_ai.loop.iteration | — | Each loop turn |
gen_ai.chat | gen_ai.chat | LLM request/response |
gen_ai.execute_tool | gen_ai.execute_tool | Tool execution |
gen_ai.context.compaction | — | Context compaction |
§Opt-in content capture
By default, request/response content is NOT captured (privacy).
Set capture_input / capture_output to true to include message
bodies in span attributes.
Structs§
- Otel
Config - Configuration for the OTel hook.
- Otel
Hook - An
ObservabilityHookthat emitstracingspans following the OTel GenAI semantic conventions.