LiteLLM OpenTelemetry v1 to v2 tracing migration

Turn on LITELLM_OTEL_V2 without breaking dashboards: renamed root and inference spans, guardrail spans under the request root, vendor presets and which saved queries and alerts to rewrite first.

On this page

LiteLLM OpenTelemetry v1 to v2 migration: what changes first

A self-hosted LiteLLM gateway that sends traces to a backend with dashboards and alerts built on v1 span names does not need a rewrite to move to v2. Turning on LITELLM_OTEL_V2=true keeps your existing OTEL_* environment variables and the OpenTelemetry callback working, but it renames spans that your saved queries, dashboard panels and alert rules probably filter on. The work is therefore in the query layer, and the flag is only the switch that exposes the new names.

The flag is read once at startup, so every change to it is a proxy restart, and you cannot toggle v2 on a running pod to compare output. Plan the switch as a deployment change with the same review and rollback path as any other release. The supported sequence is to enable v2 in a non-production environment first, confirm that traces arrive at your backend with the expected root and inference spans, and only then roll the flag out to production. Keep the v1 configuration available so that reverting is one restart with the flag removed. Confirm the exact behavior for your image version against the LiteLLM OpenTelemetry v2 migration guide before you set the flag in any environment.

Before the rollout, inventory every query, panel and alert that references a v1 span name, and record which ones were written against the old root span. Those are the first items to rewrite, because they will return empty results rather than errors when the names change. Ask your team to confirm which backend owns each dashboard and who is paid or assigned to maintain it, since that owner will need to sign off on the new names.

Which span and naming changes break existing queries

This table lists each span and naming change in LiteLLM OpenTelemetry v2 and shows what it does to dashboards, saved queries and alerts, with the action to take for each. Read it row by row against your current trace queries, and treat the first two rows as the ones most likely to silently empty existing panels.

Change in v2Impact on dashboards, saved queries and alertsAction to take
Feature flag LITELLM_OTEL_V2=trueTracing switches to the v2 implementation. The flag is read once at startup, so changing it on a running pod has no effect until restart.Set the flag in a staged environment first, restart the proxy, and confirm new span names appear before changing any dashboard.
Existing OTEL_* variables and callbackNo change in behavior is expected. Exporter endpoints, headers and the callback configuration keep working, so export setup does not need rewriting.Keep current OTEL_* settings. Confirm against the migration guide that your callback configuration is unchanged for your version.
Root span owned by FastAPI instrumentationThe root span is no longer named Received Proxy Server Request. Queries, panels and alerts filtering on that name return no data.Rewrite filters to match the route name, or the http.route attribute, such as POST /v1/chat/completions. Update alerts first, since they fail silently.
Root span named by routeRoute names are shared by every caller on that endpoint, so a query grouped by span name now separates traffic by API path rather than by proxy request type.Review group-by fields and aggregations. Add filters on your own attributes if you need per-team or per-key breakdowns.
Inference span named {operation} {model}Dashboards that match the old inference span name or group by it will change. Model names now appear in the span name itself.Update span name filters to the new pattern. Check that model-level panels still show each deployed model name.
Inference span kind CLIENTQueries or service maps that expect a specific span kind for LLM calls may drop or reclassify these spans.Confirm the kind filter in each saved query and service map view. Adjust to CLIENT where a kind filter exists.
Guardrail spans as siblings of the LLM call spanGuardrail spans no longer sit inside the LLM call span. Any query computing guardrail latency as a child of the inference span will miss them.Query guardrail spans under the request root. Recalculate latency panels that subtract guardrail time from inference time.

How v2 spans nest under one request

The request starts at the FastAPI-owned root span, named after the route such as POST /v1/chat/completions. Under that root sit the guardrail spans and the LLM call span, which is a CLIENT span named {operation} {model}. Both are siblings under the same root, so a trace shows the guardrail checks and the model call side by side. Spans leave the gateway over OTLP to an OpenTelemetry Collector, which hands them to the backend. Check that the root span name and the inference span name match the queries you plan to rewrite.

Guardrail and LLM spans are siblings under one route-named root span.

Which saved queries and alerts to rewrite first

Rewrite the assets that page someone or drive a decision first, then the dashboards. Each card below names an asset class, what the v2 span changes do to it, and the field to filter on instead, so the team can work through the list in order of impact.

Alerts on root-span duration

