google-agents-cli-observability

โดย google

ทักษะนี้ควรใช้เมื่อผู้ใช้ต้องการ "ตั้งค่าการติดตาม", "ตรวจสอบเอเจนต์ ADK ของฉัน", "กำหนดค่าการบันทึก", "เพิ่มความสามารถในการสังเกตการณ์", "ดีบักทราฟฟิกที่ใช้งานจริง" หรือต้องการคำแนะนำเกี่ยวกับการตรวจสอบเอเจนต์ ADK (Agent Development Kit) ที่ปรับใช้แล้ว ครอบคลุม Cloud Trace, การบันทึก prompt-response, BigQuery Agent Analytics, การบูรณาการกับบุคคลที่สาม (AgentOps, Phoenix, MLflow, ฯลฯ) และการแก้ไขปัญหา เป็นส่วนหนึ่งของชุดทักษะ Google ADK (Agent Development Kit) ห้ามใช้สำหรับการตั้งค่าการปรับใช้ (ใช้...

npx skills add https://github.com/google/agents-cli --skill google-agents-cli-observability

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

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

Observability Tiers

Choose the right level of observability based on your needs:

TierWhat It DoesScopeDefault StateBest For
Cloud TraceDistributed tracing — execution flow, latency, errors via OpenTelemetry spansAll templates, all environmentsAlways enabledDebugging latency, understanding agent execution flow
Prompt-Response LoggingGenAI interactions exported to GCS, BigQuery, and Cloud LoggingADK agents onlyDisabled locally, enabled when deployedAuditing LLM interactions, compliance
BigQuery Agent AnalyticsStructured agent events (LLM calls, tool use, outcomes) to BigQueryADK agents with plugin enabledOpt-in (--bq-analytics at scaffold time)Conversational analytics, custom dashboards, LLM-as-judge evals
Third-Party IntegrationsExternal observability platforms (AgentOps, Phoenix, MLflow, etc.)Any ADK agentOpt-in, per-provider setupTeam 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

DeploymentSetup
Agent RuntimeAutomatic — 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 devWorks 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:

TierCapturesControlled byDefault (Terraform deploy)
GCS/BigQuery completionsFull prompts/responses (the prompt-response logging feature)OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload + LOGS_BUCKET_NAMEOn — full content
Trace spans / Cloud Logging eventsSpan/event contentOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT + ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS=falseOffNO_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).

