Skip to content

fix(telemetry): a gateway inference span names the deployment model that served the call as gen_ai.response.model #2078

Closed

Description

@dan-petty

What happened

The inference span of a gateway call sets gen_ai.response.model to the route name from the reply body, for example devops-chat. The OpenTelemetry GenAI semantic conventions define gen_ai.response.model as the name of the model that generated the response.

LiteLLM 1.103.0 names that model in the x-litellm-model-name reply header, for example openai/gpt-4o. Since #2031, devops-cli reads this header for pricing (LLMResponse.served_model), but the span does not use it.

What should happen

For a gateway call, the inference span sets gen_ai.response.model to the deployment model from x-litellm-model-name. gen_ai.request.model keeps the route name. When the header is absent, the span keeps the model from the reply body.

Evidence

  • LiteLLM 1.103.0 get_custom_headers sets x-litellm-model-name from the router deployment metadata (litellm_params.model). The router writes the route name in the reply body.
  • OpenTelemetry semantic conventions, GenAI spans: gen_ai.response.model is "The name of the model that generated the response".

Scope

src/devops_cli/ai/client/ span attributes and their tests. Depends on #2031 (served_model).

Intake folded this item into #2031 as a duplicate. It is a sibling: #2031 prices the call at the deployment model, and this item names that model on the span. This fold is more evidence for #1989.

Activity

  1. added
    type/bug
    scope/telemetry
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Priority: P2-Medium. This change improves correctness of telemetry data and aligns with standards, but does not block core functionality.
    • Value: Medium. Improves clarity and accuracy of AI spend monitoring for gateway calls.
    • Effort: Low. The fix only touches span attribute setting logic in a few files and tests.
  3. added a commit that references this issue on Oct 27, 2026
    78dbd1d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/telemetrytype/bug

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions