OpenInference

View as Markdown

OpenInference is a fixed projection of the unified OpenTelemetry exporter. It is always available and no longer has a separate configuration section, subscriber class, or Cargo feature.

Plugin Configuration

Select openinference on an endpoint in the opentelemetry section:

1[components.config]
2version = 3
3
4[components.config.opentelemetry]
5enabled = true
6
7[[components.config.opentelemetry.endpoints]]
8type = "openinference"
9endpoint = "http://localhost:6006/v1/traces"
10transport = "http_binary"
11service_name = "agent-service"
12instrumentation_scope = "opentelemetry"
13timeout_millis = 3000
14
15[components.config.opentelemetry.endpoints.header_env]
16authorization = "OTEL_AUTHORIZATION"
17
18[components.config.opentelemetry.endpoints.resource_attributes]
19"deployment.environment" = "dev"

The endpoint emits the existing OpenInference scope, tool, LLM, and mark projection. It supports the mark_projection, mark_exclude_names, and attribute_mappings controls on the typed endpoint, retaining the legacy behavior.

Normalized tool results emit one llm.input_messages entry per result with message.role = "tool", message.tool_call_id, and message.content. Anthropic user messages that contain only tool_result blocks expand into separate entries so parallel tool results retain their original order and correlation IDs.

Set OTEL_AUTHORIZATION to the complete authorization header value before activation. NeMo Relay snapshots the value when the plugin activates. The variable must be set and nonblank. A header name cannot appear in both headers and header_env, including names that differ only by ASCII case. The resolved value cannot have surrounding whitespace.

For the complete endpoint field table, multi-endpoint behavior, and version-2 migration, refer to OpenTelemetry.

Direct Subscriber

Use OpenTelemetrySubscriber with the OpenInference discriminator:

1from nemo_relay import OpenTelemetryConfig, OpenTelemetrySubscriber
2
3config = OpenTelemetryConfig(
4 "openinference",
5 "http://localhost:6006/v1/traces",
6)
7config.service_name = "agent-service"
8subscriber = OpenTelemetrySubscriber(config)

Register the subscriber before instrumented work. During graceful teardown, deregister it, flush it, and then shut it down.