Tracing vLLM requests with OpenTelemetry

Send vLLM request traces to Jaeger, Tempo or another OpenTelemetry Collector, decide whether detailed traces are worth their overhead, and join gateway and engine spans to locate latency.

On this page

Tracing vLLM requests with OpenTelemetry: when your team needs it

A slow chat response usually has three possible owners: the gateway, the request queue inside the serving engine, or the model execution itself. Metrics tell a platform team that p95 latency rose, but they rarely say which hop added the time for a given user request. Tracing follows a single request across those hops, so the team can see where it waited. vLLM's documentation describes a Prometheus-format /metrics endpoint covering request counts, token throughput, latency histograms and KV cache use, which is the right starting point for fleet-level trends. Per-request attribution is a different question, and it is the one tracing answers.

OpenTelemetry is an observability framework for generating, exporting and collecting telemetry such as traces, metrics and logs. It is not a storage or visualization backend. Your team still needs a trace store and query tool, such as Jaeger or Tempo, and an OpenTelemetry Collector between the services and that backend. Each of these pieces is a separate component to select, size, secure and upgrade. Before committing, confirm which trace settings your vLLM version exposes, because the exact span names, attributes and any detailed-trace options must be checked against the release you run. The vLLM docs at vLLM online serving are the place to start that check.

Choose tracing over metrics alone when the question is about one request or a path between components, such as whether a gateway timeout came from queueing in the engine or from a slow upstream call. Metrics remain cheaper to keep and easier to alert on. Plan both: keep the /metrics alerts for fleet health, and add traces where you need request-level evidence. Ask your team to confirm which gateway and engine spans share a trace context, since that join decides whether the investigation works at all.

How gateway and engine spans reach a backend

The diagram starts with a client request entering the API gateway in the tenant network, where the gateway opens a span and passes trace context on to the vLLM server. The vLLM server exports its own spans to an OpenTelemetry Collector, which can run next to the engine as an agent or as a shared gateway, and the Collector forwards traces to a backend such as Jaeger or Tempo. Check that the trace context header survives every hop, that the exporter endpoint is reachable only from the approved network, and that the Collector's connection to the backend is authenticated.

Trace context and spans from the gateway and vLLM server reach a trace backend through Collectors.

Which tracing options fit which situation

Standard request traces are the usual starting point. They record each request handled by the vLLM server, which lets you see how long the server took to respond and match slow user-facing calls to engine activity. Choose this level when the first question is which requests are slow and where the delay sits between the gateway and the server.

  • Fits: first-pass latency investigations and correlating gateway timings with engine timings.
  • Effort: enabling the traces setting in vLLM and pointing it at your collector or backend. Confirm the exact setting name in the vLLM observability documentation for your release.
  • Overhead: lower than detailed tracing, but still measurable. Test it on traffic that resembles production before you enable it broadly.
  • Limit: it shows request-level timing, not the internal steps of each scheduling or model execution cycle.
  • Upgrades: vLLM ships minor releases about every two weeks, so re-check setting names and span contents when you upgrade.

Check that spans arrive in your backend with the service name and request identifiers your gateway logs use before you plan anything heavier.

Setting up vLLM traces end to end

