How vLLM traces reach a self-hosted Langfuse over OpenTelemetry
A platform team that runs vLLM usually wants inference timing and token counts in Langfuse next to the traces from the applications that call it. vLLM's built-in OpenTelemetry support can export its spans to Langfuse's OTLP endpoint at /api/public/otel, so no custom connector sits between the two. The server is configured as an OpenTelemetry exporter, and Langfuse receives its spans the same way it receives spans from any OTEL-instrumented service. The work is therefore configuration and verification, not a new integration to build and maintain.
The boundary to plan for is between server spans and client spans. vLLM emits spans for the requests it serves, covering the model call as the server sees it: when the request arrived, how long generation took and the token usage it reported. The calling application emits its own spans for the surrounding work, such as retrieval, prompt assembly, tool calls and user session context. Neither side sees the full picture alone. Before rollout, confirm in your own environment which attributes the server span carries for your vLLM version, because the span fields are defined by vLLM's release and the Langfuse docs, not by this page.
Joining the two sides needs trace context propagation. If the application sends a W3C traceparent header with its request, and the vLLM server is set up to honor it, the server span becomes a child of the application span and both appear in one trace. Check this with a single test request before relying on it, because a missing header produces a separate root trace that is easy to miss in a busy project. Also decide who owns the Langfuse API keys and which Langfuse project receives inference-server spans, since those keys are the credentials the server holds. The Langfuse vLLM integration page sets out the endpoint and authentication settings to confirm against your Langfuse version.
What you need before connecting vLLM to Langfuse
Connecting vLLM to Langfuse touches four things: the inference server, the Langfuse instance that receives spans, the network path between them, and the trust chain for the internal endpoint. Check each one before editing server flags, because a failure in any of them looks like missing traces.
Pin the vLLM release
Confirm the exact vLLM version your servers run and the install path you used, such as a pip install into a managed environment or a container image. Span names and attributes can change between minor releases, so record the version alongside your Langfuse configuration. Check the candidate release against the vLLM releases page before you upgrade, and test the trace output on a staging server first. vLLM is Apache-2.0 licensed and has no paid edition, so the cost of this layer is accelerator capacity, hosting and the people who operate it.
vLLM releasesRunning self-hosted Langfuse project
You need a reachable self-hosted Langfuse instance and a project inside it. Create the project in the Langfuse UI, then generate a public and secret API key pair for it. The OpenTelemetry endpoint authenticates with these keys, so store them in your secrets manager rather than in shell history or container images. Confirm which Langfuse version you run, since the OTLP path and the supported SDK versions depend on it.
Self-hosting docsNetwork path from vLLM to Langfuse
The vLLM host must reach the Langfuse web service over HTTPS on the address your team publishes for it, and the firewall rules must allow that path from the GPU subnet. Test it from the vLLM host itself with a simple HTTP request before debugging anything else. Remember that Langfuse Web handles ingestion, so a worker or database outage can still make the endpoint look reachable while traces stall.
TLS trust for the internal endpoint
If Langfuse uses a certificate issued by an internal certificate authority, the vLLM host and its OpenTelemetry exporter must trust that authority. A certificate error often appears as silent dropped spans rather than a clear failure, so check the exporter logs on the vLLM side. Decide where the CA bundle lives, who renews it, and how it reaches the containers that run vLLM.
Isolated vLLM API surface
vLLM's own --api-key option does not cover every route, so the server should sit behind a reverse proxy that exposes only the endpoints your users need. Decide this before you open the network path to Langfuse, because the telemetry exporter and the inference API should not share an exposed listener by accident. Confirm the allowlist against the vLLM security documentation for your release.
vLLM security docsCost and operations ownership
vLLM adds no license fee, so budget for GPU or other accelerator capacity, the servers around it, and the staff who patch, monitor and upgrade it. Ask a partner for a quote that lists those components, and separate one-time setup from recurring operations. Name an owner for the vLLM release calendar, because minor releases arrive about every two weeks and each one needs a trace check.
Configure the OTLP endpoint and authentication for vLLM
This sequence connects a self-hosted vLLM server to a self-hosted Langfuse project. It ends with a test request whose server-side trace appears in the project, which confirms the endpoint and credentials work before you add application traces.
Create a Langfuse project and API keys
In your self-hosted Langfuse instance, choose or create the project that will receive vLLM spans, then generate a public and secret API key pair for it. Store both keys in your secrets manager and limit access to the people who operate the inference server. This step is done when the key pair is listed in the project settings and copied to a secure location. Confirm where keys are managed in your Langfuse version in the Langfuse documentation.
Build the Basic authentication header
Join the public key, a colon and the secret key, then base64-encode the result, for example with
echo -npiped tobase64so no trailing newline is added. Place the encoded value in an Authorization header using the Basic scheme. Run this on a trusted workstation or inside your deployment pipeline so the raw keys do not appear in shared logs. Check: decode the value in a terminal and confirm it returns the public key, a colon and the secret key in that order.Confirm the OTLP endpoint on your host
Langfuse accepts OpenTelemetry traces over OTLP at its /api/public/otel path, so the full endpoint is your Langfuse base URL followed by that path. Use an address that your vLLM hosts can reach over your internal network, and confirm it is served over HTTPS with a certificate your servers trust. Check: from the vLLM host, a request to the base URL gets a response from Langfuse, which shows the network path is open.
Set the OTLP endpoint and headers in vLLM
In vLLM's OpenTelemetry settings, enter the endpoint from the previous step and pass the Authorization header to the exporter. The exact configuration keys, and whether they are set as command-line options or environment variables, are listed on the Langfuse vLLM integration page. Copy them from that page each time you set up or upgrade, since vLLM releases change quickly. Check: the service configuration contains the endpoint and header, and the file is readable only by the account that runs the server.
Start vllm serve with tracing enabled
Start the server with
vllm serveusing your model and the settings from the previous step, on a host with the accelerator capacity the model needs. Watch the startup log for the OpenTelemetry exporter initializing and for any error about the endpoint or authentication. vLLM's--api-keyoption does not protect every endpoint, so keep the server on an isolated network and place a reverse proxy in front of user-facing paths. Check: the server reports ready and the log shows no exporter errors.Send a test chat completion
Send one request to
/v1/chat/completionson your vLLM host with a short prompt, using curl or an OpenAI-compatible client pointed at the server. Use a test prompt that contains no personal or confidential data, because the content will be stored in Langfuse. Record the model name and the response. Check: the request returns a normal completion and the server log shows the request was handled.Confirm the server trace in Langfuse
Open the project in your self-hosted Langfuse and look for the trace created by the test request, which appears after the exporter sends its batch. Open it and confirm it shows the model, the request timing and the token counts the server reported. If the trace does not appear, check the key pair, the header encoding and the endpoint path in that order. The step is done when the trace is visible in the project, and only then should you add application traces.
How a request flows from the application through vLLM into Langfuse
The application sends an OpenAI-compatible request to the vLLM server inside the inference network. vLLM returns the completion and emits its own server-side spans over OTLP to the Langfuse /api/public/otel endpoint, which sits on the Langfuse host on the other side of the trust boundary. The application sends its own OpenTelemetry spans to the same Langfuse project, so both sets of spans can be joined. Check that the endpoint and credentials reach Langfuse from the inference network and that the two span sources share one trace context.
Application and vLLM spans both land in one Langfuse project across the trust boundary.
What server-side vLLM spans contain and what they leave out
The server-side spans that vLLM emits describe what the inference server did with each request, not the full conversation. Plan on the span carrying request-level timing, the model name and token counts for the OpenAI-compatible endpoints such as /v1/chat/completions, /v1/completions, /v1/responses and /v1/embeddings. Those fields let you see latency, throughput and token usage per model in Langfuse without changing application code. Confirm the exact attribute names on your vLLM version, because the OpenTelemetry naming can change between releases and your Langfuse dashboards and filters depend on them.
Prompt and completion content, sampling settings such as temperature and max tokens, and user identifiers are not guaranteed to appear in server spans. Whether they do depends on what vLLM exports and the version you run. Do not assume that a privacy-relevant field is absent or present. Send one controlled test request to each endpoint you serve, then open the resulting trace in Langfuse and record which attributes arrive. Repeat the check after every vLLM upgrade, since the release cadence is frequent and span content can change between minor releases.
Treat the server span as the infrastructure view and the application span as the business view. The server span shows how long vLLM took to queue and generate tokens, while your application span shows the user, the prompt version and the business outcome. Link the two by propagating the trace context from your application into the request, so both appear under one trace. Where the server span omits content, add prompt, user and session attributes in the application span instead. Decide this split before rollout, and document which fields are stored, because prompts can contain personal data that your retention settings must cover.
Joining server spans with application traces in one Langfuse view
In this approach, the application opens a span for each inference call, passes its trace context into the request sent to vLLM, and the server-side spans attach beneath that parent. The whole call then appears as one tree in Langfuse. Both sides must export to the same Langfuse project, and the context must survive every hop in between. Confirm how your vLLM version reads incoming trace context headers before you design around them, and check the Langfuse vLLM integration page for the supported setup.
- Client span creation: The application SDK opens a span for the chat or completion call and makes it the active context before the HTTP request is sent.
- Header propagation: The context is injected into request headers, commonly the W3C
traceparentheader, so the server can read a parent identifier. Verify the header name and behavior against the vLLM release you run. - Proxies in the path: Any gateway or reverse proxy must forward those headers unchanged, or the link breaks quietly and the server spans start a new trace.
- Single project target: Both exporters need the same Langfuse host and project keys, with the OTLP endpoint at
/api/public/otel.
Check that one trace ID appears on both the application span and the vLLM span in Langfuse before you rely on the tree for debugging.
Here the server keeps its own traces, and the application attaches a shared identifier, such as a session or user ID, to its spans and to the values it sends with each request. Joining happens by filtering and grouping, not through a parent-child tree. This layout suits cases where the application cannot pass headers through every hop, or where the inference server serves many callers and its traces should stand alone for capacity work.
- Session identifier: The application sets a session ID on its own spans and passes the same value in a request field or header that the server can record, so both sides group under one session.
- User attribution: A user identifier supports per-user usage questions, but it is personal data stored in traces, so it needs the same masking and retention review as prompts.
- Timing comparisons: Latency differences between client and server must be compared by hand from timestamps, since no parent-child structure links them.
- Server-only views: Operators can review inference health, load and errors without access to application traces, which narrows who sees prompt content.
Confirm that the shared identifier survives the full request path and that both sides appear under the same session filter in Langfuse.
The choice mostly changes what a single investigation looks like and which team can answer which question. A joined tree lets an engineer see time spent inside the server next to application retries and gateway delays. Linked separate traces keep inference infrastructure views apart from product usage, which can help when a platform team charges GPU time back to product owners.
- Debugging: A joined tree shows where time went across the application, any gateway and the model server in one view.
- Cost attribution: Cost reports depend on which token and model attributes the server spans carry, so confirm those fields before you design the report. Joining lets you attribute them to a feature, team or customer, which requires consistent tags on both sides.
- Multi-service requests: When several services call the same vLLM deployment, a shared parent makes fan-out visible, while separate traces need a session key to recover it.
- Volume and storage: Joined trees add spans to each request, which raises ClickHouse storage and query load. Size storage against expected trace volume, not against the number of user requests alone.
List the three questions your teams most often need answered and check which layout answers each one.
Before you depend on either design, run controlled requests and inspect the structure in Langfuse. The test should show the same trace ID on every span, the server span nested under the application span, and the session or user attributes present on both sides. Repeat it through every proxy in the path, for both standard and streaming responses, because streaming can change when spans close.
- Marked request: Send one request with a unique marker in its metadata so you can locate it quickly in Langfuse.
- Trace ID match: Compare the trace ID on the application span and the vLLM span. In the joined design they must match.
- Parent identifier: Confirm the server span lists the application span as its parent and does not open a new root trace.
- Failure paths: Test timeouts, client disconnects and server errors, since an aborted request can leave an orphan span behind.
- Upgrade regression: Repeat the test after each vLLM upgrade. Minor releases arrive about every two weeks, so the behavior can change between checks.
Store the test steps and expected results in your runbook so the check runs again after every upgrade.
Mapping vLLM span fields to Langfuse observations and attributes
This table compares the data a vLLM server span carries with the Langfuse fields that display it, and marks where exact names must be checked. Read it before writing attribute filters, dashboards or cost reports, because span names can change between vLLM releases and Langfuse versions. The main takeaway is that token usage and cost are only as complete as the model names and prices configured in Langfuse.
| vLLM span data | Langfuse field | What to confirm |
|---|---|---|
| Model name | Model field on the generation observation, used for grouping and price lookup | Confirm which attribute vLLM sets for the requested and served model in your version |
| Prompt and completion tokens | Usage details on the generation observation, shown as input and output token counts | Confirm the attribute names and that Langfuse maps them as usage on the observation |
| Cost | Calculated by Langfuse from usage and a model price definition | Cost stays blank or inaccurate until the model and its price are set in Langfuse |
| Latency (queue, first token, end to end) | Start and end times and latency on the observation | Confirm which latency attributes exist. Duration is always derivable from span timestamps |
| Request identifier | Metadata on the observation, used to match traces to server logs | Confirm whether vLLM sets a request ID on the span and whether it is stable across retries |
| Trace context and parent span | Trace and parent observation IDs that nest the vLLM span under application spans | Requires the calling application to propagate trace context. Confirm header handling in your setup |
| User, session and application tags | User ID, session ID, tags and metadata on the trace | vLLM does not set these by default. Add them in the calling application or gateway |
| Errors and finish reason | Status level and status message on the observation | Confirm how errors and finish reasons are exported before building alerts on them |
Securing the vLLM to Langfuse telemetry path
Telemetry from vLLM to Langfuse crosses three trust boundaries: the credentials that authorize writes to Langfuse, the network path that carries prompts and completions, and the vLLM server itself, which exposes more endpoints than its API key protects. The cards below cover each boundary so the trace pipeline does not become the weakest route into your inference stack.
Store Langfuse keys as secrets
The Langfuse public and secret keys authorize writes into your trace store, so they belong in your secrets manager or the orchestrator's secret objects, not in launch scripts, shell history or container images. Inject them as environment variables at runtime and confirm that process listings, container inspection output and CI logs do not reveal them. Plan rotation for both keys and document which vLLM hosts hold a copy, so a rotation does not silently stop tracing.
Langfuse OpenTelemetry docsEncrypt the OTLP endpoint
Prompts, completions and user identifiers travel in span payloads, so the connection from vLLM to the Langfuse OTLP endpoint at /api/public/otel should use TLS, with the certificate chain validated by the vLLM host. Terminate TLS at your ingress or reverse proxy in front of Langfuse Web, and confirm the exporter does not fall back to plain HTTP when a hostname is misconfigured. Ask your security team which internal certificate authority issues the certificate.
Allowlist egress to Langfuse only
Limit the vLLM host's outbound traffic to the Langfuse endpoint and the internal name resolution it needs. A vLLM server should not reach arbitrary internet destinations just because it exports telemetry. Test the rule by sending a trace, then attempting an unrelated outbound connection, which should fail. Record the rule in the same change record as the Langfuse keys, so reviewers see the whole telemetry path together.
Know the --api-key limits
The vLLM --api-key option protects endpoints under /v1, /v2, /inference and /cohere, but not /invocations, /pause, /resume, /abort_requests, /metrics or /health. Treating the key as a complete perimeter leaves control endpoints reachable. The vLLM security docs advise against relying on it alone. Check the exposed endpoints from a host outside the trusted network before go-live.
vLLM security docsPut a reverse proxy in front
The vLLM security docs recommend a reverse proxy that allowlists only the endpoints meant for users. Route the OpenAI-compatible paths your applications call, such as /v1/chat/completions, and block the rest, including /metrics, which Prometheus scrapers should reach over a separate internal path. Test the allowlist with each endpoint your applications use, because a missing route will show up as application errors rather than security alerts.
vLLM security docsIsolate multi-node vLLM traffic
The vLLM security docs state that communication between nodes in a multi-node deployment is insecure by default, with no authorization or encryption. Place cluster nodes on an isolated network segment that only the cluster uses, and keep that segment separate from the network that serves users and exports telemetry. Confirm this with your platform team before adding nodes, since a multi-node deployment often expands the number of hosts that hold Langfuse keys.
Why vLLM traces do not appear in Langfuse
This table lists the failures that most often stop vLLM spans from reaching Langfuse, with the cause and fix for each. Work through the rows in order, since the network and authentication checks usually explain silent drops before anything else needs changing. Rows that point to Langfuse-side ingestion issues are covered by the operations checks.
| Symptom or failure | Likely cause | Fix |
|---|---|---|
| Requests return 401 or 403 | Basic auth header missing, malformed, or built from the wrong key pair | Build the Authorization header as Basic base64 of public key and secret key from the same Langfuse project, and confirm both values by testing the request outside vLLM first |
| No traces appear and no error is logged | Endpoint path is wrong, such as a missing /api/public/otel suffix or a path copied from a different OTLP tool | Set the OTLP endpoint to the Langfuse host with /api/public/otel and confirm the exporter path in vLLM's startup configuration |
| Export errors name a timeout or connection refused | Langfuse host is not reachable from the GPU nodes because of DNS, routing, proxy or firewall rules | Test the host from a GPU node with curl on the same network path, then fix DNS, egress rules or proxy settings before changing vLLM |
| TLS handshake or certificate verify errors | Langfuse uses a certificate issued by an internal CA that the vLLM container does not trust | Add the internal root or intermediate CA to the container trust store used by the exporter process, then restart vLLM |
| Some spans appear, others are missing | Sampling drops spans, or the batch exporter flushes too late and is cut off at shutdown | Confirm the sampler setting is not dropping parent-based spans, and allow the exporter time to flush when the server stops |
| Import or startup errors mention OpenTelemetry modules | vLLM and OpenTelemetry SDK or exporter packages are at incompatible versions | Install the OpenTelemetry packages pinned by your vLLM release and retest after each upgrade of either side |
| Traces arrive but are incomplete or unlinked to app traces | Application does not propagate the trace context to vLLM, or the two sides use different trace settings | Pass the W3C traceparent header from the application into requests and check that both services export to the same project |
| Ingestion is accepted but the UI shows nothing | Problem on the Langfuse side such as worker backlog, ClickHouse write issues or project selection | Use the Langfuse operations and troubleshooting checks for ingestion, worker health and ClickHouse before changing vLLM again |
Questions teams ask before connecting vLLM to Langfuse
How much effort does connecting vLLM to Langfuse take compared with running both platforms?
The connection itself is usually a small share of the total work, because it comes down to configuring vLLM's OpenTelemetry export and an authenticated OTLP endpoint on Langfuse. The larger costs sit elsewhere: the GPU or accelerator capacity that runs vLLM, the self-hosted Langfuse stack with its PostgreSQL, ClickHouse, Redis or Valkey and blob storage, and the people who operate both. Effort rises when vLLM runs across several nodes, when traces must be correlated with application traces, or when network controls must be agreed with security teams. Ask any partner to split the quote into the connection work and the platform work so you can see which part recurs.
Can an in-house platform team connect vLLM to Langfuse without outside help?
Yes, if the team already operates vLLM and self-hosted Langfuse and is comfortable with OpenTelemetry concepts such as exporters, resource attributes and span context. The configuration is a few settings on the vLLM side and a project-level key pair on the Langfuse side, so the risk is less in the setup than in the surrounding decisions: which spans to keep, how to protect the endpoint, and how the trace data is retained. Teams without a Langfuse operator usually find the Langfuse platform work the harder part. An outside partner is most useful for a fixed-scope build with written deliverables and a verification step, which an internal team can also write for itself.
What do we need to provide before the work starts?
The work needs four things from you: a test vLLM host with a model loaded and the vLLM server running, a Langfuse project in a self-hosted instance with its public and secret keys available to the engineers who configure them, network access from the vLLM host to the Langfuse OTLP endpoint at /api/public/otel, and a named owner who can approve the trace fields that will leave your network. Also confirm whether vLLM sits behind a reverse proxy, because the vLLM security documentation recommends allowlisting only user-facing endpoints. Agree on a non-production environment first so trace contents can be reviewed before production traffic is sent.
How long does a basic vLLM to Langfuse setup take?
The duration depends on how many vLLM instances you run, whether Langfuse already exists and how quickly access and key approvals move through your change process. A single test host with a working Langfuse project is a short configuration exercise, while a multi-node production deployment, a new self-hosted Langfuse stack and a security review add stages that take longer. We do not publish a fixed timeline because no researched figure supports one. Ask for a schedule that lists each gate, such as key creation, network change approval, the first trace review and the production cutover.
Do we need a Langfuse Enterprise license to receive vLLM traces?
No. Langfuse states that all core features and APIs are available in the MIT-licensed open source version without limits, and it accepts OpenTelemetry traces over OTLP at its /api/public/otel endpoint. Enterprise features matter for other needs: project-level RBAC roles, data retention policies, audit logs, server-side data masking and SCIM provisioning all require an Enterprise license key on a self-hosted instance. If your review of vLLM traces depends on masking prompt content or on audit trails, check those requirements against the Langfuse license key documentation before you approve the design, because they change the cost of the platform side.
How do we verify that vLLM spans are arriving and useful?
Verify in three layers. First, confirm that the vLLM server starts without export errors and that a test request to an endpoint such as /v1/chat/completions produces a trace in the expected Langfuse project. Second, check that the server-side spans contain the fields you need, such as model name, timing and token counts, and that no prompt or completion content appears where policy forbids it. Third, send one request from an instrumented application and confirm that the application trace and the server span can be linked in the Langfuse UI. Keep a short written checklist with a pass or fail result for each item, and rerun it after each vLLM minor release because release notes can change span behavior.
What ongoing work does this integration create after launch?
Three recurring costs appear after launch. vLLM ships new minor releases about every two weeks, so someone must test the telemetry settings against each upgrade you adopt. Langfuse has its own release cadence and major upgrades change the infrastructure and data model, so trace ingestion must be rechecked when those land. Trace volume also grows with traffic, which raises ClickHouse storage and worker load and may need scaling decisions. Ask any partner whether these tasks sit in a retainer or in a separate change request, and whether the quote covers testing of new vLLM versions against your telemetry settings.
How DeployOpen scopes and delivers the vLLM to Langfuse tracing setup
DeployOpen plans and builds the vLLM to Langfuse tracing path inside your own infrastructure, from the OpenTelemetry endpoint and credentials to the spans your team reviews in Langfuse. Each engagement is fixed-scope, with the endpoints, network paths, data handling and deliverables agreed in writing before work starts.
How we scope
- We map which vLLM servers, models and API routes emit traces and which Langfuse project receives them.
- We confirm the Langfuse host, OTLP endpoint path and network route from each vLLM host to your Langfuse deployment.
- We record how prompts, completions and user identifiers are handled, so the written scope matches your data policy.
How we build
- We enable vLLM's OpenTelemetry export on a test server and verify spans arrive in a non-production Langfuse project.
- We store Langfuse credentials in your secrets system and keep them out of launch commands and container images.
- We combine server-side spans with application traces using matching trace context, and test the result end to end.
How we hand over
- We deliver a runbook with the configuration, the span fields captured and the steps to verify a trace.
- We document the vLLM version tested and the Langfuse version it was checked against, so upgrades can be planned.
- We walk your platform and security teams through the setup and the open questions that remain for your environment.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after the fixed-scope delivery.
- Retainer work can cover retesting the trace path after vLLM minor releases, which arrive about every two weeks.
- We can review tracing changes as part of security testing of your inference endpoints and their exposed routes.

