Google ADK

Overview

respan-instrumentation-google-adk is an instrumentation plugin that captures traces from the Google Agent Development Kit and sends them to Respan through the unified OTEL pipeline.

The package wraps the upstream OpenInference Google ADK instrumentor and registers a Google-ADK-specific span processor. That processor composes Respan’s generic OpenInference translation and applies ADK-only normalization in this package, so ADK runner, agent, LLM, and tool spans are emitted as Respan log types with gen_ai.*, llm.*, and traceloop.entity.* attributes.

$pip install respan-instrumentation-google-adk "google-adk[extensions]"

Version: 0.1.0 | Python: >=3.11, <3.14

Dependencies

PackageVersion
respan-tracing^2.16.1
respan-instrumentation-openinference>=1.2.2
google-adk>=1.17.0
openinference-instrumentation-google-adk>=0.1.12

Quick start

1from respan import Respan
2from respan_instrumentation_google_adk import GoogleADKInstrumentor
3
4respan = Respan(
5 api_key="your-api-key",
6 instrumentations=[GoogleADKInstrumentor()],
7)
8
9# Now all Google ADK runner, agent, LLM, and tool spans are captured.

Public API

GoogleADKInstrumentor

The main instrumentor class. Implements the Instrumentation protocol.

1from respan_instrumentation_google_adk import GoogleADKInstrumentor
Attribute/MethodTypeDescription
namestr"google-adk" — unique plugin identifier.
activate()() -> NoneActivates the wrapped OpenInference Google ADK instrumentor.
deactivate()() -> NoneDeactivates the wrapped OpenInference instrumentor.

activate()

When called, activate():

  1. Imports openinference.instrumentation.google_adk.GoogleADKInstrumentor.
  2. Inserts GoogleADKSpanProcessor before Respan export processors.
  3. Calls the upstream instrumentor’s instrument() method so ADK emits spans through OpenTelemetry.

If tracing is disabled through Respan(is_enabled=False), activation is skipped.

deactivate()

Calls the upstream OpenInference instrumentor’s uninstrument() method and removes the Google ADK span processor.

Captured span types

ADK operationLog TypeDescription
Runner invocationworkflowOverall ADK runner workflow.
Agent runagentAgent execution span, including agent name and call boundaries.
LLM callchatModel request/response content, tool declarations, and token usage when provided by ADK.
Tool executiontoolPython function tool call inputs, outputs, and timing.

Span attributes

All translated spans include these common attributes:

AttributeDescription
respan.entity.log_typeRespan log type classification.
traceloop.entity.nameHuman-readable span name.
traceloop.entity.inputJSON-serialized input when available.
traceloop.entity.outputJSON-serialized output when available.

LLM spans additionally include:

AttributeDescription
llm.request.type"chat" for ADK model calls.
gen_ai.system"google" for Google ADK spans.
gen_ai.request.modelModel name used by ADK or LiteLLM.
llm.request.functionsJSON-serialized ADK tool declarations.
gen_ai.prompt.N.role / gen_ai.prompt.N.contentPrompt roles and message content.
gen_ai.completion.0.role / gen_ai.completion.0.contentAssistant response role and content.
gen_ai.completion.0.tool_callsJSON-serialized tool calls, when present.
gen_ai.usage.prompt_tokensInput token count when provided by the model response.
gen_ai.usage.completion_tokensOutput token count when provided by the model response.
llm.usage.total_tokensTotal token count when provided by the model response.

With propagated attributes

Use propagate_attributes() to attach per-request metadata to all spans:

1from respan import Respan, propagate_attributes
2from respan_instrumentation_google_adk import GoogleADKInstrumentor
3
4respan = Respan(
5 api_key="your-api-key",
6 instrumentations=[GoogleADKInstrumentor()],
7)
8
9async def handle_user_request(user_id: str, message: str):
10 with propagate_attributes(
11 customer_identifier=user_id,
12 thread_identifier="conv_123",
13 metadata={"source": "web"},
14 ):
15 return await run_adk_agent(message)

Architecture

Google ADK
|
v
openinference-instrumentation-google-adk
|
v
respan-instrumentation-google-adk span processor
|
v
generic OpenInference translation + ADK cleanup
|
v
OTEL Processor Chain
|
v
RespanSpanExporter
|
v
POST /v2/traces

Internal modules

These are implementation details, not part of the public API:

ModuleDescription
_instrumentation.pyGoogleADKInstrumentor class and lazy upstream OpenInference delegate setup.
_processor.pyGoogleADKSpanProcessor and ADK-specific span normalization helpers.