Add version parameter to LLM instrumentation#1702
Merged
dmontagu merged 3 commits intojulian/semconvs-messagefrom Feb 11, 2026
Merged
Add version parameter to LLM instrumentation#1702dmontagu merged 3 commits intojulian/semconvs-messagefrom
dmontagu merged 3 commits intojulian/semconvs-messagefrom
Conversation
Adds a `version` parameter that accepts `1`, `2`, or `[1, 2]`: - version=1 (default): legacy request_data/response_data format - version=2: structured OTel Gen AI semconv messages (gen_ai.input.messages, gen_ai.output.messages, gen_ai.system_instructions) - version=[1, 2]: both formats simultaneously for migration/testing Built on top of PR #1666 (julian/semconvs-message).
Deploying logfire-docs with
|
| Latest commit: |
21fff4e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cce1bd7d.logfire-docs.pages.dev |
| Branch Preview URL: | https://dm-semconv-version-param-v2.logfire-docs.pages.dev |
Remove v2 semconv attributes (gen_ai.input.messages, gen_ai.system_instructions, gen_ai.output.messages) from the bedrock test snapshot since the default version=1 no longer emits them.
OpenaiChatCompletionStreamState and AnthropicMessageStreamState now emit gen_ai.output.messages when version=2 is active, matching the non-streaming behavior.
dmontagu
added a commit
to brightsparc/logfire
that referenced
this pull request
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
versionparameter toinstrument_openai()andinstrument_anthropic()that accepts1,2, or[1, 2]version=1(default): legacyrequest_data/response_dataformatversion=2: structured OTel Gen AI semconv messages (gen_ai.input.messages,gen_ai.output.messages,gen_ai.system_instructions)version=[1, 2]: both formats simultaneously for migration/testingStacked on
Test plan
version=1version=2verify only semconv attributes emittedversion=[1, 2]verify both formats emitted