[processor/genainormalizer] Fix OpenInference flattened message normalization#48442
Closed
Jwrede wants to merge 1 commit into
Closed
[processor/genainormalizer] Fix OpenInference flattened message normalization#48442Jwrede wants to merge 1 commit into
Jwrede wants to merge 1 commit into
Conversation
…lization OpenInference emits messages as flattened indexed span attributes (e.g. llm.input_messages.0.message.role) but the processor only performed exact key matching against "llm.input_messages", which never appeared as a literal attribute key. This adds message reconstruction that collects the flattened attributes, rebuilds the message structure, and emits gen_ai.input.messages / gen_ai.output.messages as JSON strings following the GenAI semconv message schema. Fixes open-telemetry#48421
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
|
Member
|
@Jwrede the genainormalizer is still being donated to Contrib (see #46069). We are opening issues as we add the component, but we are not ready for those issues to be worked. The component will likely continue to undergo serious change as it is being donated and we aren't ready to accept other PRs for it yet. I'm going to close this for now, but look for the issue to be workable once the on-hold label is removed. |
Author
|
Thanks for the context @TylerHelmuth -- makes sense. I will hold off until the donation is complete and the component stabilizes. |
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
Fixes #48421
OpenInference represents messages as flattened indexed span attributes (
llm.input_messages.0.message.role,llm.input_messages.0.message.content, etc.) but the processor only performed exact key matching againstllm.input_messages, which never appears as a literal attribute key. This was a silent no-op for all message normalization.Changes:
llm.{input,output}_messages.N.message.*attributes and rebuilds them into GenAI semconv JSON (gen_ai.input.messages/gen_ai.output.messages)attributeAggregatorinterface to the processor for multi-attribute-to-one transformationsTest plan
createTracesProcessorwith the exact attribute format from the issuego vet ./...clean