feat: propagate custom genai generate_content attributes to logs, in addition to spans#4103
Merged
aabmass merged 8 commits intoopen-telemetry:mainfrom Jan 23, 2026
Conversation
DylanRussell
approved these changes
Jan 15, 2026
aabmass
reviewed
Jan 15, 2026
...trumentation-google-genai/src/opentelemetry/instrumentation/google_genai/generate_content.py
Outdated
Show resolved
Hide resolved
63376d7 to
c78b43b
Compare
…g convention as well" This reverts commit 72a5c99.
aabmass
approved these changes
Jan 23, 2026
wikaaaaa
pushed a commit
to wikaaaaa/opentelemetry-python-contrib
that referenced
this pull request
Feb 5, 2026
…addition to spans (open-telemetry#4103) * feat propagate custom genai generate_content attributes to logs in addition to spans * Put the extra attributes on logs that follow the old semanting convention as well * Use dict[str, AttributeValue] instead of dict[str, Any] * Revert "Put the extra attributes on logs that follow the old semanting convention as well" This reverts commit 72a5c99. * Update CHANGELOG.md * Fix lint --------- Co-authored-by: Aaron Abbott <aaronabbott@google.com>
sightseeker
added a commit
to sightseeker/opentelemetry-python-contrib
that referenced
this pull request
Mar 11, 2026
…addition to spans (open-telemetry#4103) * feat propagate custom genai generate_content attributes to logs in addition to spans * Put the extra attributes on logs that follow the old semanting convention as well * Use dict[str, AttributeValue] instead of dict[str, Any] * Revert "Put the extra attributes on logs that follow the old semanting convention as well" This reverts commit 72a5c99. * Update CHANGELOG.md * Fix lint --------- Co-authored-by: Aaron Abbott <aaronabbott@google.com>
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.
Description
#3961 added an ability to pass additional attributes to be added to generate_content {model.name} spans in Google GenAI instrumentation, through Open Telemetry context.
This PR extends that functionality by saving those attributes in generated logs as well.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.