Skip to content

feat(telemetry): capture tool execution error code in OpenTelemetry spans#4616

Open
Achuth17 wants to merge 2 commits intogoogle:mainfrom
Achuth17:feat/add-error-code-to-trace
Open

feat(telemetry): capture tool execution error code in OpenTelemetry spans#4616
Achuth17 wants to merge 2 commits intogoogle:mainfrom
Achuth17:feat/add-error-code-to-trace

Conversation

@Achuth17
Copy link

Introduces ToolExecutionError and ToolErrorType (HTTP status codes) to standardize error reporting for tool failures. Updates trace_tool_call and function execution handlers to extract and record error.type semantics.

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

2. Or, if no issue exists, describe the change:

If applicable, please follow the issue templates to provide as much detail as
possible.

Problem:
A clear and concise description of what the problem is.

Solution:
A clear and concise description of what you want to happen and why you choose
this solution.

Testing Plan

  • Added tests for different supported error code scenarios (InternalServerError, Timeout) and an unsupported error code scenario (ValueError) where the error.code falls back to the error's class name.

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Please include a summary of passed pytest results.

Manual End-to-End (E2E) Tests:

  • Tested manually using adk web

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

Add any other context or screenshots about the feature request here.

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@adk-bot adk-bot added the tracing [Component] This issue is related to OpenTelemetry tracing label Feb 25, 2026
@Achuth17 Achuth17 marked this pull request as ready for review February 25, 2026 16:17
@ryanaiagent ryanaiagent self-assigned this Feb 26, 2026
@ryanaiagent ryanaiagent added the request clarification [Status] The maintainer need clarification or more information from the author label Feb 26, 2026
@ryanaiagent
Copy link
Collaborator

Hi @Achuth17 , Thank you for your contribution through this pull request! This PR has merge conflicts that require changes from your end. Could you please rebase your branch with the latest main branch to address these? Once this is complete, please let us know so we can proceed with the review.

@Achuth17 Achuth17 force-pushed the feat/add-error-code-to-trace branch from c853160 to 6568aed Compare February 27, 2026 18:25
@Achuth17
Copy link
Author

Merge conflicts should be fixed now, please take a look.

@Achuth17 Achuth17 force-pushed the feat/add-error-code-to-trace branch from 79e3189 to 7bdbac2 Compare February 27, 2026 18:50
Introduces ToolExecutionError and ToolErrorType (HTTP status codes) to standardize error reporting for tool failures. Updates trace_tool_call and function execution handlers to extract and record error.type semantics.
@Achuth17 Achuth17 force-pushed the feat/add-error-code-to-trace branch from 7bdbac2 to 0d593fc Compare February 27, 2026 19:00
@ryanaiagent ryanaiagent added community repo [Community] FRs/issues well suited for google/adk-python-community repository and removed request clarification [Status] The maintainer need clarification or more information from the author labels Feb 27, 2026
@Achuth17
Copy link
Author

@ryanaiagent Is this an automated closure?

Why does extending the telemetry of ADK belong in the adk-docs/integrations repo?

@ryanaiagent ryanaiagent reopened this Mar 2, 2026
@ryanaiagent ryanaiagent added needs review [Status] The PR/issue is awaiting review from the maintainer and removed community repo [Community] FRs/issues well suited for google/adk-python-community repository labels Mar 2, 2026
@ryanaiagent
Copy link
Collaborator

ryanaiagent commented Mar 2, 2026

Hi @Achuth17 , please fix the failing mypy-diff tests, unit tests and fix formatting errors by running autoformat.sh.

@ryanaiagent ryanaiagent added request clarification [Status] The maintainer need clarification or more information from the author and removed needs review [Status] The PR/issue is awaiting review from the maintainer labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

request clarification [Status] The maintainer need clarification or more information from the author tracing [Component] This issue is related to OpenTelemetry tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Error Codes in Traces sent during Tool Call Failures

3 participants