Skip to main content

Export telemetry to observability

Agent Router telemetry reaches an existing observability stack over two paths: OpenTelemetry trace export sends per-request traces to any OTLP-compatible backend, and Prometheus metrics are exposed on a scrape endpoint by each data plane component. Most production deployments use both: traces for per-request investigation, metrics for dashboards and alert rules.


Persona: Developer working in the Developer Console, in collaboration with whoever owns the organization's observability stack.

Estimated time: 20 to 30 minutes for the trace-export configuration, plus whatever time is required to confirm the traces land in the destination platform.

When this guide applies​

Telemetry export is the right next step in any of these situations:

SituationWhat export adds over the in-Console surfaces
Dashboards and alerts already exist in Datadog, Grafana, Honeycomb, New Relic, or similarThe same dashboards and alerts can include AI traffic alongside the rest of the application stack
AI traffic needs to be correlated with downstream service behaviorTrace context flows through to the observability backend, where the join across services is trivial
Long-term retention beyond the in-Console window is requiredStorage is whatever the observability platform already provides
Alerting on elevated error rates, latency spikes, or rate-limit saturation is requiredAlerts are configured in the alerting platform the team already operates
Compliance or SIEM workflows depend on a specific log formatThe OTLP and Prometheus formats integrate with the standard tooling these workflows already use

For ad-hoc investigation by a single developer, the Console's Request Logs and Usage pages are still the right surfaces; export is the layer that scales beyond that. The two surfaces remain available regardless of whether export is configured.

Outcomes​

By the end of this guide:

  • Trace export to an OTLP-compatible backend is configured and reporting a Connected status.
  • At least one request issued through the gateway has produced a trace in the destination observability platform.
  • The Prometheus scrape endpoint exposed by each data plane component is understood, even where it is not yet wired into the metrics collection stack.
  • The boundary between Agent Router-emitted telemetry and observability-platform-owned concerns (storage, alerting, retention) is clear.

Prerequisites​

  • A working API key with traffic flowing through it, as set up in Route requests across providers.
  • An OTLP-compatible observability backend. The endpoint URL, transport protocol (gRPC or HTTP), and authentication credentials must be obtained from whoever owns that backend.
  • Confirmation that the backend's OTLP endpoint is reachable from the Agent Router data plane. This is a network reachability question, not a Console question; if there is doubt, the operator who installed Agent Router is the right person to ask.

Step 1: configure trace export​

Trace export is configured once per Agent Router instance, from inside the Console. The configuration applies to all traffic flowing through the data plane; individual API keys do not need any further setup.

  1. Sign in to the Developer Console.

  2. In the Developer Console, open Settings → OpenTelemetry Export from the sidebar. The form appears on that page, with the Protocol, Endpoint, and Authentication Type fields. The same page is reachable at /system-integrations.

  3. Enter the Endpoint of the OTLP collector. Examples by backend:

    BackendTypical endpointTypical protocol
    Jaegerhttp://jaeger:4317gRPC
    Grafana Tempohttp://tempo:4317gRPC
    Datadoghttps://trace.agent.datadoghq.comHTTP
    Honeycombhttps://api.honeycomb.iogRPC with API key
    New Relichttps://otlp.nr-data.net:4317gRPC with API key
    Self-hosted OTLP collectorCollector address and portBackend-specific
  4. Select the transport Protocol. The field shows HTTP/JSON by default:

    • gRPC is the most common choice and uses port 4317.
    • HTTP/JSON uses OTLP over HTTP on port 4318 and is the better choice when gRPC is blocked by intermediate infrastructure.
  5. Configure Authentication Type. The right option depends on the backend:

    Auth modeWhen to use it
    NoneInternal endpoints on a trusted network
    Bearer TokenOTLP collectors that accept a static bearer token
    Basic AuthBackends that require username and password (rare for OTLP)
    API KeyHosted backends such as Honeycomb, New Relic, and Datadog. The header name is often vendor-specific and configurable here
    Custom HeadersBackends that require one or more arbitrary headers, for example, DD-API-KEY for Datadog
  6. Click Test and Save Configuration.

  7. Confirm the status indicator transitions to Connected.

