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.

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.
@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.

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