agentleFS
kumaran-iskumaran-is/claude-code-onboarding/.claude/skills/adk-observability-guide/SKILL.md

adk-observability-guide

Skill36 starsChanged 6 months agoMITView on GitHub

ADK observability, Cloud Trace, prompt logging, agent analytics, BigQuery agent logs, ADK monitoring, ADK telemetry. Use when configuring tracing, logging, or analytics for ADK agents, debugging production agent behavior, or setting up monitoring for a deployed agent.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask the user which tier(s) they need — they can be combined.

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ADK Observability Guide

Iron Law

NEVER ship a production ADK agent without Cloud Trace enabled. Set otel_to_cloud=True in the FastAPI app and LOGS_BUCKET_NAME env var before any production deployment.

Reference Files

FileContents
reference/cloud-trace-and-logging.mdCloud Trace setup, prompt-response logging infrastructure, environment variables, enabling/disabling locally, verification commands
reference/bigquery-agent-analytics.mdBigQuery Agent Analytics plugin — enabling, key features, tool provenance tracking
reference/slo-alerting.mdSLO-based burn-rate alerting (vs threshold alerting), multi-window pattern, error budget tracking, PromQL examples for availability/latency/safety SLOsSetting up production alerts for agentic AI services

Observability Tiers

TierWhat It DoesDefault StateBest For
Tier 1: Cloud TraceDistributed tracing — execution flow, latency, errors via OpenTelemetry spansAlways-onDebugging latency, understanding agent execution flow
Tier 2: Prompt-Response LoggingGenAI interactions exported to GCS, BigQuery, and Cloud LoggingDisabled locally; enabled when deployedAuditing LLM interactions, compliance
Tier 3: BigQuery Agent AnalyticsStructured agent events (LLM calls, tool use, outcomes) to BigQueryOpt-in (--bq-analytics at scaffold time)Conversational analytics, custom dashboards, LLM-as-judge evals
Tier 4: SLO AlertingSLO-based burn-rate alerts (availability, latency, safety) via Prometheus — fires only when error budget is genuinely at riskOpt-in — requires Prometheus + Alertmanager stackProduction alerting for agentic AI services; replaces naive threshold alerts

Ask the user which tier(s) they need — they can be combined. Tier 1 is mandatory; Tiers 2, 3, and 4 are additive.


Quick Setup

Tier 1: Cloud Trace (Always-On)

# In your FastAPI app — scaffolded projects have this pre-configured
from google.adk.telemetry import setup_telemetry
setup_telemetry(otel_to_cloud=True)

View traces: Cloud Console > Trace > Trace explorer

Tier 2: Prompt-Response Logging

# Enable locally
export LOGS_BUCKET_NAME="your-bucket-name"
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="NO_CONTENT"

See reference/cloud-trace-and-logging.md for full infrastructure list, env vars, and verification commands.

Tier 3: BigQuery Agent Analytics

# Enable at scaffold time
uvx agent-starter-pack create . --bq-analytics

See reference/bigquery-agent-analytics.md for post-scaffold manual setup and key features.


Process

  1. Confirm tier(s) — Ask which tiers the user needs before configuring anything
  2. Read reference files — See reference/cloud-trace-and-logging.md (Tier 1 & 2) or reference/bigquery-agent-analytics.md (Tier 3) before writing any configuration
  3. Check env vars — Verify all required environment variables are set (table in reference/cloud-trace-and-logging.md)
  4. Verify with commands — Use the verification commands in reference/cloud-trace-and-logging.md to confirm telemetry is flowing
  5. Check costs — High telemetry volume? Switch to NO_CONTENT mode; reduce BigQuery retention; disable unused tiers

Troubleshooting

IssueSolution
No traces in Cloud TraceVerify otel_to_cloud=True in FastAPI app; check SA has cloudtrace.agent role
Prompt-response data missingCheck LOGS_BUCKET_NAME is set; verify SA has storage.objectCreator; check app logs
Privacy mode misconfiguredCheck OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT — use NO_CONTENT for metadata-only
BigQuery Analytics not loggingVerify plugin in app/agent.py; check BQ_ANALYTICS_DATASET_ID env var
Traces missing tool spansTool spans appear under execute_tool — check trace explorer filters

Documentation Sources

TopicURL
Observability overviewhttps://google.github.io/adk-docs/observability/index.md
Agent activity logginghttps://google.github.io/adk-docs/observability/logging/index.md
Cloud Trace integrationhttps://google.github.io/adk-docs/integrations/cloud-trace/index.md
BigQuery Agent Analyticshttps://google.github.io/adk-docs/integrations/bigquery-agent-analytics/index.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.