The status indicator is the most useful signal during initial setup. It reports one of three states:

StatusMeaning
ConnectedTraces are being exported successfully
DisconnectedExport is disabled or not yet configured
ErrorExport is enabled but the endpoint is unreachable or returning errors

A persistent Error state usually points to one of three issues: the endpoint is unreachable from the data plane (network or DNS), the protocol does not match the collector's expectation (gRPC or HTTP), or the authentication credentials are wrong. Each of these is checkable independently.

The configuration can be revised at any time from the same page. Changing the endpoint URL, protocol, or authentication settings and clicking Test and Save Configuration applies the new values immediately; no restart of the data plane is required.

Step 2: generate traffic and inspect the destination​

Once export is active, every gateway request produces a trace. A small burst of test traffic is enough to confirm the pipeline end to end. PROXY_URL stands for the gateway URL for the deployment with /v1 appended, the same value the Console shows as the proxy endpoint.

for i in {1..5}; do
curl -s PROXY_URL/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Generate trace data."}]
}' > /dev/null
done

Then, in the destination observability platform:

  1. Search for traces under the service name that the data plane reports. Spans are emitted by the ai-gateway extproc, which reports ai-gateway-extproc unless the deployment overrides it.

  2. Open a recent trace.

  3. Confirm one span per request is present, named for the endpoint that served it. The five requests above are chat completions, so five spans named ChatCompletion are expected.

    Each request produces a single flat span. There are no gateway, routing, or inference child spans, and the Envoy hop is not instrumented, so no proxy span accompanies it. Where the calling client is itself instrumented, the span attaches to the client's trace through W3C trace context rather than appearing as a trace root.

  4. Confirm the expected attributes are populated on the span:

    • llm.model_name, the model that served the request.
    • llm.token_count.prompt, llm.token_count.completion, and llm.token_count.total.
    • openinference.span.kind, set to LLM.
    • request.id, the per-request correlation ID.
    • input.value and output.value, subject to the active logging mode.

    Request latency is read from the span's own duration; it is not stamped as an attribute. Failed calls carry an exception event with exception.type and exception.message rather than an HTTP status attribute.

The full span model, including every attribute and event and the fields that are deliberately absent, is enumerated in OpenTelemetry metrics and attributes.

If traces appear in the destination but with missing attributes, the integration is working but the receiver may be filtering or sampling on its own side; the destination platform's documentation is the right place to investigate. If traces do not appear at all and the Console status indicator is Connected, the most common cause is a service-name filter or a search range that excludes the test traffic.

OpenInference semantic conventions​

On top of the OpenTelemetry (OTLP) export described above, the gateway annotates LLM spans with OpenInference semantic conventions, the open standard for large-language-model telemetry attributes. Base OTLP defines how a span is structured and transported, but it says nothing about what an LLM call means. OpenInference fills that gap with a shared vocabulary for model, token, and prompt/response attributes, so that LLM-aware observability tools can interpret the spans without custom parsing.

What this convention adds beyond base OTLP is a set of LLM-specific span attributes, including:

  • The span kind (openinference.span.kind), which marks the span as an LLM, embedding, or reranker operation.
  • The model name and the invocation parameters supplied with the request.
  • Prompt and completion token counts captured per span, including cache-read, cache-write, and reasoning subtotals where the provider reports them.
  • The input and output of the call, captured per span subject to the active logging mode; prompt and response content appears only when the logging mode permits it. Token counts are treated as metadata and are recorded regardless. See Configure request logs for how the logging mode governs whether request and response bodies are recorded.

Because these attributes follow a published standard rather than an Agent Router-specific schema, any tool that understands the convention recognizes and renders the model, token, and prompt/response fields without bespoke mapping.

Step 3: add Prometheus metrics to the pipeline​

Each data plane component exposes a Prometheus-compatible metrics endpoint, which is the second integration path and is independent of trace export.