Duration alerts that match the root span by its old name will stop firing, which looks like a clean dashboard rather than an outage. In v2 the root span is owned by FastAPI instrumentation and named after the route, for example POST /v1/chat/completions. Rewrite the filter to match the route name or the http.route attribute, then confirm the alert still fires against a deliberately slow test request in a non-production environment. Rewrite this first because it is the most likely alert to go silent unnoticed.

Migration guide

Error alerts keyed on span status

Error alerts that depend on span status or on the root span's name need a check against the new tree before they are trusted. Errors can now surface on the FastAPI root span, the inference span, or a guardrail span, so a filter scoped to one span name may miss failures in another. Build the query to cover every span that can carry an error for the route, then test it by triggering a provider failure and a guardrail rejection in staging. Do not assume the count matches the v1 baseline.

Queries grouping by the old root name

Saved queries and dashboards that group or filter on Received Proxy Server Request will return empty results after the switch. Replace the filter with the route name or http.route, and keep a short mapping table so historical v1 data can still be compared with v2 data for the same route. Check that the group-by values cover each proxy endpoint your callers use, not only chat completions.

Panels grouping by inference span name

Any panel that groups by inference span name will split into many series, because v2 names inference spans {operation} {model} and sets span kind to CLIENT. Filter on the operation and model attributes instead of parsing the span name, and set span kind to CLIENT when selecting LLM calls. This keeps per-model latency panels stable even when a model name changes.

Guardrail latency and count queries

Queries that assumed guardrail spans were children of the LLM call span will undercount or misattribute time once they become siblings under the request root. Rewrite latency math so guardrail time is summed against the request root, not subtracted from the LLM span, and rebuild any count query that joined guardrail spans to their parent LLM span. Verify with one request that has a guardrail and one that does not.

Per-model cost and token dashboards

Cost and token panels built on the inference span will still work only if the attributes they read are unchanged, so confirm that before rewriting anything. Compare totals for one day under v1 and v2 against your provider invoices and gateway spend records. Rewrite these last, after the alert paths are settled, because they inform reporting rather than paging and a discrepancy is easier to investigate once the alerting is known to be correct.

How vendor presets pass through the mapper chain

Backends and vendor presets do not read span data directly. They pass spans through a mapper chain that renames attributes and decides where fields sit, so a preset written for v1 can name or place a field differently under LITELLM_OTEL_V2=true. Treat every preset as something to re-verify, not something to assume still works. Before cutover, list each preset your team uses, the backend it feeds, and every field your dashboards, saved queries and alerts read from it.

Test each preset against a staging trace before production traffic reaches it. Send a representative request through a staging gateway with the flag on, capture the exported span, and compare its attributes with the v1 capture for the same request type. Confirm which attributes the mapper still emits, which have moved to a new key or span, and which are missing. Repeat the check for guardrail and streaming requests, since those produce spans in different positions under the request root. Also review any custom mapping your team added, because a custom rule that targets a v1 attribute name may silently match nothing in v2.

Confirm the exact mapper behavior and any preset changes in the LiteLLM OpenTelemetry v2 migration guide, and ask the backend vendor whether its preset has been updated for the v2 attribute names and span layout. The supplied material does not list the individual mapper rules or preset differences, so do not rely on this page for them. Record the answers in your change ticket, and keep the staging captures so you can show what changed if a dashboard breaks after cutover.

What to inventory and set up before enabling v2

Enabling LITELLM_OTEL_V2 changes span names and parent relationships, so anything that depends on the old shape breaks silently. The cards below cover what to list, what to pin, where to test and how to get back to v1 before the flag goes anywhere near production.

Inventory every span reference

List each dashboard panel, saved query, alert rule and scheduled report that matches on the span name Received Proxy Server Request, on parent-child relationships, or on guardrail spans. Record the owning team and the backend that stores each one. Queries that filter on the old root name must move to the route name or http.route, so this list sets the order of rewrites. Keep it in version control so reviewers can see what changed.

Migration guide

Record the running image and OTEL settings

For each environment, write down the exact LiteLLM image tag the proxy runs and every OTEL_* variable and callback setting it uses. Confirm the image tag is pinned rather than floating, since the flag only takes effect on a build that supports it. Note the configuration source, whether a Helm values file, a Kubernetes manifest or a config file, so the flag is added in the same place every time and survives the next deployment.

Build a staging environment with real traffic

Run the candidate LiteLLM version with LITELLM_OTEL_V2=true in a staging environment that receives production-like request patterns, including streaming calls, guardrail-enabled routes and the model providers you use in production. Compare the traces it produces with production traces for the same routes. Check that guardrail spans now appear as siblings of the LLM call span under the request root, and that dashboards render with the new names.

