Need more detail? Connect your coding agent to the full docs.

Skip to Content
AMIRILDocs

Send traces from Google ADK

Turn on Google ADK's own OpenTelemetry tracing in Python or TypeScript and send every agent invocation to Amiril, with each tool call's arguments and result.

Google ADK records each invocation as OpenTelemetry spans, but it sends them nowhere until you give it an exporter.

Install

pip install "google-adk[otel]"

Turn on trace export

Run these lines once when your agent starts, before it takes its first request.

tracing.py
from google.adk.telemetry.setup import maybe_set_otel_providers

maybe_set_otel_providers()

Set the endpoint and key

In Amiril, create an API key and copy the endpoint:

  1. Switch to the environment your runs belong to, with the menu at the top of the page.
  2. Open Data and select Set up a new installation. It opens a panel that connects an agent to Amiril.
  3. In the panel, enter a Key name under Create a new key and select Create key.
  4. Copy the key and the OpenTelemetry traces endpoint.

Then set these variables where your agent runs:

export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="<OpenTelemetry traces endpoint>"
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=Bearer <your API key>"
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="SPAN_ONLY"

The last line puts tool arguments, tool results and messages on ADK's spans. Without it Amiril sees which tools ran, but not what they were called with.

Check that traces arrived

Run the agent and open Traces. Each invocation shows as a run of the agent name you gave your ADK agent. Open it to see each tool call with its arguments and result, and each model call.

A new run shows a Scoring badge until Amiril has ranked it. If no run appears, read what the exporter logged.

Next steps

Last updated on