-
Notifications
You must be signed in to change notification settings - Fork 120
fix(ingest): detect the remaining agent instrumentation scopes #1138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Native Haystack sessions grouped by unrelated ID
When a native Haystack span carries both
session.idandgen_ai.conversation.id, it now selectssession.id. That key belongs to the OpenInference instrumentor, not the native tracer, so the span joins the wrong AI session.Learn more
The gateway selects the first nonempty key from each vendor's session list in run_predicates. Haystack's native tracer and its OpenInference instrumentor share one vendor ID, but only the latter uses
session.idas its session key. On native spans, an application-suppliedsession.idcan therefore override the previous canonical conversation ID. This ID flows into the session grouping in sessionKey.Example: A native Haystack span has
gen_ai.conversation.id=agent-42and a genericsession.id=browser-9. The gateway now stampsbrowser-9; previously it stampedagent-42, keeping that agent's traces together.Recommended fix: Choose
session.idfor Haystack only when the scope identifies its OpenInference instrumentor, and retaingen_ai.conversation.idas the native scope's session key. Cover a span containing both keys in each scope.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid, fixed in b88400a. Haystack now has two entries under the same vendor id: the
openinference.instrumentation.haystackscope readssession.idfirst, and native haystack spans read onlygen_ai.conversation.idagain. google_adk and pydantic_ai were already fine becausesession.idsits after their own keys on both scopes. New testsession_key_order_follows_the_emitting_dialectcovers a span with both keys on each scope for all three vendors.