Place a Collector in front of the backend

Route LiteLLM telemetry through an OpenTelemetry Collector instead of sending it straight to the backend, so you can apply processors and change exporters without redeploying the proxy. The team should decide which Collector release it will run and pin that version. The latest release listed in the supplied facts is v0.163.0, released October 16, 2026, so confirm it against your distribution and component stability before adopting it.

Collector docs

Write the rollback plan and restart step

Decide how you will return to v1 and document it before the change. The flag is read once at startup, so turning it off in configuration does nothing until the proxy restarts. Name the restart command or rollout for each environment, who approves it and how you confirm the proxy is emitting v1 spans again. Keep the existing OTEL_* variables and callback unchanged so the rollback touches only the flag.

Migration sequence with checks and rollback points

This sequence moves LiteLLM tracing from v1 to v2 in staging first, checks each change that dashboards and alerts depend on, and keeps a rollback path open until v1 queries are retired. Each step ends with a check that decides whether to continue.

  1. Enable the v2 flag in staging

    Set LITELLM_OTEL_V2=true on the staging proxy and restart it, because the flag is read once at startup and a running process will not pick it up. Confirm the existing OTEL_* variables and the OpenTelemetry callback are still in place, since the migration guide says they keep working. The step is done when staging restarts cleanly and traces still reach your backend. Rollback point: unset LITELLM_OTEL_V2 and restart. Confirm the exact rollback command and any caveats in the LiteLLM OpenTelemetry v2 migration guide before you rely on it.

  2. Check root span names and routes

    Send test requests to a chat completions route and inspect the root span. In v2 the root span is owned by FastAPI instrumentation and named after the route, for example POST /v1/chat/completions, instead of the older name. Confirm the route name or http.route attribute is present on every test request. The step is done when each tested route produces a root span with a route name. Rollback point: unset the flag and restart staging, then confirm the v1 root name returns.

  3. Check inference span naming and kind

    Find the LLM call spans for a test request and confirm they are named {operation} {model} and carry span kind CLIENT. Check at least one request per model family you route through the gateway, so provider-specific naming differences surface early. The step is done when every inference span matches the pattern and kind. Rollback point: unset the flag and restart staging. Record any span that does not match before moving on, since dashboards grouped by span name will break at that point.

  4. Confirm guardrail spans sit under the request root

    Run a request through a guardrail you have configured and check the trace tree. In v2 guardrail spans are siblings of the LLM call span under the request root, not nested beneath the call. Confirm the parent relationship in your backend, because any query that assumed the old nesting will return different results. The step is done when guardrail and LLM spans share the same request root in a sample trace. Rollback point: unset the flag and restart staging, then compare the trace tree against the v1 layout.

  5. Rewrite saved queries and alerts in priority order

    Inventory every saved query, dashboard panel and alert that filters on Received Proxy Server Request, span names, or nesting. Rewrite the highest-impact ones first, usually alerts that page someone, then dashboards used in incident reviews, then ad hoc queries. Test each rewritten query against staging traces with the flag on and off so you know it returns the same data. The step is done when every paging alert returns results in staging. Rollback point: keep the v1 query alongside the v2 version until the production window, so you can restore it without rebuilding it.

  6. Verify vendor presets through the mapper chain

    If your observability vendor provides a preset or mapper for LiteLLM spans, confirm that the preset still maps the v2 attribute names and span shapes correctly. Check that the mapper chain produces the fields your dashboards expect for each provider you use. Ask the vendor which preset versions support v2 before you enable it in production, since the migration guide does not replace vendor documentation. The step is done when a staging trace shows the expected fields after going through the presets. Rollback point: revert the preset or mapper change along with the flag, and confirm the order of rollback with your vendor.

  7. Enable v2 in production during a planned window

    Schedule the production change in a window agreed with the teams that own dashboards and on-call alerts, and tell them which queries were rewritten. Set LITELLM_OTEL_V2=true on production, restart the proxy pods in your normal rollout method, and confirm each pod reads the flag after restart. The step is done when production traces show route-named root spans and CLIENT-kind inference spans. Rollback point: unset the flag and restart the production proxy, then confirm traffic and traces return to the v1 shape. Keep the change record so the rollback path is clear to the on-call team.

  8. Watch production and retire v1 queries last

    Monitor the rewritten alerts and dashboards through a defined observation period that your team sets in advance, checking for gaps in data, unexpected empty panels and alerts that fire or stay silent. Log every discrepancy and fix it before removing anything. Retire the old v1 queries only after the observation period ends without open issues. The step is done when the team signs off that all paging alerts and dashboards show the expected data. Rollback point: while v1 queries still exist, unset the flag and restart if a critical gap appears, then fix the query before trying again.

