Google ADKGeminiobservability

Google ADK Observability: Monitor Gemini Agents in Production

·9 min read·LumiqTrace Team

Google ADK shipped in April 2025. If you started building with it shortly after launch, you already know the gap: local development with InMemoryRunner feels smooth, then you push to production and the questions start. Which agent ran that slow request? Why did that multi-agent run cost three times what you expected? Which child agent failed silently?

This post covers how to get full observability on Google ADK agents using LumiqTrace — agent-native tracing, Gemini cost attribution by model, multi-agent delegation visibility, and automatic evals.

The Limits of Google Cloud Trace for ADK

Google Cloud Trace is a legitimate tool. It captures Vertex AI API calls with latency data, and if you're running ADK agents on Vertex AI, it gives you something to look at.

What it doesn't give you:

  • Agent identity on spans. Cloud Trace records an LLM call. It doesn't know that call came from research_agent versus orchestrator. In a multi-agent setup, this is a hard blocker for debugging.
  • Delegation visibility. When an orchestrator delegates to a child agent using ADK's agent-as-a-tool pattern, that delegation is not a first-class event in Cloud Trace. It's invisible.
  • Custom tool spans. If your agent calls a Python function — a database lookup, a custom API — Cloud Trace doesn't capture it. You see the LLM calls around it, but the tool execution is a black box.
  • Cost per span. Gemini 2.0 Flash and Gemini 1.5 Pro have very different pricing. Cloud Trace shows latency. It doesn't attribute cost to individual spans, so you can't tell which agent or which tool call is burning your budget.
  • Evals. There is no eval layer in Cloud Trace. You need a separate system to measure output quality over time.

None of this is a knock on Cloud Trace — it's an infrastructure tracer, not an agent observability platform. The distinction matters when your system is composed of multiple agents with tools, delegations, and variable-cost model calls. For a broader overview of what production agent observability should cover, see What is AI Agent Observability.

Setup

# Python
pip install lumiqtrace

# Node.js / TypeScript
npm install @lumiqtrace/sdk
import lumiqtrace
from lumiqtrace.integrations import LumiqtraceADKHandler

lumiqtrace.init(api_key="YOUR_API_KEY")

# Add the event handler to your runner
runner = InMemoryRunner(agent=your_agent)
runner.add_event_handler(LumiqtraceADKHandler())
// Node.js / TypeScript
import { lumiqtrace } from "@lumiqtrace/sdk";

lumiqtrace.init({ apiKey: process.env.LT_KEY });

LumiqTrace init auto-patches Gemini API calls. Adding LumiqtraceADKHandler to your runner enables full agent-level tracing — agent identity on spans, delegation visibility, and framework-level context. No decorators, no changes to your agent definitions. It works with both InMemoryRunner for local development and VertexAIRunner in production.

What You See in the Dashboard

Every agent run produces an agentic trace — a hierarchical view of everything that happened. Here's what a basic orchestrator-with-research-agent run looks like:

Agent Run: orchestrator [1.8s, $0.006]
├── LLM: gemini-2.0-flash planning [240ms, $0.0008]
├── Tool: research_agent (child) [1.2s, $0.004]
│   ├── LLM: gemini-1.5-pro research [980ms, $0.0038]
│   └── Tool: google_search [180ms]
└── LLM: gemini-2.0-flash response [360ms, $0.0012]

Every span carries agent identity. Every LLM span has token count, model name, and cost. Every tool span has timing. You can click into any span to see the full input and output.

Multi-Agent Delegation: The Agent-as-a-Tool Pattern

ADK's multi-agent pattern lets a parent agent treat a child agent as a tool. This is powerful and common — you'll reach for it whenever you want a capable model handling a subtask while a faster, cheaper model orchestrates the overall flow.

research_agent = Agent(
    name="research_agent",
    model="gemini-1.5-pro",  # more capable for research
    instruction="Research and summarize the given topic in detail."
)

orchestrator = Agent(
    name="orchestrator",
    model="gemini-2.0-flash",
    instruction="Orchestrate research and response generation.",
    tools=[research_agent]  # agent-as-a-tool
)

In LumiqTrace, the delegation from orchestrator to research_agent is a first-class span. You see the full parent → child tree with timing and cost at each level. If research_agent calls google_search three times across a long research task, each search call appears as a child span under research_agent with its own timing.

This matters for debugging. If a run is slow, you can immediately see whether the bottleneck is the orchestrator's planning step, the child agent's LLM call, or a slow tool. Without agent identity on spans, you're guessing.

Gemini Cost Attribution: Flash vs Pro

Gemini 2.0 Flash costs approximately $0.075 per million input tokens. Gemini 1.5 Pro costs approximately $1.25 per million input tokens — roughly 16x more expensive per token.

When your orchestrator runs on Flash and delegates research tasks to a Pro model, the cost distribution is heavily skewed toward the child agent. In the example trace above, the research_agent call accounts for $0.004 of the $0.006 total run cost. That's 67% of the cost in one child agent span.

LumiqTrace shows cost attribution at the span level for every Gemini model call. You can filter traces by model to see aggregate spend across Flash versus Pro calls, and drill into individual runs to see which delegation chains are the most expensive. For a full comparison of observability tools including LangSmith and Langfuse, see the AI agent observability tools overview.

To attach user context to your traces — useful for per-user cost analysis:

with lumiqtrace.context(user_id="user_123", session_id=session.id):
    response = await runner.run_async(user_message)
