ASD

Google Agents Cli Observability

Úsalo para configurar tracing, monitorizar agentes ADK, configurar logging o depurar tráfico en producción; cubre Cloud Trace, prompt-response logging, BigQuery Agent Analytics e integraciones de terceros.

Oficial
Estrellas
5.6k

en todo el repo

Actividad
74

0–100, la ruta de este skill

Actualizado
hace 9 días

último commit aquí

Commits
15

últimos 90 días

Contexto
2.7k tok

142 tok en reposo

Paquete
3 archivos

19 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add google/agents-cli --skill google-agents-cli-observability --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Guía la configuración de Cloud Trace, prompt-response logging y BigQuery Agent Analytics para agentes ADK
  • Explica el orden correcto entre `agents-cli infra single-project` y `agents-cli deploy` para agent_runtime
  • Documenta integraciones de terceros (AgentOps, Phoenix, MLflow, etc.) y cómo elegir entre ellas
  • Ofrece una tabla de troubleshooting para problemas comunes de trazas, logging y costos de telemetría

Úsalo cuando

  • El usuario quiere 'set up tracing', 'monitor my ADK agent', 'configure logging' o 'add observability'
  • Necesita depurar tráfico en producción de un agente ADK
  • Quiere elegir o configurar una plataforma de observabilidad de terceros

No lo uses cuando

  • Para configuración de despliegue (usar google-agents-cli-deploy)
  • Para patrones de código de la API (usar google-agents-cli-adk-code)

Qué lo activa

Di cualquiera de estas frases y el agente debería cargar este skill.

  • Quiero configurar tracing para mi agente ADK
  • ¿Cómo monitorizo mi agente en producción?
  • Ayúdame a activar BigQuery Agent Analytics
  • No veo trazas en Cloud Trace, ¿qué reviso?
  • Quiero integrar AgentOps con mi agente ADK

SKILL.md

En inglés

ADK Observability Guide

Cloud Trace works out of the box — no infrastructure needed. Prompt-response logging and BigQuery Agent Analytics require Terraform-provisioned infrastructure (service account, GCS bucket, BigQuery dataset). Run agents-cli infra single-project --project PROJECT_ID to provision these resources. See references/cloud-trace-and-logging.md for details, env vars, and verification commands. If your project isn't scaffolded yet, see /google-agents-cli-scaffold first.

Order of operations for agent_runtime deployments

For deployment_target = agent_runtime, run agents-cli infra single-project before the first agents-cli deploy. The Terraform module owns the entire Reasoning Engine resource (service account, deployment spec, env vars), so applying it after an SDK-based deploy creates a state mismatch Terraform can't reconcile without taking ownership of the whole resource.

Already ran agents-cli deploy? Two options:

  1. Switch to Terraform-managed — delete the SDK-deployed Reasoning Engine, then run agents-cli infra single-project and agents-cli deploy (sessions and in-flight state are lost).
  2. Keep the SDK-deployed instance — skip infra single-project and set the observability env vars by re-running agents-cli deploy --update-env-vars "KEY=VALUE,..."; deploy matches the existing Reasoning Engine by display name and updates it in place, preserving env vars set outside the deploy. You must also grant its service account the telemetry IAM roles the Terraform module would otherwise provision: roles/storage.admin (write completions to the logs bucket), roles/logging.logWriter, roles/cloudtrace.agent, plus roles/bigquery.dataOwner + roles/bigquery.jobUser when scaffolded with --bq-analytics. The full set lives in deployment/terraform/single-project/iam.tf (from app_sa_roles) and telemetry.tf. Terraform-managed env vars aren't available in this mode.

Reference Files

File Contents
references/cloud-trace-and-logging.md Scaffolded project details — Terraform-provisioned resources, environment variables, verification commands, enabling/disabling locally
references/bigquery-agent-analytics.md BQ Agent Analytics plugin — enabling, key features, GCS offloading, tool provenance

Observability Tiers

Choose the right level of observability based on your needs:

Tier What It Does Scope Default State Best For
Cloud Trace Distributed tracing — execution flow, latency, errors via OpenTelemetry spans All templates, all environments Always enabled Debugging latency, understanding agent execution flow
Prompt-Response Logging GenAI interactions exported to GCS, BigQuery, and Cloud Logging ADK agents only Disabled locally, enabled when deployed Auditing LLM interactions, compliance
BigQuery Agent Analytics Structured agent events (LLM calls, tool use, outcomes) to BigQuery ADK agents with plugin enabled Opt-in (--bq-analytics at scaffold time) Conversational analytics, custom dashboards, LLM-as-judge evals
Third-Party Integrations External observability platforms (AgentOps, Phoenix, MLflow, etc.) Any ADK agent Opt-in, per-provider setup Team collaboration, specialized visualization, prompt management

