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:

[components.config]
version = 3
[components.config.opentelemetry]
enabled = true
[[components.config.opentelemetry.endpoints]]
type = "openinference"
endpoint = "http://localhost:6006/v1/traces"
transport = "http_binary"
service_name = "agent-service"
instrumentation_scope = "opentelemetry"
timeout_millis = 3000
[components.config.opentelemetry.endpoints.header_env]
authorization = "OTEL_AUTHORIZATION"
[components.config.opentelemetry.endpoints.resource_attributes]
"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:

from nemo_relay import OpenTelemetryConfig, OpenTelemetrySubscriber
config = OpenTelemetryConfig(
"openinference",
"http://localhost:6006/v1/traces",
)
config.service_name = "agent-service"
subscriber = OpenTelemetrySubscriber(config)

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