Skip to content

Google ADK Agents Instrumentation#1767

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

Google ADK Agents Instrumentation#1767
TimPansino wants to merge 2 commits into
develop-google-adkfrom
feat-google-adk-agent-instrumentation

Conversation

@TimPansino

Copy link
Copy Markdown
Contributor

Overview

  • Add instrumentation for Google ADK Agents

@TimPansino TimPansino requested a review from a team as a code owner June 16, 2026 18:47
@TimPansino TimPansino force-pushed the feat-google-adk-agent-instrumentation branch from facf5dc to 378260f Compare June 16, 2026 18:48
@mergify mergify Bot added the tests-failing Tests failing in CI. label Jun 16, 2026
@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.0s
✅ MARKDOWN markdownlint 7 0 0 0 1.47s
✅ PYTHON ruff 1044 0 0 0 1.1s
✅ PYTHON ruff-format 1044 0 0 0 0.41s
✅ YAML prettier 20 0 0 0 1.7s
✅ YAML v8r 20 0 0 5.48s
✅ YAML yamllint 20 0 0 0.78s

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

@TimPansino TimPansino force-pushed the feat-google-adk-agent-instrumentation branch from 75fd23d to e9f0722 Compare June 16, 2026 19:05
@mergify mergify Bot removed the tests-failing Tests failing in CI. label Jun 16, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.04167% with 23 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 75.78% 16 Missing and 7 partials ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             develop-google-adk    #1767   +/-   ##
=====================================================
  Coverage                      ?   81.65%           
=====================================================
  Files                         ?      216           
  Lines                         ?    26513           
  Branches                      ?     4180           
=====================================================
  Hits                          ?    21648           
  Misses                        ?     3456           
  Partials                      ?     1409           

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

transaction.add_ml_model_info("GoogleADK", GOOGLEADK_VERSION)
transaction._add_agent_attribute("llm", 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.

func_name = callable_name(wrapped)
agent_name = getattr(instance, "name", "agent")
function_trace_name = f"{func_name}/{agent_name}"
agentic_subcomponent_data = {"type": "APM-AI_AGENT", "name": agent_name}

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 agent executing (rather than an invocation by a local or remote agent). Is there a way in the ADK repo to distinguish between remote and local agents and executions vs invocations?



def instrument_googleadk_agents_llm_agent(module):
if hasattr(module, "LlmAgent") and hasattr(module.LlmAgent, "_run_async_impl"):

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.

Is there any risk of this function getting called multiple times for a single agent execution (ex: re-entrance)? I'm thinking about the case that sub-agents are used. Maybe a test case for sub-agents could help?

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