Ask the user which tier(s) they need — they can be combined. Cloud Trace is always on; the others are additive.


Cloud Trace

ADK uses OpenTelemetry to emit distributed traces. Every agent invocation produces spans that track the full execution flow.

Span Hierarchy

invoke_workflow (top-level run)
  └── invoke_agent (one per agent in the chain)
        ├── call_llm (model request)
        │     └── generate_content (underlying GenAI model call)
        └── execute_tool (tool execution)

Setup by Deployment Type

Deployment Setup
Agent Runtime Automatic — get_fast_api_app(otel_to_cloud=True), gated on GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY (set by deploy); exports to Cloud Trace/Logging + Agent Engine console
Cloud Run / GKE (scaffolded) Automatic — get_fast_api_app(otel_to_cloud=True) exports to Cloud Trace/Logging
Cloud Run / GKE (manual) Configure OpenTelemetry exporter in your app
Local dev Works with agents-cli playground; traces visible in Cloud Console

View traces: Cloud Console → Trace → Trace explorer

For detailed setup instructions (Agent Runtime CLI/SDK, Cloud Run, custom deployments), fetch https://adk.dev/integrations/cloud-trace/index.md.


Prompt-Response Logging

Captures GenAI interactions and exports to GCS (JSONL) and BigQuery (via log sinks + external tables). Content is governed by two independent tiers; the net Terraform-deploy default is full content in GCS/BigQuery, none in traces:

Tier Captures Controlled by Default (Terraform deploy)
GCS/BigQuery completions Full prompts/responses (the prompt-response logging feature) OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload + LOGS_BUCKET_NAME On — full content
Trace spans / Cloud Logging events Span/event content OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT + ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS=false OffNO_CONTENT

The tiers are independent: GCS/BigQuery uploads capture full content whenever their upload vars are set and do not honor OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT, which governs the traces/events tier only. Its valid (experimental-semconv) values:

  • NO_CONTENT — no content in spans/events (scaffolded default)
  • EVENT_ONLY — content in Cloud Logging events
  • SPAN_ONLY / SPAN_AND_EVENT — content in trace spans
  • true / falseinvalid; fall back to NO_CONTENT

For the full mechanics (semconv opt-in, declarative Terraform config, env-var table, enabling/disabling, verification commands), see references/cloud-trace-and-logging.md. For ADK logging docs (log levels, configuration, debugging), fetch https://adk.dev/observability/logging/index.md.


BigQuery Agent Analytics Plugin

Optional plugin that logs structured agent events to BigQuery. Enable with --bq-analytics at scaffold time. See references/bigquery-agent-analytics.md for details.


Third-Party Integrations

ADK supports many third-party observability platforms (via OpenTelemetry or custom instrumentation). The table below covers common ones; the full list is larger (see the pointer below it).

Platform Key Differentiator Setup Complexity Self-Hosted Option
AgentOps Session replays, 2-line setup, replaces native telemetry Minimal No (SaaS)
Arize AX Commercial platform, production monitoring, evaluation dashboards Low No (SaaS)
Phoenix Open-source, custom evaluators, experiment testing Low Yes
MLflow OTel traces to MLflow Tracking Server, span tree visualization Medium (needs SQL backend) Yes
Monocle 1-call setup, VS Code Gantt chart visualizer Minimal Yes (local files)
Weave W&B platform, team collaboration, timeline views Low No (SaaS)
Freeplay Prompt management + evals + observability in one platform Low No (SaaS)

Ask the user which platform they prefer — present the trade-offs and let them choose. Fetch a platform's setup page at https://adk.dev/integrations/<slug>/index.md (slugs for the table above: agentops, arize-ax, phoenix, mlflow-tracing, monocle, weave, freeplay). ADK has more observability integrations (Datadog, Galileo, LangWatch, Latitude, Future AGI, Respan, Zespan, …) — browse the complete, current list at https://adk.dev/integrations/ (observability topic).


Troubleshooting

Issue Solution
No traces in Cloud Trace Verify fast_api_app.py uses get_fast_api_app(otel_to_cloud=True) (Agent Runtime gates it on GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY) and the SA has the cloudtrace.agent role
Prompt-response data not appearing Check LOGS_BUCKET_NAME is set; verify SA has storage.objectCreator on the bucket; check app logs for telemetry setup warnings
Content in traces/events (unwanted) OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=NO_CONTENT keeps content out of spans/events. NOTE: GCS/BigQuery completions still capture full content — to stop that, remove LOGS_BUCKET_NAME/OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK (drop the upload block in service.tf)
BigQuery Analytics not logging Verify plugin is configured in app/agent.py; check BQ_ANALYTICS_DATASET_ID env var is set
Third-party integration not capturing spans Check provider-specific env vars (API keys, endpoints); some providers (AgentOps) replace native telemetry
Traces missing tool spans Tool execution spans appear under execute_tool — check trace explorer filters
High telemetry costs Switch to NO_CONTENT mode; reduce BigQuery retention; disable unused tiers

