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.
Detailed traces add more granular spans than standard traces, which helps when the gateway shows a delay but standard traces do not explain where it happens inside the engine. The extra depth has a cost in runtime overhead, data volume and data sensitivity. Confirm which spans and attributes each level records for your vLLM release before you turn it on.
- Fits: diagnosing engine-side latency after standard traces leave a gap, usually during a targeted investigation.
- Overhead: more spans and more data per request raise runtime cost as traffic grows. Measure latency with and without detailed tracing under the same load test.
- Data sensitivity: detailed spans can carry more request context. Review what is recorded against your data handling rules before enabling it.
- Storage: volume grows with request count. Agree on sampling and retention with the team that runs the tracing backend.
- Rollout: enable it on a canary or staging replica first, and roll back if tail latency moves in a way your load test did not predict.
Compare latency with detailed tracing on and off under the same load before you decide whether to keep it on in production.
Running the OpenTelemetry Collector as an agent places one instance next to each vLLM node or pod. Each agent receives spans locally, can apply processing, and forwards them onward. The OpenTelemetry documentation describes the agent pattern as running next to services, which keeps the network path short and gives each node a local point of contact. The cost is operational: many instances to deploy, configure and keep in step.
- Fits: single-node or small fleets, and environments where a local buffer helps protect traces during brief backend outages.
- Effort: one Collector configuration per node or pod, plus upgrades on the same cadence as the rest of the fleet. Ask whether your team already manages Collector configuration as code.
- Resources: each agent uses CPU and memory on GPU hosts, which compete with inference workloads. Size agents on a loaded host, not an idle one.
- Credentials: each agent needs its own credentials if it authenticates to the backend. Collector authenticator extensions can handle this, such as the oauth2client extension for outgoing requests.
- Drift: configuration drift across many agents is the main operational risk.
Check agent CPU and memory on a loaded GPU host, and confirm who owns agent configuration and upgrades.
A gateway Collector is a central service that accepts telemetry from many sources, which can include the API gateway, vLLM servers and other services, then processes and exports it. The OpenTelemetry documentation describes this as a central collection point for data from many sources. It suits organizations that want one place to set sampling, filtering, redaction and export rules, but it adds a service that must be highly available and secured.
- Fits: multi-cluster or multi-team platforms that need consistent policy across the gateway, vLLM and other services.
- Effort: one configuration to review centrally, plus scaling and redundancy for the gateway tier.
- Security: protect receivers with authenticator extensions such as OIDC, and follow the Collector configuration best practices for exposure and credentials.
- Network: traffic from vLLM nodes crosses your network, so isolate that path and restrict which sources can send to the gateway.
- Risk: an overloaded or unavailable gateway delays or drops traces unless buffering and redundancy are designed in.
Confirm where the gateway runs, how many replicas you need, and how you will test that a gateway failure does not disrupt inference traffic.
Direct export sends spans from vLLM straight to a tracing backend that accepts OpenTelemetry data, with no Collector in between. OpenTelemetry does not store or display traces itself, so the backend is always a separate tool, such as Jaeger or Tempo. Direct export is the simplest path to working traces, but it removes the Collector's processing and buffering layer, which matters once you have several services or a backend that may change.
- Fits: a single deployment with one backend and few teams, or a short evaluation before a wider rollout.
- Effort: the lowest setup effort, but each vLLM instance carries its own endpoint and credentials.
- Resilience: without a Collector there is no local buffer. Confirm how vLLM behaves when the backend is unreachable, and whether that affects request latency.
- Change cost: moving to another backend means editing the configuration of every serving instance, while a Collector makes that a central change.
- Compatibility: confirm which protocol and version your backend accepts before you configure the endpoint.
Test how inference latency behaves when the backend is down before you use direct export in production.
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.
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.
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.
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.
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.
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.
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.
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 docsExposed 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 practicesCollector 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 releasesQuestions 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.