What makes the tracing migration take longer

This table lists the factors that expand or shrink the v1 to v2 tracing work, the effect each one has, and the question to put to a partner before agreeing a fixed scope. Read each row against your own estate, because the total effort usually depends on how many dashboards, alerts and teams sit on the span names that change.

DriverEffect on the workQuestion to ask in a quote
Dashboards and saved queries that filter on span namesEach query filtering on the old root span name must move to the route name or http.route, and each one needs checking against v2 output.How many dashboards and saved queries reference the old span names, and who will inventory them?
Alerts tied to root-span namesAlerts keyed on the old root name can go silent after the flag flips, so each one needs a rewrite and a test.Which alert rules match on span name, and will they be tested against v2 traces before cutover?
Guardrails in the request pathGuardrail spans move to siblings of the LLM call under the request root, which changes any query that assumed the old nesting.Which guardrails are enabled per team or key, and which queries depend on their parent span?
Custom or vendor-specific mappersMapper chain entries for vendor presets may need review, since attribute and naming behavior must be confirmed for each backend.Which mappers or presets are customized, and who reviews their v2 output?
Number of LiteLLM deployments and environmentsEach proxy deployment and each environment needs the flag set, a startup restart, and its own verification pass.How many deployments, clusters and environments run LiteLLM, and in what order will the flag roll out?
Existing Collector pipeline and its authenticationAn existing pipeline may need receiver and exporter changes, and authenticator extensions must still admit the traffic.Is a Collector already in place, which authenticator extensions protect it, and does the pipeline need changes?
Teams that own dashboardsEvery owning team must review and sign off on its renamed queries, which adds coordination time that does not shrink with technical skill.How many teams own dashboards or alerts that touch LiteLLM traces, and who approves changes for each?

Where the OpenTelemetry Collector fits in the export path

The OpenTelemetry Collector sits between the LiteLLM gateway and your storage and dashboards, receiving, processing and exporting telemetry without tying the pipeline to one vendor. Once v2 tracing is on, the spans carry renamed roots, the inference span is named {operation} {model}, and guardrail spans sit under the request root. Those changes are independent of where the Collector runs. Decide placement first: run a Collector agent beside the gateway pods when you want each node to forward data with little configuration, or a central gateway Collector when several sources need one place for processing and export. Either way, confirm the exporter settings and the backend you already use before you change the flag, so that a placement choice does not hide a span rename in the middle of a dashboard review.

Plan the Collector as a supply chain you must justify to security reviewers. The Collector repository is licensed under Apache-2.0. Its releases ship contrib builds with signed artifacts, SHA256 checksums and SBOM files, alongside the Collector builder and the OpAMP supervisor. Verify those artifacts against your image policy, pin the version, and record which distribution and components your configuration uses, because core components have mixed stability levels documented in each component's README. For incoming connections, authenticator extensions can check OIDC tokens on receivers, and the oauth2client extension can add credentials to outgoing exporter requests. Confirm with your identity team which token issuer and client credentials the Collector should use, and test both directions before production traffic arrives.

OpenTelemetry is not an observability backend. It generates and moves traces, metrics and logs, but storage, querying and visualization stay in the tools your team already runs. That means saved queries and alerts that filter on http.route or the route name must be rewritten in those tools, not in the Collector. Ask each backend owner whether their trace store indexes the new attributes and whether retention periods for the old and new span names will overlap during the cutover.

Questions teams ask before migrating LiteLLM tracing

How much effort does a LiteLLM tracing migration take, and what drives it?

Effort is driven less by the flag itself than by the amount of telemetry-dependent work around it. Turning on LITELLM_OTEL_V2 is a configuration change, but the span names, parent-child structure and attributes that your dashboards, saved queries and alerts depend on all shift. The main drivers are the number of saved queries and alerts, how many dashboards filter on the old root span name, how many guardrail spans your queries inspect, and how many telemetry backends you run. Vendor-specific trace presets add work if your backend maps spans through a mapper chain. Ask any partner for a quote built from a written inventory of these items, since no effort figure can be stated responsibly without one.