This sequence takes a self-hosted vLLM deployment from no tracing to a verified path where one trace ID follows a request from the gateway into the engine. Each step ends with a check so the team knows the next step can start.

  1. Confirm the vLLM version and tracing flags

    Record the vLLM version you run, then check its documentation and help output for the tracing options that release supports, including the OpenTelemetry traces endpoint setting and any detailed-trace option. Tracing options can change between minor releases, and vLLM ships a new minor release about every two weeks, so confirm against the version in your image rather than an older guide. Ask the engineer who owns the serving image to write down the exact flags and environment variables. Done when the team has a short written list of supported tracing settings for that version.

  2. Deploy a Collector with OTLP receiver

    Deploy the OpenTelemetry Collector in the same network zone as vLLM, configured with an OTLP receiver for incoming traces and a trace exporter to your backend, such as Jaeger or Tempo. Pin a specific Collector release rather than running the latest build, and verify the release artifacts against their checksums before deployment. Keep the configuration minimal at first so that problems are easy to locate. Done when the Collector starts without configuration errors and its health or logs show the receiver is listening.

  3. Point vLLM at the collector endpoint

    Set vLLM's traces endpoint to the OTLP address of the Collector, using the flag or environment variable confirmed in the first step. Restart the vLLM server with the change and check the startup log for any message about the tracing exporter. If you enable detailed traces, treat that as a separate decision: confirm the overhead with your own load test before leaving it on in production. Done when vLLM starts cleanly with tracing enabled and the Collector logs show incoming span data after a test request.

  4. Propagate trace context from the gateway

    Configure the API gateway or reverse proxy in front of vLLM to create or forward W3C trace context headers on each request, and to emit its own spans for the request it handles. The gateway's exporter should send to the same Collector. Confirm that vLLM accepts and continues the incoming trace context in your version, since this behavior is not something to assume from the flags alone. Done when a request through the gateway produces spans from both services in the same trace.

  5. Verify spans arrive in the backend

    Send a single, known test request through the gateway and open the trace view in Jaeger, Tempo or your chosen backend. Check that spans from the gateway and from vLLM appear, and that their service names are distinct and recognizable. If a service is missing, check the Collector's exporter logs and the sending service's endpoint and protocol settings before changing anything else. Done when the test request appears as one trace with spans from both services.

  6. Confirm one trace ID links gateway and engine

    Take the trace ID from the gateway's response or logs and search for it in the backend. Confirm that the vLLM span is a child of the gateway span, not a separate root trace. A break at this point usually means context was not propagated across the hop, so review the header handling at the gateway and any proxy in between. Done when a single trace ID shows the gateway span and the engine span as parent and child, with timing that matches the request.

  7. Record the verified setup and test latency

    Write down the vLLM version, the tracing flags, the Collector release, the gateway configuration and the test trace ID, so the setup can be repeated after an upgrade. Run a short set of representative requests and use the resulting traces to check that gateway and engine timings can be compared to find where latency sits. Keep the record with the deployment runbook and note which settings must be re-checked at each vLLM upgrade. Done when the team can reproduce the trace path from the written record.

Joining gateway and engine spans to find latency

A shared trace ID across the gateway, the vLLM API server and the engine is what lets you split one slow request into its parts. Without it, the gateway shows a single long call and the engine shows its own timings, and nobody can say whether the delay sat in the network, in the queue waiting for scheduler capacity, in prefill, or in decode. Before you rely on the waterfall, confirm in the vLLM docs and your tracing setup which spans the server emits and which attributes they carry, because span names and fields are version-specific and should not be assumed from this page.

When you open a trace, read it top down: the gateway span covers the full client-visible time, the API server span nested under it covers what the server handled, and any engine-side spans show work inside the serving process. Gaps between a parent span's end and a child's start point to network hops, proxy buffering or queueing before the server accepted the request. Long bars inside the engine point to scheduling wait or prefill, while a long tail after the first token points to decode. Compare the time to first token against total duration per trace to see whether a slow request is slow to start or slow to finish.

Three things commonly break the join. Header propagation can stop at a reverse proxy or API gateway that does not forward the W3C trace context headers, which leaves the engine spans as orphan roots. Sampling mismatches occur when the gateway samples a request but the engine does not, or the reverse, so the picture is incomplete for the requests you most need. Clock skew between hosts can make a child span appear to start before its parent, so check host time synchronization before blaming the application. Test each hop with a single known request and confirm that one trace ID appears on both sides before you trust any latency analysis.

Security risks in trace pipelines

Traces from vLLM can carry more than timing data, so the pipeline needs the same scrutiny as the serving stack it observes. The cards below cover what the trace data contains, who can reach the Collector, how connections are authenticated, and how the Collector itself is configured.

Prompts and metadata in span data

Spans describe requests, and depending on instrumentation and debug settings they can include request attributes, model names and identifiers that point back to users or tenants. Prompt and completion text may end up in span attributes or events, so treat trace storage as a store of user data. Before enabling detailed traces, confirm with your vLLM version which fields are recorded and which are dropped or redacted, and set retention and access for the trace backend to match that content.

vLLM security docs

Exposed Collector receiver endpoints

The Collector accepts telemetry on receiver ports, often OTLP over gRPC or HTTP, and an open receiver lets any host on the network push spans or flood the pipeline. Bind receivers to the interface your vLLM and gateway hosts use, keep them off public networks, and restrict them with network policy or firewall rules. Check the listening addresses in the effective configuration after each change, not only in the file.