await lumiqtrace.withContext({ userId: "user_123", sessionId: session.id }, async () => {
  const response = await runner.runAsync(userMessage);
});

This lets you query traces by user, surface the highest-cost users, or correlate agent behavior with specific sessions.

Setting Cost Alerts for Gemini Spend

Once you're capturing cost data at the span level, alerting is straightforward. In the LumiqTrace dashboard, navigate to Alerts and create a threshold rule on agent_run.total_cost. You can scope alerts to a specific agent, a specific model, or across all runs.

Practical thresholds worth setting when you're running ADK agents on Pro models:

  • Alert when a single agent run exceeds $0.05 — this catches runaway loops or unexpectedly large context windows before they compound.
  • Alert when hourly Gemini spend across all agents exceeds your budget envelope.
  • Alert when research_agent (or whatever your Pro-model agent is named) fires more than N times per hour.

Cost anomaly detection runs automatically. If your per-run cost drifts up significantly from the rolling baseline — because a new code path is hitting the Pro model more often, for example — LumiqTrace flags it without a manual threshold rule.

LumiqPilot: AI Ops for Your ADK Agents

LumiqPilot is LumiqTrace's built-in AI ops assistant. It operates across three capabilities:

Deep data analysis. Ask LumiqPilot questions about your live traces. "Which agent is responsible for the most latency over the last 24 hours?" or "Show me runs where google_search was called more than 5 times." It queries your trace data and returns answers with supporting spans, not generic suggestions.

Instant action from insight. When LumiqPilot surfaces an issue — say, it finds that research_agent calls are consistently slow when a particular user triggers them — it can take action directly. Create an alert, add a cost threshold, or flag the pattern for review. The insight and the action happen in the same interface.

Proactive auto-remediation. On the Scale plan, LumiqPilot monitors your agents continuously and can act on anomalies before you're paged. If a model starts returning malformed outputs or a tool starts timing out at elevated rates, it can trigger a remediation workflow automatically.

Automatic Evaluations for ADK Agent Output

LumiqTrace ships with 12 built-in eval templates. For ADK agents, the most immediately useful are:

  • Answer relevance — does the agent's response address what was actually asked
  • Faithfulness — for research agents using google_search, are claims grounded in retrieved content
  • Tool call validity — are tool arguments well-formed and reasonable
  • Response completeness — does the output cover the expected scope

Evals run automatically on every trace. You don't write eval code. In the dashboard, each agent run has an eval score column. You can filter for low-scoring runs, inspect the trace, and see exactly where the output quality degraded.

For ADK's multi-agent pattern specifically, evals at the child-agent level are useful: you might find that research_agent consistently scores well on faithfulness but your orchestrator's final response loses information during synthesis. That's a different fix than if the research itself is the problem.

Teams running multi-framework stacks alongside Google ADK can see why LangSmith falls short in our LangSmith alternatives guide. For a direct three-way comparison of LangSmith, Langfuse, and LumiqTrace on agent features and pricing, see our LangSmith vs Langfuse vs LumiqTrace comparison.

Getting Started

import lumiqtrace
from lumiqtrace.integrations import LumiqtraceADKHandler

lumiqtrace.init(api_key="YOUR_API_KEY")
// Node.js / TypeScript
import { lumiqtrace } from "@lumiqtrace/sdk";

lumiqtrace.init({ apiKey: process.env.LT_KEY });
from google.adk.agents import Agent
from google.adk.runners import InMemoryRunner
from google.adk.tools import google_search

support_agent = Agent(
    name="support_agent",
    model="gemini-2.0-flash",
    instruction="You are a helpful customer support agent.",
    tools=[google_search]
)

runner = InMemoryRunner(agent=support_agent)
runner.add_event_handler(LumiqtraceADKHandler())

That's it. Your next agent run appears in the dashboard with full agentic traces, cost attribution, and eval scores.

Frequently Asked Questions

Does LumiqTrace work with Google ADK and Vertex AI?

Yes. LumiqTrace init auto-patches Gemini API calls. Add runner.add_event_handler(LumiqtraceADKHandler()) for full agent-level tracing — that's the only addition to your ADK code. Works with both InMemoryRunner locally and VertexAIRunner in production, with full cost attribution per model.

Can I trace multi-agent ADK setups with parent and child agents?

Yes. LumiqTrace treats agent delegation as a first-class span. When your orchestrator calls a child agent using the agent-as-a-tool pattern, you see the full parent → child tree with timing and cost at each level.

How is LumiqTrace different from Google Cloud Trace for ADK?

Google Cloud Trace captures Vertex AI infrastructure calls. LumiqTrace captures the full execution graph: which agent ran, which tools were called, delegation between agents, cost per Gemini model call, and eval scores per run. It's agent-native observability rather than infrastructure tracing.

Does LumiqTrace show Gemini model costs per span?

Yes. Every LLM span includes token count and cost based on the model used. Since Gemini 2.0 Flash ($0.075/M tokens) and Gemini 1.5 Pro ($1.25/M tokens) differ by 16x in price, span-level cost attribution shows exactly where your Gemini budget is going.

The Free plan is $0, includes 10,000 traces per month, and requires no credit card. Setup takes under 5 minutes. If you're building with Google ADK and haven't shipped to production yet, this is the right time to add observability — before you're debugging a production issue without span-level data.

Start free — 10K traces/month, no card needed

See every agent decision, tool call, and handoff in production. Setup takes under 5 minutes.

Get started free →