- Export vLLM server spans over OTLP with
--otlp-traces-endpoint. - Trace your application calls to vLLM’s OpenAI-compatible server with
openinference-instrumentation-openai.
Use both paths when possible. vLLM’s server-side OTLP spans show inference-server timing and request metadata. OpenInference OpenAI instrumentation captures the client-side prompt, response, token, model, and latency metadata for calls made through the OpenAI-compatible API.
Option 1: Export vLLM server spans over OTLP
vLLM defaults to OTLP/gRPC. Phoenix accepts OTLP/HTTP at<PHOENIX_COLLECTOR_ENDPOINT>/v1/traces, so set the exporter protocol before starting vLLM. This example sends spans to a local Phoenix at http://localhost:6006:
--otlp-traces-endpoint at your instance’s /v1/traces URL and pass your API key as a header:
Option 2: Trace OpenAI-compatible client calls
Install
Setup
Connect your application to Phoenix with theregister function:
Run vLLM
vLLM’s OpenAI-compatible server does not require an API key unless you start it with--api-key. The OpenAI client still requires a non-empty value, so the example uses EMPTY.
Observe
Open Phoenix and select themy-llm-app project for client-side spans. Each call appears as a ChatCompletion LLM span with the prompt, response, model, token usage, and latency. If you also enabled vLLM server OTLP export, select the vllm-server project to see server-side inference and request-processing spans.
Common Issues
- No client-side LLM spans: Make sure
register(..., auto_instrument=True)runs before your OpenAI client sends requests - No vLLM server spans: Confirm
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobufis set and--otlp-traces-endpointpoints to your Phoenix collector’s/v1/tracespath - Server spans appear in the default project: Confirm
OTEL_RESOURCE_ATTRIBUTESincludesopeninference.project.name=vllm-server - Server spans lack prompt or response text: Use the OpenInference OpenAI client path as well. vLLM’s server export does not include the same application-level input and output detail

