google-agents-cli-observability
Skill này làm gì
Skill giải thích cách theo dõi một agent Google ADK đã triển khai, gồm truy vết và ghi nhật ký prompt. Skill dành cho lập trình viên chạy agent trong môi trường thật và cần gỡ lỗi lưu lượng thực.
Khi nào nên dùng
- ✓Khi bạn muốn thiết lập truy vết hoặc ghi nhật ký cho một agent đã triển khai.
- ✓Khi bạn cần tìm vì sao một agent trong môi trường thật lại hành xử như vậy.
- ✓Khi bạn muốn gửi dữ liệu phân tích của agent đến BigQuery hoặc công cụ giám sát bên thứ ba.
Liên kết skill
https://github.com/google/agents-cli/blob/main/skills/google-agents-cli-observability/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thiết lập truy vết và ghi nhật ký prompt cho agent ADK đã triển khai để tôi thấy nó trả lời gì trong môi trường thật.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill nói rõ tính năng giám sát nào dùng được ngay và tính năng nào cần thêm tài nguyên cloud. Skill hướng dẫn các bước thiết lập và các lệnh để kiểm tra nhật ký và truy vết có đang đến nơi hay không.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 --apply --project PROJECT_IDto provision these resources. Go projects get the BigQuery telemetry stack too; the GCS completion upload behind prompt-response logging and the BigQuery Agent Analytics plugin are Python only. Seereferences/cloud-trace-and-logging.mdfor details, env vars, and verification commands. If your project isn't scaffolded yet, see/google-agents-cli-scaffoldfirst.
Deployment order
| Do you want Terraform-managed observability? | Action |
|---|---|
| No | Run agents-cli deploy directly (works for all targets). |
| Yes | Run agents-cli infra single-project --apply first, then agents-cli deploy. |
If you already ran agents-cli deploy imperatively:
Do not apply Terraform afterward. For Agent Runtime in Gemini platform, Terraform owns the whole engine (service account, deployment spec, env vars), so a later apply can't be reconciled without taking over the resource.
Either delete the deployment and start over, or 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 |
references/adk-docs.md |
ADK: adk.dev pages to fetch for detail beyond this skill |
references/feedback-mechanism.md |
Adding a user-feedback endpoint — request model, structured logging, log sink → BigQuery |
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 | Scaffolded ADK Python and Claude projects | Disabled locally, enabled when deployed | Auditing LLM interactions, compliance |
| BigQuery Agent Analytics | Structured agent events (LLM calls, tool use, outcomes) to BigQuery | ADK Python agents with the plugin enabled; Claude template agents | 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 OpenTelemetry-instrumented 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
Scaffolded agents use OpenTelemetry to emit distributed traces. Every agent invocation produces spans that track the full execution flow.
Span Hierarchy
ADK projects. These are ADK's span names; other frameworks emit their own (
generate_contentcomes from the shared google-genai instrumentor either way).
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)
Câu hỏi thường gặp
Cloud Trace có cần thiết lập thêm không?
Mô tả cho biết Cloud Trace hoạt động ngay, không cần hạ tầng thêm.
Những gì cần tài nguyên do Terraform quản lý?
Ghi nhật ký phản hồi prompt và BigQuery Agent Analytics cần các tài nguyên được cấp phát bằng lệnh hạ tầng.
Nếu bạn đã triển khai agent rồi thì sao?
Skill cảnh báo rằng chạy Terraform apply sau khi triển khai trực tiếp bằng lệnh có thể xung đột, nên skill giải thích các lựa chọn an toàn.
Chi tiết
Mô tả gốc của tác giả
This skill should be used when the user wants to "set up tracing", "monitor my agent", "configure logging", "add observability", "debug production traffic", or needs guidance on monitoring deployed agents, including ADK (Agent Development Kit) agents. Covers Cloud Trace, prompt-response logging, BigQuery Agent Analytics, third-party integrations (AgentOps, Phoenix, MLflow, etc.), and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment setup (use google-agents-cli-deploy) or API code patterns (use google-agents-cli-adk-code).
repo: google/agents-cli
Độ phổ biến
- Sao GitHub
- 6.3k
- Vị trí xếp hạng
- #14371
- Giấy phép
- Apache-2.0
- Cập nhật
- 27/10/2026
Bình luận
- …
Thêm skill từ kho mã này
google-agents-cli-adk-code
6.3kGiúp agent của bạn viết mã cho agent AI bằng Google ADK, gồm công cụ, callback, trạng thái và các mẫu điều phối.
google-agents-cli-deploy
6.3kGiúp agent của bạn triển khai một agent AI lên Google Cloud, gồm Agent Runtime, Cloud Run, GKE, bí mật, CI/CD và xử lý sự cố.
google-agents-cli-eval
6.3kGiúp agent của bạn đánh giá một agent AI bằng bộ dữ liệu kiểm thử và chấm điểm, rồi tìm nguyên nhân các câu trả lời bị sai.
google-agents-cli-publish
6.3kGiúp agent của bạn đăng ký một agent AI đã triển khai với Gemini, và quản lý các agent cùng máy chủ MCP trong Agent Registry.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.