Skip to content

Google ADK Tool Instrumentation#1768

Open
TimPansino wants to merge 2 commits into
develop-google-adkfrom
feat-google-adk-tool-instrumentation
Open

Google ADK Tool Instrumentation#1768
TimPansino wants to merge 2 commits into
develop-google-adkfrom
feat-google-adk-tool-instrumentation

Conversation

@TimPansino

@TimPansino TimPansino commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Overview

@TimPansino TimPansino requested a review from a team as a code owner June 16, 2026 18:55
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 8 0 0 1.03s
✅ MARKDOWN markdownlint 7 0 0 0 1.44s
✅ PYTHON ruff 1046 0 0 0 1.21s
✅ PYTHON ruff-format 1046 0 0 0 0.38s
✅ YAML prettier 20 0 0 0 1.77s
✅ YAML v8r 20 0 0 5.57s
✅ YAML yamllint 20 0 0 0.77s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@mergify mergify Bot added the tests-failing Tests failing in CI. label Jun 16, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.01010% with 98 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop-google-adk@a7b31f7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
newrelic/hooks/mlmodel_googleadk.py 0.00% 98 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             develop-google-adk    #1768   +/-   ##
=====================================================
  Coverage                      ?   81.37%           
=====================================================
  Files                         ?      216           
  Lines                         ?    26516           
  Branches                      ?     4180           
=====================================================
  Hits                          ?    21577           
  Misses                        ?     3538           
  Partials                      ?     1401           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


if settings.ai_monitoring.record_content.enabled:
tool_event_dict["input"] = str(tool_input) if tool_input else None
tool_event_dict["output"] = str(tool_output) if tool_output is not None else None

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.

Can this be shortened to remove the is not None?

transaction=transaction,
linking_metadata=linking_metadata,
)
tool_event_dict["duration"] = ft.duration * 1000

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.

If we hit an error in _construct_base_tool_event_dict(), then tool_event_dict will be an empty dict. Recording the duration alone in an empty dict that doesn't have the tool name, ID, or any other info may not be useful. We may want to verify that tool_event_dict came back non-empty before adding the duration to it.

except Exception:
_logger.warning(TOOL_EXTRACTOR_FAILURE_LOG_MESSAGE, exc_info=True)

func_name = callable_name(wrapped)

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.

In our agent spec, it's not a requirement that we include the full callable name in the function trace name. Since this one is pretty long, I'm wondering if we're better off just using the name of the wrapped function. The goal with using the full name was more so to disambiguate the function name so the customer is clear what function was wrapped.


ft = FunctionTrace(name=function_trace_name, group="Llm/tool/GoogleADK")
ft.__enter__()
ft._add_agent_attribute("subcomponent", json.dumps(agentic_subcomponent_data))

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.

Going forward, we will ideally only want to send the subcomponent attr if we have a local tool executing. Is there a way in the ADK repo to distinguish between remote and local tools and executions vs invocations?

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

Labels

tests-failing Tests failing in CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants