Setup guides · Python
Google ADK
Google ADK writes its own OpenTelemetry spans. Point its exporter at the local receiver and model and tool calls are recorded. Add the Python SDK for decisions and effects.
Your coding agent can do the attaching. Ask it:
It finds the places to hook in and asks you the few things only you know. The steps below are what it does.
Start nomi
nomi is one program, nomi.
Download it from the releases page, then:
nomi init
nomi configure -mode sdk -source my-agent -receiver-listen 127.0.0.1:4320
nomi start # leave this running
nomi browser -home "$HOME/.nomi" # opens the run view Everything it records lives in ~/.nomi; -home on any command chooses another folder. nomi doctor says whether it's healthy.
Install the Python SDK into your agent's environment from the release's wheel (the same file comes with the program; it isn't on the Python package index) and tell it where nomi is:
pip install "nomi-sdk @ https://github.com/joshbodunrin/nomi/releases/download/v1.0.0/nomi_sdk-1.0.0-py3-none-any.whl"
export MYAGENT_NOMI_ENABLED=1
export MYAGENT_NOMI_ENDPOINT=http://127.0.0.1:4320
export MYAGENT_NOMI_TOKEN_FILE="$HOME/.nomi/write-token" These are the same-machine settings. Your agent can also run in a container or on another machine of yours and send to the same nomi: where nomi runs has what changes, and the attach skill can set it up.
nomi never changes how your agent runs: if it’s off, down or hanging, your agent carries on with the same output.
Point the spans at nomi
Set these where your agent is launched. The exporter can't read a token file, so the token is filled in at launch; never write it into the repository.
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4320/v1/traces
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20$(cat "$HOME/.nomi/write-token")"
export OTEL_EXPORTER_OTLP_TRACES_TIMEOUT=0.5
export OTEL_RESOURCE_ATTRIBUTES="vcs.ref.head.revision=$(git rev-parse HEAD),nomi.project=my-repo,nomi.agent=my-agent,nomi.root_commits=$(git rev-list --max-parents=0 HEAD | paste -sd ';' -)" The receiver takes binary protobuf over HTTP. Leave OTEL_EXPORTER_OTLP_COMPRESSION unset: compressed bodies are rejected. Keep the timeout (in seconds for Python): with the exporter's defaults (10 seconds per export, retried with backoff), a nomi that is down or hanging adds 12 to 20 seconds to a run; with it, under a second. Without the commit setting, a spans-only run has no code version; without the project and agent, its runs are in the unknown group, apart from every named agent.
Switch on the spans
Call this at startup; adk web and adk api_server already do. It reads the export settings above. The settings above set the traces endpoint, not the general OTEL_EXPORTER_OTLP_ENDPOINT: for the general one ADK also starts metrics and logs exporters, which nomi answers with 404 (a Failed to export metrics batch line every run) and which, with nomi down or hanging, retry past the timeout. Measured below.
from google.adk.telemetry.setup import maybe_set_otel_providers
maybe_set_otel_providers()
Content is off by default. To record tool arguments and results, prompts and replies:
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=SPAN_ONLY
The ADK session ID becomes the conversation ID.
Add declarations (optional)
As for Pydantic AI: install the Python SDK (0.2.0 or later), create an observer with Observer.from_env, and wrap each unit of work in observer.observe(...). The framework’s spans join that run. No instrument call and no extra tracer provider.
Recorded automatically
- Model calls: provider, requested model, the returned model (with Gemini), tokens and cache reads, the requested output cap, and content when it is switched on.
- Tool calls: name, tool-call ID, duration and errors; arguments and results when content is on.
- Agent runs and their structure, and the instrumentation version (
gcp.vertex.agent/2.15.0). - Spans only: a work item per session, and the commit from
vcs.ref.head.revision.
Declared by your code
With the SDK only: decisions, effects and logical actions, expected exceptions and waits.
Not available
- The response ID; with
AnthropicLlm, the returned model too (a nested provider span, when there is one, has them). - Prompts, replies, tool arguments and results, unless
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTis set: content is off by default. - The finish reason is
stopeven on a tool-use turn. - The tool-call IDs in a model call’s output are ADK’s placeholders (
lookup_order_0) and differ from the tool step’s ID (adk-…). - A tool error your tool hands back to the model as a result (ADK’s convention) is an ordinary result: it never shows as an error. Only an exception raised out of the tool is one.
- The code location of any step, and success: status is unset on success, so steps are unspecified.
nomi failureslists a spans-only run only for a failed step, an issue or lost events, so an empty list means no failed step was recorded, not that every run succeeded. - Spans only: lost events, the producer and a dirty tree are unknown.
- Retries inside the provider client (one longer model call), and anything below a tool’s boundary.
- Model calls whose spans weren’t sent when the process ended: the exporter sends in batches, and the run then says model calls may be missing.
Connect your coding agent
nomi includes a server with read-only tools for your coding agent, and a debug skill that teaches it to keep what was observed, what your code declared and what is unknown apart. Pick yours:
Claude Code
claude mcp add nomi -s user -- nomi mcp
mkdir -p ~/.claude/skills && cp -R skills/debug-agent-with-nomi ~/.claude/skills/ Codex
codex mcp add nomi -- nomi mcp
mkdir -p ~/.codex/skills && cp -R skills/debug-agent-with-nomi ~/.codex/skills/ Cursor, in ~/.cursor/mcp.json (or .cursor/mcp.json for one project)
{"mcpServers": {"nomi": {"type": "stdio", "command": "nomi", "args": ["mcp"]}}} Cursor's debug skill (the skill needs Cursor 2.4 or later)
mkdir -p ~/.cursor/skills && cp -R skills/debug-agent-with-nomi ~/.cursor/skills/ Cursor also reads skills from ~/.claude/skills/, so if the skills are already installed for Claude Code, nothing needs copying.
Then open a session in your agent's repository and ask, for example:
- “What went wrong in my agent's last few runs?”
- “Why did this run fail?”
- “What changed between these two runs?”