Authenticating incoming telemetry

Authenticator extensions can check credentials on receivers, for example with OIDC, so only known services can send spans. Choose one authentication method for gateway and vLLM exporters, issue each sender its own credential, and test that an unauthenticated request is rejected. Confirm the extension names and their stability level in the Collector release you deploy, because component maturity varies.

Outbound credentials with oauth2client

Exporters that send traces to a remote backend often need credentials of their own. The oauth2client extension can attach tokens to outgoing exporter requests, so the Collector does not hold a long-lived shared secret in its configuration. Store the client secret outside the configuration file, rotate it on a schedule, and confirm that the backend rejects requests that lack a valid token.

Collector configuration best practices

The OpenTelemetry security guidance for Collector configuration covers the settings that tend to be left at defaults, such as receiver bindings, TLS, and which extensions and debug exporters are enabled. Review the configuration against that guidance before production, remove debug exporters that print full span bodies to logs, and keep the configuration under version control. Ask your team to rerun the review after every Collector upgrade.

Collector config best practices

Collector release and artifact checks

The Collector ships contrib builds alongside the core distribution, and contrib includes many components with differing maturity and support. Use only the distribution and version your team has verified, check the published SHA256 checksums and signed artifacts before deployment, and review the SBOM for components you do not intend to run. Pin the version in deployment manifests so an unplanned update does not change the receivers or exporters in use.

Collector releases

Questions teams ask before tracing vLLM

What does it cost to add OpenTelemetry tracing to vLLM?

The software is free to use, so the cost comes from the infrastructure that receives and stores traces, the engineering time to instrument and connect the services, and the people who keep the pipeline running. vLLM itself has no paid edition, and the OpenTelemetry Collector is licensed under Apache-2.0. The main recurring costs are trace storage and query capacity, which grow with request volume, sampling rate and how many attributes each span carries. Setup is mostly one-time work: wiring the endpoint, configuring the Collector and building dashboards. Ask any partner for a quote built from your expected request volume, retention period and the backend you choose, and ask who pays for the storage and who is on call for the pipeline.

How long does it take to get vLLM traces flowing end to end?

Duration depends on how many services sit in the request path and how much of the path already has tracing. A single vLLM server with a Collector and one backend is the smallest case. Adding an API gateway, an application layer and a second backend adds propagation work and testing. No duration figure is supplied for this work, so confirm the timeline against your own environment, the number of services in the request path and whether your platform team already runs a Collector. Ask for milestones in writing: endpoint enabled, first trace visible, gateway and engine spans joined, and dashboards and alerts handed over.

What does our team need to provide for a tracing rollout?

You need someone who owns the vLLM deployment settings, someone who owns the gateway or application that calls vLLM, and someone who operates the telemetry backend. The engine team provides the vLLM version, the launch command and the network path to the Collector. The platform team provides a Collector host or Kubernetes deployment, storage for traces and access controls. Security review is needed for what appears in span attributes, since prompt or user data should not be copied into traces without a decision. Access to a staging environment that matches production is also required to test sampling and overhead safely.

Can our own engineers set up vLLM tracing without a partner?

Yes, if your team already runs OpenTelemetry or a tracing backend and has engineers comfortable with service configuration. The work is well bounded: enable the vLLM tracing settings, point them at a Collector, deploy or configure the Collector, and check that spans arrive. The harder parts are propagating trace context from the gateway into vLLM, deciding what to sample, keeping sensitive content out of attributes and documenting the result for audit. A partner is most useful when several teams share the path or when you need evidence for a security review. Decide based on who will maintain the pipeline after go-live.

Should we send vLLM traces to Jaeger, Tempo or another backend?

Choose the backend based on how your organization already stores and queries telemetry, not on the vLLM side, since vLLM emits OpenTelemetry-compatible traces through a Collector. The decision factors are:

  • Existing operations: whether your team already runs Jaeger, Grafana Tempo or a commercial service.
  • Query needs: whether engineers want to jump from trace to metric or log views in Grafana.
  • Retention and storage: how long traces must be kept and who pays for the storage layer.
  • Access control: whether the backend supports the single sign-on and role model your security team requires.

OpenTelemetry is not a storage backend, so the backend choice is a separate decision from the instrumentation. Confirm backend features against its own documentation before committing.

How do detailed vLLM traces affect request latency?