Deep Dive: ADK Docs (WebFetch URLs)

For detailed documentation beyond what this skill covers, fetch these pages:

Topic URL
Observability overview https://adk.dev/observability/index.md
Agent activity logging https://adk.dev/observability/logging/index.md
Cloud Trace integration https://adk.dev/integrations/cloud-trace/index.md
BigQuery Agent Analytics https://adk.dev/integrations/bigquery-agent-analytics/index.md

Related Skills

  • /google-agents-cli-deploy — Deployment targets, CI/CD pipelines, and production workflows
  • /google-agents-cli-workflow — Development workflow, coding guidelines, and operational rules
  • /google-agents-cli-adk-code — ADK Python API quick reference for writing agent code

Reproducido de google/agents-cli bajo licencia Apache-2.0. Leer esta página en markdown.

Archivos

3 archivos en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

Antes de instalar

Requiere el binario `agents-cli` (instalable con `uv tool install google-agents-cli`) y, para logging/BigQuery, infraestructura provisionada vía Terraform con `agents-cli infra single-project`.

Detalles

Creador
google
Licencia
Apache-2.0
Recursos incluidos
referencias
Código fuente
Ver SKILL.md

Etiquetas

Más de google/agents-cli

Este repo incluye 7 skills. Si instalas uno, normalmente ya tienes los demás.

Guía para desplegar un agente ADK, configurar CI/CD, gestionar secretos o solucionar despliegues en Agent Runtime, Cloud Run o GKE, incluyendo Agent Gateway.

Costo de contexto al activarse
6.5k tok
Tamaño del paquete
8 archivos
Última actualización
hace 9 días
Oficialdevops infraestructura

Guía sobre la metodología de evaluación de Agent Platform y el Quality Flywheel: métricas, esquema de dataset, scoring LLM-as-judge y causas comunes de fallo.

Costo de contexto al activarse
6.4k tok
Tamaño del paquete
6 archivos
Última actualización
hace 9 días
Oficialtesting qa

Referencia rápida de patrones de la API Python de ADK: tipos de agente, definición de tools, orquestación, callbacks, manejo de estado y recetas de referencia para estudiar.

Costo de contexto al activarse
984 tok
Tamaño del paquete
4 archivos
Última actualización
hace 9 días
Oficialherramientas desarrollo

Guía activa siempre para el ciclo de vida completo de desarrollo con ADK: scaffolding, construcción, evaluación, despliegue, publicación y observación de agentes, con reglas de preservación de código y selección de modelo.

Costo de contexto al activarse
5.2k tok
Tamaño del paquete
6 archivos
Última actualización
hace 9 días
Oficialherramientas desarrollo

Guía para publicar un agente ADK o A2A en Gemini Enterprise, gestionar el Agent Registry y usar el comando `agents-cli publish gemini-enterprise`.

Costo de contexto al activarse
2.6k tok
Tamaño del paquete
1 archivo
Última actualización
hace 9 días
Oficialdevops infraestructura

Úsalo para 'crear un proyecto de agente', 'iniciar un proyecto ADK nuevo', 'añadir CI/CD' o 'mejorar/actualizar mi proyecto'. Cubre `scaffold create`, `scaffold enhance` y `scaffold upgrade`, plantillas y targets de deployment.

Costo de contexto al activarse
2.8k tok
Tamaño del paquete
2 archivos
Última actualización
hace 9 días
Oficialherramientas desarrollo

Skills relacionados

Ai Sdk

26.2k

Responde preguntas sobre la AI SDK y ayuda a construir funciones con IA: agentes, chatbots, RAG, streaming, tool calling, salida estructurada, embeddings y hooks como useChat.

Costo de contexto al activarse
1.4k tok
Tamaño del paquete
1 archivo
Última actualización
el mes pasado
Oficialdesarrollo apis

Configura Turborepo para builds de monorepo eficientes con caché local y remota. Útil al configurar Turborepo, optimizar pipelines de build o implementar caching distribuido.

Costo de contexto al activarse
2k tok
Tamaño del paquete
1 archivo
Última actualización
hace 5 meses
devops infraestructura

Implementa observabilidad integral para service meshes, incluyendo tracing distribuido, métricas y visualización. Útil para monitoreo de mesh, depuración de latencia y SLOs.

Costo de contexto al activarse
708 tok
Tamaño del paquete
2 archivos
Última actualización
hace 2 meses
devops infraestructura