Skip to content

docs(otel): document the span-wide cap on OpenInference per-index message attributes - #1403

Open
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
litellm_docs_otel_openinference_message_cap
Open

docs(otel): document the span-wide cap on OpenInference per-index message attributes#1403
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
litellm_docs_otel_openinference_message_cap

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Companion to BerriAI/litellm#40562 (LIT-4875). The openinference mapper now caps llm.input_messages.{idx}.* and llm.output_messages.{idx}.* under one span-wide allowance (an eighth of the 128 default, 8 messages total, at least half reserved for the response) so long conversations stop evicting the gen_ai.* model, usage, cost, and finish-reason attributes. This adds a "Chat messages are capped" section next to the existing "Tool definitions are capped" one and links the two per-index rows in the openinference attribute table to it

The section spells out which prompt messages keep their keys when the prompt is over budget: message 0 plus the most recent turns, under their original indices, so a 60-turn prompt with one reply yields llm.input_messages.0, .54 through .59, and llm.output_messages.0. Phoenix renders those as a dense list in the same order, which the section calls out so a reader does not mistake the gap for lost messages

The attribute table now describes input.value and output.value as arrays of each message's role and text, since the mapper builds them from message_content() and drops tool calls and non-text parts. Only the canonical gen_ai.input.messages and gen_ai.output.messages blobs carry the full message objects

Link to Devin session: https://app.devin.ai/sessions/9136fdfc8ff84ec5aa190a20c36965d4
Open in Devin Desktop: https://app.devin.ai/desktop/session/9136fdfc8ff84ec5aa190a20c36965d4?variant=devin
Requested by: @yucheng-berri


Note

Low Risk
Documentation-only changes to OTel v2 observability guides; no runtime or security impact.

Overview
Documents OpenInference per-index chat message capping for OTel v2, as a companion to the implementation in the linked PR.

Adds a "Chat messages are capped" section beside the existing tool-definition cap: it explains why llm.input_messages.{idx}.* and llm.output_messages.{idx}.* share a span-wide budget (8 messages under the default 128-attribute limit, with at least half reserved for the response), which indices survive on long threads (message 0 plus the most recent turns), and that input.value / output.value and gen_ai.* message blobs are not truncated by this cap.

The OpenInference attribute table now links the per-index message rows to that section and clarifies that input.value and output.value are JSON arrays of each message's role and text (not full objects with tool calls). It also notes Phoenix compacts sparse per-index keys when rendering.

Reviewed by Cursor Bugbot for commit 08d95e8. Bugbot is set up for automated code reviews on this repo. Configure here.

…sage attributes

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
litellm Ready Ready Preview Sep 13, 2026 2:08am UTC

Request Review

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

devin-ai-integration[bot]

This comment was marked as resolved.

…st turns

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…rays

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 08d95e8. Configure here.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread docs/observability/opentelemetry_v2.md Outdated
… role

Co-Authored-By: Devin AI <158243242+devin-ai-integration[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.

2 participants