How long does the migration take, and why does it depend on saved queries and alerts?

Duration depends mainly on how many queries, dashboards and alerts must be rewritten, tested and approved by their owners. The LiteLLM migration guide explains the exact span changes, so the technical switch is usually the short part. Each saved query that filters on the old root span name must move to the route name or http.route, and each alert must be checked for the same reason, because a rule that silently matches nothing is a monitoring gap. Teams that keep a clear inventory and staging environment move faster. Confirm the schedule against your own inventory before agreeing to dates.

What must our team provide before the migration starts?

The team should provide a complete inventory of dashboards, saved queries and alerts that read LiteLLM traces, with an owner for each item. You also need a staging LiteLLM deployment where v2 can be enabled safely, access to the tracing backend and its query and alerting configuration, and someone who can approve changes to dashboards that business or security teams rely on. Include the OpenTelemetry settings your deployment already uses, such as the OTEL_* variables and the callback configuration, so the work starts from what is actually running. Missing owners are the most common reason a migration stalls.

Can an internal team do this migration alone, and what skills does it need?

An internal team can do it if it has the skills to read the migration guide, operate the LiteLLM proxy, and work in the tracing backend's query language and alerting rules. The work needs someone who understands OpenTelemetry concepts such as spans, span kinds, parent-child relationships and attributes, and someone who can edit dashboards and alerts without breaking owners' views. Basic familiarity with the Collector helps when vendor presets or pipelines are involved. If your team lacks one of these skills or has limited time, a partner can take the rewrite and testing work under a written scope.

Can v1 and v2 tracing run side by side for comparison?

The flag is read once at startup, so comparison usually means running a separate staging instance with v2 enabled while production stays on v1, or restarting a single instance after changing the flag. Running both behaviors in one process is not how the setting works. Compare the same test requests in both environments and check the root span names, inference span names, guardrail placement and attributes that your queries use. Confirm the exact behavior in the migration guide and in your own staging environment before relying on the comparison.

What breaks if saved queries and alerts are not rewritten?

Queries that filter on the old root span name, Received Proxy Server Request, will stop matching because v2 names the root span after the route, such as POST /v1/chat/completions. Dashboards that group by that name will show empty or misleading panels. Alerts built on those queries can go quiet without raising an error, which is the most serious risk. Guardrail spans now sit as siblings of the LLM call span under the request root, so queries that assumed a nested structure may return incomplete results. Rewrite the queries that depend on these names first, then test each alert against known traffic.

Does the migration change the LiteLLM image or the database?

The migration is controlled by an environment setting, LITELLM_OTEL_V2, and the existing OTEL_* variables and callback keep working, so it does not require a new image by itself. Confirm this against the release you run, because the image version and database schema are separate decisions. Any LiteLLM version change, schema migration or database work should follow its own runbook, with backups taken first. Keep those changes out of the tracing cutover so that a problem can be traced to one cause.

How DeployOpen scopes and delivers the tracing migration

DeployOpen plans, implements and documents self-hosted open-source platforms inside the client's own infrastructure, so the LiteLLM tracing migration runs against your collector, dashboards and alert rules. The work is agreed as a fixed scope in writing before any change to LITELLM_OTEL_V2 is made.

How we scope

  • Inventory every saved query, dashboard panel and alert that filters on the old root span name Received Proxy Server Request.
  • Confirm which LiteLLM proxy instances, environments and OTEL_* settings the v2 flag will reach, and in what order.
  • Agree in writing which guardrail, inference and vendor-preset traces must be verified before the migration is called complete.

How we build

  • Enable LITELLM_OTEL_V2 in a non-production environment first, since the flag is read once at startup and needs a restart to take effect.
  • Rewrite queries to use the route name or http.route in place of the old root span name, then compare results against v1 traces.
  • Test guardrail spans under the request root and vendor presets through the mapper chain against your collector configuration.

How we hand over

  • Deliver a written record of changed queries, alerts, dashboards and environment variables, with the before and after names for each.
  • Document the rollback path, including how to revert the flag and restart instances, so your team can run it without DeployOpen.
  • Walk your operations and analytics staff through the new span names, span kinds and guardrail placement, and confirm the handover in writing.

How we support

  • Engagements are fixed-scope, so changes after sign-off are handled through a written change to the scope and its quote.
  • Ongoing support, upgrades and continuous testing are available as a retainer if your LiteLLM release line changes again.
  • Ask for the written scope, named deliverables and acceptance criteria in your quote before work starts.

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.