Skip to main content

Crate neuron_otel

Crate neuron_otel 

Source
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 nameOTel conventionWhen
gen_ai.loop.iterationEach loop turn
gen_ai.chatgen_ai.chatLLM request/response
gen_ai.execute_toolgen_ai.execute_toolTool execution
gen_ai.context.compactionContext 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§

OtelConfig
Configuration for the OTel hook.
OtelHook
An ObservabilityHook that emits tracing spans following the OTel GenAI semantic conventions.