Native monitoring for Google ADK agents with Fiddler’s purpose-built SDK
Monitor Google ADK (Agent Development Kit) applications with Fiddler’s purpose-built SDK. Get deep visibility into agent reasoning, LLM interactions, and tool execution for ADK-based agent applications.Platform Compatibility: Works with ADK agents using either Google Gemini API keys or Vertex AI authentication.
# Step 2: Set up instrumentationfrom fiddler_otel import FiddlerClientfrom fiddler_adk import GoogleADKInstrumentorclient = FiddlerClient( api_key="YOUR_FIDDLER_API_KEY", application_id="YOUR_APPLICATION_UUID", url="https://your-fiddler-instance.com",)GoogleADKInstrumentor(client).instrument()# Step 3: Create your ADK agent as usualfrom google.adk.agents.llm_agent import Agentagent = Agent( model="gemini-2.5-flash", name="my_agent", description="A helpful assistant", instruction="You are a helpful assistant. Be concise.",)# Step 4: Agent calls are automatically traced# (use Runner to execute the agent — see Quick Start Guide for full example)
What Gets Monitored
ADK Agent Operations
Agent Invocations (invoke_agent) - Full agent execution with timing and session tracking
LLM Calls (call_llm) - LLM request/response capture with input, output, system instructions, and tool definitions
Tool Execution (execute_tool) - Tool call arguments and return values
Model Inference (generate_content) - Token usage, model name, and finish reasons
Captured Attributes
LLM Input/Output - User prompt text, model response text, system instructions
Agent Identity - Agent name, agent ID, session/conversation ID
Finish Reasons - LLM stop reason per generation
Configuration Options
Programmatic Configuration
from fiddler_otel import FiddlerClientfrom fiddler_adk import GoogleADKInstrumentorclient = FiddlerClient( api_key="YOUR_FIDDLER_API_KEY", application_id="YOUR_APPLICATION_UUID", # UUID4 from Fiddler GenAI Applications url="https://your-fiddler-instance.com",)GoogleADKInstrumentor(client).instrument()# All agents created after this point are automatically instrumented
Google Authentication
ADK supports two authentication methods for accessing Gemini models:
# Option A: Gemini API keyexport GOOGLE_API_KEY="your-gemini-api-key"# Option B: Vertex AI (uses gcloud Application Default Credentials)export GOOGLE_GENAI_USE_VERTEXAI=1export GOOGLE_CLOUD_PROJECT="your-gcp-project-id"export GOOGLE_CLOUD_LOCATION="us-central1"
Content Capture
Whether ADK puts LLM request/response payloads on span attributes depends on its telemetry schema, and google-adk 2.13.0 changed both the default schema and the default answer:
On schema v2, Fiddler extracts tool input/output but not LLM message content. ADK writes v2 LLM content to the OpenTelemetry semantic-convention keys gen_ai.input.messages and gen_ai.output.messages. Fiddler stores both verbatim and resolves them to the input and output concepts, so the Input and Output columns show the raw message JSON rather than extracted text, and input/output evaluators score that JSON.Enabling content capture on v2 therefore sends and stores LLM payloads as well as tool content — relevant if you are enabling it only for tool content. If you need LLM request/response content extracted into plain text, stay on schema v1 — see Keeping LLM Content.
On google-adk 2.13.0 and Later
Tool content is omitted unless you opt in. To capture it:
This variable is not a boolean. It accepts NO_CONTENT, EVENT_ONLY, SPAN_ONLY, and SPAN_AND_EVENT, and defaults to NO_CONTENT.Setting it to true resolves to EVENT_ONLY, which attaches content to log records instead of spans. Fiddler ingests spans, so content still will not appear. Use SPAN_ONLY or SPAN_AND_EVENT.
On google-adk Earlier Than 2.13.0
LLM and tool content are both captured by default, and Fiddler extracts both. To disable capture (for example, for PII protection):
export ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS=false
Keeping LLM Content
On google-adk 2.13.0 and later, pin the telemetry schema to v1. This restores the v1 attribute keys that Fiddler extracts LLM content from, along with v1’s default-on capture:
export ADK_TELEMETRY_SCHEMA_VERSION_OPT_IN=1
ADK supports this opt-in until at least 2027-03-31, after which the knob and the v1 schema are removed.Pinning to v1 makes extracted plain text available, as gen_ai.llm.input.user and gen_ai.llm.output. It does not change what the Input and Output columns display: those still show the retained raw request/response blob on both schemas — see Missing Content on Spans. Point evaluators at the extracted keys directly when you need plain-text scoring.
Example Applications
Document Processing Agent with Tools
import asynciofrom fiddler_otel import FiddlerClientfrom fiddler_adk import GoogleADKInstrumentorfrom google.adk.agents.llm_agent import Agentfrom google.adk.runners import Runnerfrom google.adk.sessions import InMemorySessionServicefrom google.genai import types# Set up Fiddler instrumentationclient = FiddlerClient( api_key="YOUR_FIDDLER_API_KEY", application_id="YOUR_APPLICATION_UUID", url="https://your-fiddler-instance.com",)GoogleADKInstrumentor(client).instrument()# Define toolsdef classify_document(doc_type: str, content: str) -> dict: """Classify a document into a known category.""" return {"category": "Credit Memo", "confidence": 0.95}def extract_fields(document_id: str) -> dict: """Extract structured fields from a document.""" return {"supplier": "McKesson", "total": "$12,450.00"}# Create agent with toolsagent = Agent( model="gemini-2.5-flash", name="doc_processor", description="Document processing assistant", instruction="You classify and extract fields from medical documents.", tools=[classify_document, extract_fields],)async def main(): session_service = InMemorySessionService() runner = Runner(agent=agent, app_name="demo", session_service=session_service) session = await session_service.create_session(app_name="demo", user_id="user1") message = types.Content( role="user", parts=[types.Part(text="Classify this credit memo: supplier McKesson, amount $5000")], ) async for event in runner.run_async( user_id="user1", session_id=session.id, new_message=message ): if hasattr(event, "content") and event.content: parts = getattr(event.content, "parts", []) or [] text = "".join(p.text for p in parts if getattr(p, "text", None)) if text: print(f"Agent: {text}") # Flush traces to Fiddler before exit client.force_flush(timeout_millis=5000)asyncio.run(main())
Tool Metrics - Tool call arguments, responses, and execution time
Cost Tracking - Token usage per agent session
Span Types
ADK Operation
Fiddler Span Type
Content
call_llm
LLM
User input, model output, system instructions, tool definitions
invoke_agent
Agent
Agent name, session ID
execute_tool
Tool
Tool arguments, tool response
generate_content
Span
Token counts, model name, finish reason
invocation
Span
Root span per turn
How It Works
Google ADK emits OpenTelemetry spans natively through a tracer named gcp.vertex.agent. The fiddler-adk SDK:
Sets up an isolated tracing pipeline via FiddlerClient (provider, processor, OTLP exporter) and promotes it to the global tracer provider so ADK’s tracer resolves to it.
Propagates session identity by backfilling gen_ai.conversation.id from child spans onto the root invocation span, ensuring all spans in a turn share the same session ID.
Delegates content extraction to the Fiddler backend, which parses ADK’s JSON span attributes (gcp.vertex.agent.llm_request, etc.) into human-readable fields.
The SDK operates in standalone mode — it does not interact with customer-configured tracers or providers.
Troubleshooting
Traces Not Appearing in Fiddler
Verify credentials:
from fiddler_otel import FiddlerClientclient = FiddlerClient( api_key="YOUR_KEY", application_id="YOUR_APP_UUID", url="https://your-instance.com",)# If credentials are wrong, you'll see 401 errors in logs
# ADK agents run async — ensure flush before process exitsclient.force_flush(timeout_millis=10000)
Missing Content on Spans
If tool input/output is missing, check content capture. On google-adk 2.13.0 and later, ADK omits it unless you set OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT to SPAN_ONLY or SPAN_AND_EVENT — see Content Capture. Setting it to true is not sufficient, because that routes content to log records rather than spans.If LLM input/output shows raw message JSON, that is expected, and it is expected on both schemas.On schema v2, Fiddler stores the gen_ai.input.messages/gen_ai.output.messages keys that ADK emits and resolves them to the input/output concepts, but does not yet extract them into plain text.On schema v1, Fiddler does extract plain text, into gen_ai.llm.input.user and gen_ai.llm.output. The Input and Output columns still show raw JSON, because the v1 request and response blobs are retained under gcp.vertex.agent.llm_request/llm_response, those keys also resolve to input/output, and the column picks the alphabetically first key that has a value — gcp. sorts ahead of gen_ai.. Pinning to v1 therefore changes which raw blob is displayed, not whether one is.Content capture does not change this on either schema.To score plain text today, map the evaluator explicitly to gen_ai.llm.input.user and gen_ai.llm.output on schema v1, rather than to the input/output concepts. Having the columns prefer extracted text over the raw blob is a known gap and is being tracked.If LLM input/output is missing entirely on schema v1, or tool content is present but unextracted on either schema, extraction is handled by the Fiddler backend — ensure your Fiddler instance has the Google ADK backend mapper deployed.
Orphan Root Spans
If invocation root spans appear disconnected from their children, update to the latest fiddler-adk version. The ADKSpanProcessor backfills gen_ai.conversation.id to root spans automatically.