Detailed traces add work on the serving path and can increase latency and memory use, and the size of the effect depends on your model, hardware, request mix and trace settings. The reliable approach is measurement: run the same load test with tracing off, with standard spans and with detailed spans, then compare time to first token, token throughput and tail latency. Use vLLM's Prometheus metrics at /metrics alongside the trace test to catch regressions. No overhead figure is supplied for this work, so ask for the benchmark numbers from your own environment before enabling detailed traces in production.

How do we join gateway spans with vLLM engine spans to find latency?

Each request needs a trace context passed from the gateway into vLLM, so both sides record spans under the same trace ID. Your gateway must create or forward the W3C trace context header, and the vLLM server must receive and continue it. Then compare span timings across the gateway, queueing, prefill and decode stages to see where time goes. Check that clocks are synchronized across hosts, because skew makes spans appear out of order. Test the join with a single request before relying on it, and confirm the exact header and settings against the vLLM online serving documentation for your version.

Does tracing expose prompts or user data, and how do we control it?

It can, if span attributes or events record request content. Decide up front which fields are allowed in traces, such as model name, token counts, status and timings, and which are never recorded, such as prompt text, completions and user identifiers. Apply filtering in the Collector and restrict who can query the backend. Your security and compliance teams should review the attribute list and the retention period before go-live. DeployOpen can prepare that review as part of a scoped engagement, but it does not issue audit reports or certifications; independent auditors do that work.

How trace rollout fits your existing observability stack

DeployOpen scopes the trace path in writing before any work starts, including the OpenTelemetry Collector topology, the backend that stores and displays traces, and how the API gateway passes trace context to the vLLM server. Those three decisions determine most of the rollout, so they are agreed first and recorded in the statement of work. The whole deployment runs inside your own cloud accounts, data centers or air-gapped network, so the Collector, the backend and any storage it writes to stay under your control. Confirm early which team owns each component, because the Collector sits between the engine and every backend and changes to it affect all services that send telemetry through it.

Traces rarely replace the other signals you already run. vLLM exposes Prometheus-format metrics at /metrics, covering request counts, token throughput, latency histograms and KV cache use, so most teams already have a dashboard for fleet health. Traces answer a different question: where one slow request spent its time across the gateway, the engine and any downstream calls. Plan the three signals together, and decide which system is the source of truth for alerts. Metrics usually drive paging, while traces are used for investigation. Confirm that your existing Prometheus scrape job and dashboards can stay unchanged while tracing is added, and that the /metrics path is reached only from your monitoring network, since the vLLM security guidance does not place it behind the API key.

Most organizations already run a visualization layer such as Grafana, and it can display traces from several backends, so the choice of trace store should be made with that layer in mind. Ask which backend your operations team can support over the long term, how long traces must be retained, and who may read request-level data, because span attributes can carry request metadata. The OpenTelemetry Collector documentation describes the agent and gateway roles, and the planning answers above decide which role each tier plays. Confirm with your security team how Collector receivers and exporters will authenticate, since the Collector supports authenticator extensions for both incoming and outgoing connections.

How DeployOpen scopes and delivers vLLM tracing

DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside your own infrastructure, so vLLM tracing is built on your collector, your storage and your network. We scope the work in writing first, then build and hand over the trace pipeline with the runbooks your operations team needs.

How we scope

  • Inventory the vLLM version, serving entry points and any gateway or proxy that sits in front of the engine.
  • Agree which trace backend, such as Jaeger or Tempo, and which collector deployment pattern your platform team operates.
  • Define the written scope, deliverables and timeline for the tracing work before any configuration starts.

How we build

  • Configure vLLM trace export to your OpenTelemetry Collector endpoint and confirm spans arrive in the chosen backend.
  • Decide with you whether detailed traces are enabled, measure their overhead on your workload and document the result.
  • Connect gateway and engine spans using shared trace context so latency can be attributed to each hop during testing.

How we hand over

  • Deliver the collector configuration, exporter settings and access controls as files stored in your own repositories.
  • Document how to find a slow request across gateway and engine spans, with example queries for your backend.
  • Walk your operators through the runbook, including how to turn detailed tracing off again after an investigation.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer when your team wants help after handover.
  • Review the trace pipeline again when vLLM or the Collector moves to a new release, since both ship on their own cadence.
  • Confirm with your security team how collector authentication and trace data retention will be governed before go-live.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.