PlatformKey DifferentiatorSetup ComplexitySelf-Hosted Option
AgentOpsSession replays, 2-line setup, replaces native telemetryMinimalNo (SaaS)
Arize AXCommercial platform, production monitoring, evaluation dashboardsLowNo (SaaS)
PhoenixOpen-source, custom evaluators, experiment testingLowYes
MLflowOTel traces to MLflow Tracking Server, span tree visualizationMedium (needs SQL backend)Yes
Monocle1-call setup, VS Code Gantt chart visualizerMinimalYes (local files)
WeaveW&B platform, team collaboration, timeline viewsLowNo (SaaS)
FreeplayPrompt management + evals + observability in one platformLowNo (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

IssueSolution
No traces in Cloud TraceVerify 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 appearingCheck 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 loggingVerify plugin is configured in app/agent.py; check BQ_ANALYTICS_DATASET_ID env var is set
Third-party integration not capturing spansCheck provider-specific env vars (API keys, endpoints); some providers (AgentOps) replace native telemetry
Traces missing tool spansTool execution spans appear under execute_tool — check trace explorer filters
High telemetry costsSwitch 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:

TopicURL
Observability overviewhttps://adk.dev/observability/index.md
Agent activity logginghttps://adk.dev/observability/logging/index.md
Cloud Trace integrationhttps://adk.dev/integrations/cloud-trace/index.md
BigQuery Agent Analyticshttps://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

Skills เพิ่มเติมจาก google

google-agents-cli-adk-code
google
ทักษะนี้ควรใช้เมื่อผู้ใช้ต้องการ "เขียนโค้ดเอเจนต์", "สร้างเอเจนต์ด้วย ADK", "เพิ่มเครื่องมือ", "สร้าง callback", "กำหนดเอเจนต์", "ใช้การจัดการสถานะ" หรือต้องการรูปแบบและตัวอย่างโค้ด Python API ของ ADK (Agent Development Kit) ซึ่งเป็นส่วนหนึ่งของชุดทักษะ Google ADK โดยให้ข้อมูลอ้างอิงด่วนสำหรับประเภทเอเจนต์ นิยามเครื่องมือ รูปแบบการประสานงาน callback และการจัดการสถานะ ห้ามใช้สำหรับการสร้างโปรเจกต์ใหม่ (ให้ใช้ google-agents-cli-scaffold) หรือการปรับใช้...
developmentapicode-review
google-agents-cli-eval
google
ทักษะนี้ควรใช้เมื่อผู้ใช้ต้องการ "รันการประเมิน", "ประเมิน ADK agent ของฉัน", "เขียนชุดข้อมูลประเมิน", "วิเคราะห์ข้อผิดพลาดในการประเมิน", "เปรียบเทียบผลการประเมิน", "ปรับแต่ง agent" หรือต้องการคำแนะนำเกี่ยวกับระเบียบวิธีการประเมินของ Agent Platform และ Quality Flywheel ครอบคลุมเมตริกการประเมิน โครงสร้างชุดข้อมูล การให้คะแนนแบบ LLM-as-judge และสาเหตุข้อผิดพลาดทั่วไป ห้ามใช้สำหรับรูปแบบโค้ด API (ใช้ google-agents-cli-adk-code), การปรับใช้ (ใช้ google-agents-cli-deploy) หรือการสร้างโครงโปรเจกต์ (ใช้...
developmenttestingdata-analysis
google-agents-cli-workflow
google
ทักษะนี้ควรใช้เมื่อผู้ใช้ต้องการ "พัฒนาเอเจนต์", "สร้างเอเจนต์โดยใช้ ADK", "รันเอเจนต์ในเครื่อง", "ดีบักโค้ดเอเจนต์", "ทดสอบเอเจนต์", "ปรับใช้เอเจนต์", "เผยแพร่เอเจนต์", "ตรวจสอบเอเจนต์" หรือต้องการแนวทางการพัฒนาและโค้ดของ ADK (Agent Development Kit) จุดเริ่มต้นสำหรับการสร้างเอเจนต์ ADK ทำงานตลอดเวลา — ให้เวิร์กโฟลว์เต็มรูปแบบ (โครงสร้าง, สร้าง, ประเมิน, ปรับใช้, เผยแพร่, สังเกตการณ์), กฎการรักษาโค้ด, คำแนะนำในการเลือกโมเดล และ...
developmentdevopstesting
google-agents-cli-deploy
google
ทักษะนี้ควรใช้เมื่อผู้ใช้ต้องการ "ปรับใช้เอเจนต์", "ปรับใช้ ADK เอเจนต์ของฉัน", "ตั้งค่า CI/CD", "กำหนดค่าความลับ", "แก้ไขปัญหาการปรับใช้" หรือต้องการคำแนะนำเกี่ยวกับ Agent Runtime, Cloud Run หรือเป้าหมายการปรับใช้ GKE ครอบคลุมขั้นตอนการปรับใช้ บัญชีบริการ การย้อนกลับ และโครงสร้างพื้นฐานสำหรับการผลิต เป็นส่วนหนึ่งของชุดทักษะ Google ADK (Agent Development Kit) ห้ามใช้สำหรับรูปแบบโค้ด API (ให้ใช้ google-agents-cli-adk-code) การประเมินผล (ให้ใช้ google-agents-cli-eval) หรือ...
developmentdevops
google-agents-cli-scaffold
google
This skill should be used when the user wants to "create an agent project", "start a new ADK project", "build me a new agent", "add CI/CD to my project", "add deployment", "enhance my project", or "upgrade my project". Part of the Google ADK (Agent Development Kit) skills suite. Covers `agents-cli scaffold create`, `scaffold enhance`, and `scaffold upgrade` commands, template options, deployment targets, and the prototype-first workflow. Do NOT use for writing agent code (use...
developmentdevops
google-agents-cli-publish
google
ทักษะนี้ควรใช้เมื่อผู้ใช้ต้องการ "เผยแพร่เอเจนต์", "เผยแพร่เอเจนต์ ADK ของฉัน", "ลงทะเบียนเอเจนต์กับ Gemini Enterprise", "เผยแพร่ไปยัง Gemini Enterprise" หรือต้องการคำแนะนำเกี่ยวกับคำสั่ง agents-cli publish gemini-enterprise ครอบคลุมโหมดการลงทะเบียน ADK เทียบกับ A2A การใช้งานแบบโปรแกรมและแบบโต้ตอบ การอ้างอิงแฟล็ก การตรวจจับอัตโนมัติจากข้อมูลเมตาการปรับใช้ และการแก้ไขปัญหา เป็นส่วนหนึ่งของชุดทักษะ Google ADK (Agent Development Kit) ห้ามใช้สำหรับการปรับใช้ (ใช้...
developmentdevopsapi