Skip to content

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

Merged
dan-petty merged 1 commit into
mainfrom
fix/2078-gateway-span-deployment-model
Oct 27, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/2078-gateway-span-deployment-model

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Closes #2078

Change

The ai.llm.dispatch inference span sets gen_ai.response.model to the deployment model that the gateway reply names, from the x-litellm-model-name header, and to the reply-body model when the gateway names none. gen_ai.request.model keeps the model the client asked for.

_set_response_span_attributes is the only writer of the response model key. It now takes LLMResponse.served_model when it is present and LLMResponse.model when it is absent, the same fallback the spend path uses.

Verification

  • uv run devops ci test tests/test_ai_client_telemetry.py: 16 passed.
  • uv run devops ci fail-to-pass --base main: the new gateway test fails on base and passes with the fix.
  • uv run devops ci --only lint,format,typecheck: pass.
  • devops docs generate --sync-readme: no diff.

…hat served the call as gen_ai.response.model

Closes #2078
@dan-petty
dan-petty marked this pull request as ready for review October 27, 2026 19:59
@dan-petty
dan-petty merged commit 78dbd1d into main Oct 27, 2026
16 checks passed
@dan-petty
dan-petty deleted the fix/2078-gateway-span-deployment-model branch October 27, 2026 20:00
dan-petty pushed a commit that referenced this pull request Oct 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.7.4](v0.7.3...v0.7.4)
(2026-10-27)


### Bug Fixes

* **ai:** chat calls stream their reply, and the gateway keeps the
stream open past the 125 s edge timeout
([#2379](#2379))
([0abf552](0abf552)),
closes [#2365](#2365)
* **ai:** the devops ai failover help says that the gateway failover
records a route, not that it reroutes requests
([#2376](#2376))
([6560b93](6560b93)),
closes [#2079](#2079)
* **docs:** add home page, remove raw markdown publishing, and check
links ([#2070](#2070))
([#2372](#2372))
([7f9321c](7f9321c))
* **llm:** pass num_ctx with direct ollama embedding requests
([#2378](#2378))
([ff47504](ff47504)),
closes [#2089](#2089)
* **roadmap:** intake's reply schema limits each fixed field to its
values, so the model cannot leave type empty
([#2380](#2380))
([b9220b1](b9220b1)),
closes [#2370](#2370)
* **telemetry:** a gateway inference span names the deployment model
that served the call as gen_ai.response.model
([#2381](#2381))
([78dbd1d](78dbd1d))


### Performance Improvements

* **ci:** lower the coverage floor to 85% and fail a pull request below
90% on its changed lines
([#2375](#2375))
([9f97c14](9f97c14))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant