Skip to content

Conversation

@RKest
Copy link

@RKest RKest commented Nov 20, 2025

Description

Introduces ability to add additional attributes to generate_content {model.name} spans to Google GenAI instrumentation.

Motivation behind this change is to add (non-semconv) gcp.vertex.agent.event_id attribute, to generate_content {model.name} spans, in order to correlate events with spans in google/adk-python.

Broader motivation is:

  • Currently in ADK we trace inference in both generate_content and legacy call_llm spans.
  • We want to migrate fully to generate_content spans and deprecate call_llm spans.
  • However call_llm spans contain gcp.vertex.agent.event_id attribute, and we still want to correlate events with spans.

Note: Event in ADK is not synonymous with event in OTEL. In ADK, Event == LLM Request/Response or Tool Call/Result, in OTEL IIUC Event == Log.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Tested using:

  • Automated unit tests.
  • Using opentelemetry-instrumentor-google-genai off my fork in ADK, and successfully adding custom attributes to target span
image

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • 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

@RKest RKest requested a review from a team as a code owner November 20, 2025 13:55
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 20, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: RKest / name: Max Ind (d8cc094)

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.

5 participants