Skip to content

Support more OpenTelemetry GenAI span attributes and events #356

Closed

Description

@soundTricker

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
[Problem]

Currently, ADK use OpenTelemetry to send tracing telemetry data to monitoring service.
But the information currently sent is limited and does not follow theOpenTelemetry Semantics.

For example, on Cloud Trace, it is shown that it is a GenAI span, but the number of input/output tokens is not shown.

Image

Also, the current discussion in OpenTelemetry is moving towards sending each message and choice as an event, so we should align with that.

Refs:
https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/
https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-events

Describe the solution you'd like

Support OpenTelemetry GenAI Span Attributes and Events.

Additional context
As a separate discussion, ADK is currently using CloudTraceSpanExporter, but the Cloud Trace API has strict limitations on the amount of data that can be sent, making it unsuitable for use with GenAI. I think it would be better to change this to use the OpenTelemetry Protocol (OTLP), but that's a separate issue.

Activity

  1. added
    core
    on Apr 24, 2025
  2. mbertani commented on May 15, 2025

    @mbertani

    Supporting the request of this needed functionality. It's unwise to go to production without cost visibility.

  3. mbertani commented on May 31, 2025

    @mbertani

    Any updates on this case? It would make a huge difference for my project to have this working properly :)

  4. changed the title [-]Support more OpenTelemetry GenAI span attributes and evnets[/-] [+]Support more OpenTelemetry GenAI span attributes and events[/+] on Aug 11, 2025
  5. Jacksunwei commented on Aug 11, 2025

    @Jacksunwei
    Collaborator

    There are quite a few changes related to this issue. We've finished all the changes following genai convention as much as we know. E.g. in https://github.com/google/adk-python/blob/main/src/google/adk/telemetry.py#L124-L128


    I'll close this issue now, and feel free to open new issue if you see any missing parts.

  6. Joong-Sunny commented on Mar 10, 2026

    @Joong-Sunny

    There are quite a few changes related to this issue. We've finished all the changes following genai convention as much as we know. E.g. in https://github.com/google/adk-python/blob/main/src/google/adk/telemetry.py#L124-L128

    I'll close this issue now, and feel free to open new issue if you see any missing parts.

    link is not valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

core

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions