Skip to content

feat: propagate custom genai generate_content attributes to logs, in addition to spans#4103

Merged
aabmass merged 8 commits intoopen-telemetry:mainfrom
mwiatrowski:feature/extra-google-genai-attributes-logs
Jan 23, 2026
Merged

feat: propagate custom genai generate_content attributes to logs, in addition to spans#4103
aabmass merged 8 commits intoopen-telemetry:mainfrom
mwiatrowski:feature/extra-google-genai-attributes-logs

Conversation

@mwiatrowski
Copy link
Copy Markdown
Contributor

@mwiatrowski mwiatrowski commented Jan 15, 2026

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Added unit tests.
  • Tested the integration with ADK manually: I changed my local ADK fork to save extra attributes in OTel context and verified that they are included in the generated logs.

Does This PR Require a Core Repo Change?

  • Yes.
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@mwiatrowski mwiatrowski requested a review from a team as a code owner January 15, 2026 14:58
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Jan 15, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@mwiatrowski mwiatrowski force-pushed the feature/extra-google-genai-attributes-logs branch from 63376d7 to c78b43b Compare January 19, 2026 18:30
@aabmass aabmass merged commit 5429c6c into open-telemetry:main Jan 23, 2026
663 checks passed
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>
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.

8 participants