Skip to content

feat(adk): pass telemetry attributes through toolbox-adk - #720

Merged
anubhav756 merged 3 commits into
googleapis:mainfrom
AjmeraParth132:feat/adk-telemetry-attributes-integration
Jul 28, 2026
Merged

feat(adk): pass telemetry attributes through toolbox-adk#720
anubhav756 merged 3 commits into
googleapis:mainfrom
AjmeraParth132:feat/adk-telemetry-attributes-integration

Conversation

@AjmeraParth132

Copy link
Copy Markdown
Contributor

Background

toolbox-core now supports TelemetryAttributes and sends them through MCP _meta for extended telemetry / SQLCommenter (#632, #634). toolbox-adk did not expose that flow, so ADK users could not attach model, user ID, or agent ID metadata when invoking Toolbox tools through ToolboxToolset.

This PR adds ADK pass-through support for telemetry attributes.

Changes

  • Add telemetry_attributes to ToolboxToolset.
  • Pass telemetry_attributes into each wrapped ToolboxTool.
  • Add telemetry_attributes support to ToolboxTool.
  • Support static TelemetryAttributes and sync/async callbacks.
  • Support callbacks that accept ADK ToolContext, matching the existing auth token getter
    pattern from feat(adk): Support ToolContext for auth_token_getters in toolbox-adk #579.
  • Resolve telemetry attributes per invocation and apply them to a derived core tool via
    add_telemetry_attributes(...).
  • Avoid mutating the shared wrapped core tool so context-specific user/agent metadata does not
    leak between invocations.
  • Preserve telemetry configuration when bind_params(...) returns a new ADK wrapper.
  • Add regression coverage for user identity cleanup when telemetry resolution fails.

Related

@anubhav756

Copy link
Copy Markdown
Contributor

/gcbrun

@anubhav756
anubhav756 marked this pull request as ready for review July 21, 2026 06:30
@anubhav756
anubhav756 requested a review from a team as a code owner July 21, 2026 06:30
@anubhav756
anubhav756 force-pushed the feat/adk-telemetry-attributes-integration branch from 41cada5 to ced41bb Compare July 21, 2026 06:30
@anubhav756

Copy link
Copy Markdown
Contributor

/gcbrun

@AjmeraParth132
AjmeraParth132 force-pushed the feat/adk-telemetry-attributes-integration branch 2 times, most recently from 2baed48 to c69e841 Compare July 21, 2026 06:44
@anubhav756

Copy link
Copy Markdown
Contributor

/gcbrun

@anubhav756 anubhav756 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed let's add documentation to the docsite repo following this. I'm also thinking if we can optionally add some integration tests as well?

Comment thread packages/toolbox-adk/tests/unit/test_tool.py Outdated
Comment thread packages/toolbox-adk/src/toolbox_adk/tool.py
Comment thread packages/toolbox-adk/src/toolbox_adk/tool.py
Comment thread packages/toolbox-adk/src/toolbox_adk/toolset.py
@anubhav756

Copy link
Copy Markdown
Contributor

/gcbrun

@anubhav756
anubhav756 force-pushed the feat/adk-telemetry-attributes-integration branch from 84265e7 to fecb875 Compare July 22, 2026 11:46
@anubhav756

Copy link
Copy Markdown
Contributor

/gcbrun

@anubhav756
anubhav756 force-pushed the feat/adk-telemetry-attributes-integration branch from fecb875 to 611a197 Compare July 23, 2026 08:24

@twishabansal twishabansal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock multi approvers CI check

@anubhav756

Copy link
Copy Markdown
Contributor

/gcbrun

@AjmeraParth132

Copy link
Copy Markdown
Contributor Author

also, @anubhav756 can you ptal at the failing checks, looks like an issue with integration tests' google cloud set up!

ERROR tests/integration - ModuleNotFoundError: No module named 'google.cloud'

@anubhav756
anubhav756 merged commit 6e29ef9 into googleapis:main Jul 28, 2026
31 of 32 checks passed
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.

3 participants