Agent Router does not include a metrics collector itself. Instead, an existing metrics agent (Prometheus, a Grafana Alloy collector, the Datadog agent in OpenMetrics mode, or any other scraper) pulls metrics from Agent Router's scrape endpoints and forwards them to whichever destination the observability stack uses. A reference Grafana Alloy configuration is supplied that scrapes the data plane components and forwards the metrics as OTLP to a downstream collector; it is a useful starting point even for teams that ultimately route metrics through a different agent.

Two consequences of this design:

  • The scrape endpoint is internal to the data plane and is reachable from inside the same Kubernetes cluster. Exposing it outside the cluster is a deployment decision rather than a Console one.
  • Metrics and traces share enough dimensions to be joined in the destination platform. The model is the most reliable join key, appearing as llm.model_name on spans and as a model label on metrics. Where per-request correlation is needed, the request.id span attribute is the right handle, since it is the same correlation ID carried by Request Logs. From 0.13.0, request logs and MCP request logs also carry trace_id, the id of the trace recorded for the request, which links a log entry directly to its trace. The field is empty when no trace was recorded.

Configure data plane request tracing from Helm values​

Since 0.5.0, request tracing on a self-hosted data plane is also a Helm-values setting, alongside the Console path above. Both trace producers (the AI spans and, when signals.traces.gatewaySpans is on, one Envoy span per request) send to the data plane's own collector. From 0.13.0 the AI span joins the Envoy span's trace on its own, without a propagated traceparent, and the Envoy spans follow global.observability.signals.traces.samplingRate, which defaults to 100 percent (see Sampling). Before 0.13.0, a propagated traceparent kept the two halves of a trace together. Routing happens at the collector, which means three decisions are made in the values, and the defaults deserve reading before enabling anything:

  • Which destinations receive the spans. The collector forwards them to the management plane and to every backends.custom[] entry subscribed to traces. To keep spans away from the management plane entirely, leave traces out of global.observability.managementPlane.signals, which lists the signals it receives (metrics, traces, logs; all three by default). Spans still reach the custom backends. The logs signal does not carry the data plane's operational log output: the external processor exports only metrics and traces, and the liaison component exports no logs. It carries Envoy access log entries for LLM and MCP requests, each with the peer address and X-Forwarded-For, and no prompt or response text. Leave logs out of the list to stop those entries. Container log output can still reach Tetrate through diagnostic bundles and, on managed data planes, cluster telemetry; both are described in Keep content off the management plane.
  • What the gateway records. signals.traces.capture: metadata-only keeps prompts, completions, and invocation parameters out of the AI spans at the point they are produced, for every destination at once; the model name, token counts, and request attribution remain. A running data plane pod keeps recording content until it is replaced, so a change takes effect only after the egress deployment is restarted.
  • What each destination receives. contentMode: { traces: metadata-only }, set on managementPlane or on an individual backends.custom[] entry, reduces that destination's copy without touching the others. This is how one organization keeps full spans in its own platform while the management plane receives only metadata. A destination never receives content that capture already left out: what arrives is the stricter of the two settings.
  • How the settings persist. They live under global.observability, so they survive upgrades, unlike a hand-set environment variable on the request processor, which the next upgrade re-renders away.
capture: metadata-only is a floor, not a guarantee

The producer has no switch for tool definitions (llm.tools.*), reranker queries, or the body of an upstream error, which providers commonly echo the request into. Those stay on the span. A destination that must not receive them needs contentMode: { traces: metadata-only } as well, which drops every attribute outside a fixed metadata allowlist and clears the error text.

Trace spans are also only one lane. Request logs and guardrail triggers carry full content under their own controls, and managementPlane.signals does not govern them: their management-plane copies travel on separate transports, scoped by the Request Log content mode and the guardrail trigger content mode.

Read stored traces from 0.13.0​

From 0.13.0, traces are stored in the management plane's observability store and queried with TraceQL on port 3200 of the dpo-oap Service. The Zipkin receiver and query API on ports 9411 and 9412 are removed. Span senders that used the Zipkin receiver move to the OTLP receiver, and readers that used the Zipkin query API move to TraceQL, before the upgrade.

The store keeps traces, logs, and records for 7 days, metrics for up to 15 days, metadata for 15 days, AI agent data for 30 days, and OTLP traces for 7 days. It needs more disk space than before, so the observability store storage is increased ahead of the upgrade. To keep metadata for 60 days, set observability.dpoStack.dpo.oap.env.SW_STORAGE_BANYANDB_METADATA_TTL_DAYS to "60" in the manage chart values. SW_STORAGE_BANYANDB_AI_AGENT_TTL_DAYS and SW_STORAGE_BANYANDB_OTLP_TRACE_TTL_DAYS sit beside it for the other two values.

The management API reads the same traces. GET /v1/traces lists traces with filters, and GET /v1/traces/{trace_id} returns one trace with its spans. Both need the request-logs read permission and an observability store with trace queries enabled. The trace_id field of a request log is the id to pass to the second call. See Control request log data.

Two span changes arrive with the data plane on 0.13.0:

  • MCP spans carry the backend. The mcp.backend.name attribute names the backend that served the call, so traces can be filtered by MCP backend.
  • MCP calls made with an API key carry the caller. The spans hold the customer, user, API key, and data plane, as model call spans do, and MCP request logs record the API key id. When the Traces pages of the Admin Console are enabled, their customer and key filters include MCP calls.

Per-replica metrics from 0.9.0​

From 0.9.0, the metrics a data plane pushes over OTLP (router_*, Envoy stats, and gen_ai_*) carry service.instance.id, k8s.pod.name, and k8s.namespace.name. Each egress replica therefore writes its own series, at the management plane and at every backends.custom[] destination. Before 0.9.0 the replicas shared one series, so rate() and increase() over these metrics on a data plane with more than one replica read high, inflated by false counter resets.

What changes for the metrics backend:

  • Series count. Each metric has one series per egress replica, and twice that while pods roll. A backend's per-metric series limit has to allow for it: a backend at its limit drops the new per-pod series. Tetrate-managed observability already allows for this.
  • Dashboards and alerts. Rates fall to their true values and arrive as one series per pod, so thresholds set on the old figures are re-baselined. Gauges are per pod as well, so they are summed or taken as a maximum across pods.
  • Pod lookup. With the metrics signal on, the chart adds a ClusterRole that lets the otel-gateway service account get, list, and watch pods in every namespace, to identify the pod behind each metric. An installation that sets otelGateway.serviceAccount.create: false names an existing service account in otelGateway.serviceAccount.name before upgrading, or the upgrade fails. See Upgrading to 0.9.0.

Alerting and storage: where each one belongs​

Two operational concerns are deliberately delegated to the observability platform rather than handled inside Agent Router.

Alerting​

Agent Router emits metrics with the dimensions an alerting rule needs (error rate, latency, rate-limit indicators, model, provider, and key) but it does not drive alerts itself. Alerting rules live in the observability platform, where they can be combined with rules covering the rest of the application stack, escalated through the same paging chains, and tuned with the same noise-reduction tooling. Suppressing alerts for invalid payloads, expected policy denials, or scheduled maintenance windows happens in the alerting platform's rule engine rather than in the gateway.

The benefit of this split is that an organization that already has a mature alerting setup does not have to maintain a second, vendor-specific one inside Agent Router. The cost is that a fresh deployment that does not yet have such a setup needs one before alerting on AI traffic is feasible.

Storage​

For trace data, the destination observability platform owns retention, indexing, and query performance. For in-Console request logs, Tetrate manages the underlying storage infrastructure on the management plane (capacity, index health, and query performance) so there is no storage management burden on the customer side.

The implication is that the in-Console surfaces are the right place for "last 90 days" investigations, while the exported telemetry is the right place for longer-horizon retention, compliance archiving, and SIEM workflows.