本文へ移動
cccskills
無料GitHub で公開

cloud-trace-querying

Query Cloud Trace spans, filter by latency thresholds or error status, correlate distributed traces with Cloud Logging, and diagnose latency bottlenecks across Google Cloud services. Use when investigating slow requests, analyzing trace hierarchies, or resolving latency regressions. Do NOT use for querying non-GCP telemetry or database query optimization outside Cloud Trace.

インストール方法を見る

含まれるファイル(89)

  • SKILL.md6.7 KB
  • assets/formatting/a2ui/single_span/display.a2ui.json1.1 KB
  • assets/formatting/a2ui/trace_chart/display.a2ui.json1.1 KB
  • assets/formatting/a2ui/trace_flow/display.a2ui.json767 B
  • assets/formatting/a2ui/traces_heat_map/display.a2ui.json1.8 KB
  • assets/formatting/ascii/single_span/display.txt377 B
  • assets/formatting/ascii/trace_chart/display.txt517 B
  • assets/formatting/ascii/trace_flow/display.txt430 B
  • assets/formatting/ascii/traces_heat_map/display.txt887 B
  • assets/queries/billing_errors/query.txt73 B
  • assets/queries/billing_errors/SCENARIO.md1.4 KB
  • assets/queries/checkout_latency/query.txt47 B
  • assets/queries/checkout_latency/SCENARIO.md416 B
  • assets/queries/customer_spans/query.txt24 B
  • assets/queries/customer_spans/SCENARIO.md307 B
  • assets/queries/prod_outliers/query.txt51 B
  • assets/queries/prod_outliers/SCENARIO.md979 B
  • assets/queries/slow_db/query.txt35 B
  • assets/queries/slow_db/SCENARIO.md440 B
  • references/api-limits.md1.6 KB
  • references/concepts-span.md857 B
  • references/concepts-trace.md1.3 KB
  • references/console-deep-links.md1.1 KB
  • references/conventions-gcp-legacy.md3.4 KB
  • references/conventions-gcp.md2.7 KB
  • references/conventions-otel-genai.md6.9 KB
  • references/conventions-otel-grpc.md2.4 KB
  • references/conventions-otel-http.md1.9 KB
  • references/conventions-otel.md4.2 KB
  • references/conventions.md2.5 KB
  • references/correlated-logs.md2.5 KB
  • references/decision-tree.md2.1 KB
  • references/filter-syntax.md4.0 KB
  • references/index.md2.7 KB
  • references/knowledge-overview.md3.2 KB
  • references/logs-trace-correlation.md1.7 KB
  • references/observability-scopes.md3.0 KB
  • references/querying-mcp.md1.8 KB
  • references/querying-observability-analytics.md4.9 KB
  • references/troubleshoot-latency.md2.1 KB
  • references/workflows-overview.md881 B
  • scripts/fetch_entire_trace/run.sh231 B
  • scripts/fetch_entire_trace/src/main.py1.8 KB
  • scripts/fetch_entire_trace/test.sh279 B
  • scripts/fetch_entire_trace/tests/main_test.py3.9 KB
  • scripts/fetch_related_logs/run.sh231 B
  • scripts/fetch_related_logs/src/log_fetcher.py7.4 KB
  • scripts/fetch_related_logs/src/main.py2.4 KB
  • scripts/fetch_related_logs/src/observability_scopes.py3.0 KB
  • scripts/fetch_related_logs/src/timestamp_utils.py577 B
  • scripts/fetch_related_logs/test.sh422 B
  • scripts/fetch_related_logs/tests/main_test.py10.6 KB
  • scripts/fetch_related_logs/tests/timestamp_utils_test.py1.1 KB
  • scripts/fetch_trace_span/run.sh231 B
  • scripts/fetch_trace_span/src/main.py2.6 KB
  • scripts/fetch_trace_span/test.sh279 B
  • scripts/fetch_trace_span/tests/main_test.py5.1 KB
  • scripts/generate_links/run.sh138 B
  • scripts/generate_links/src/main.py1.7 KB
  • scripts/generate_links/test.sh279 B
  • scripts/generate_links/tests/main_test.py2.7 KB
  • scripts/get_trace_project/run.sh231 B
  • scripts/get_trace_project/src/main.py402 B
  • scripts/get_trace_project/src/project_resolver.py2.0 KB
  • scripts/get_trace_project/test.sh279 B
  • scripts/get_trace_project/tests/integration_test.py2.7 KB
  • scripts/get_trace_project/tests/project_resolver_test.py2.8 KB
  • scripts/requirements.txt92 B
  • scripts/run_python_with_deps/run.sh2.0 KB
  • scripts/run_python_with_deps/src/cleanup_env.py2.1 KB
  • scripts/run_python_with_deps/src/lock_manager.py2.5 KB
  • scripts/run_python_with_deps/src/manage_venv.py1.7 KB
  • scripts/run_python_with_deps/src/path_resolver.py3.4 KB
  • scripts/run_python_with_deps/src/venv_cleaner.py800 B
  • scripts/run_python_with_deps/src/venv_executor.py1.2 KB
  • scripts/run_python_with_deps/src/venv_setup.py2.1 KB
  • scripts/run_python_with_deps/test.sh364 B
  • scripts/run_python_with_deps/tests/cleanup_env_test.py2.5 KB
  • scripts/run_python_with_deps/tests/lock_manager_test.py2.0 KB
  • scripts/run_python_with_deps/tests/path_resolver_test.py5.4 KB
  • scripts/run_python_with_deps/tests/venv_setup_test.py1.8 KB
  • scripts/search_traces/run.sh231 B
  • scripts/search_traces/src/main.py2.1 KB
  • scripts/search_traces/src/timestamp_utils.py1.5 KB
  • scripts/search_traces/src/trace_searcher.py16.0 KB
  • scripts/search_traces/test.sh279 B
  • scripts/search_traces/tests/main_test.py2.7 KB
  • scripts/search_traces/tests/timestamp_utils_test.py1.7 KB
  • scripts/search_traces/tests/trace_searcher_test.py17.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Cloud Trace Querying Skill (cloud-trace-querying)

This skill equips the agent to interact with Cloud Trace by providing standard query patterns, diagnostic workflows for latency and errors, and tools to fetch and inspect trace hierarchies.

[!IMPORTANT] AUTONOMOUS TOOL EXECUTION MANDATE: You MUST execute the tool scripts directly in bash to query telemetry. Do NOT just describe query strings or write Python scripts. Run the provided bash tools directly and report the exact results.

Prerequisites & Setup

  1. Google Cloud SDK: Verify gcloud is installed (Installation Guide).
  2. Authentication: Authenticate CLI and application default credentials:
    gcloud auth login && gcloud auth application-default login
    
  3. Project & Billing: Identify the target <PROJECT_ID> (from the user's prompt or via bash scripts/get_trace_project/run.sh), ensure an active billing account is attached, and configure the project if not already set:
    gcloud config set project <PROJECT_ID>
    
  4. API Enablement: Verify Cloud Trace and Cloud Logging APIs are enabled:
    gcloud services enable cloudtrace.googleapis.com logging.googleapis.com
    

Quickstart Workflows

1. Identify Google Cloud Project ID

If the user specified a Google Cloud project ID in their prompt, use it.

If they did not, ALWAYS determine the Google Cloud project ID by running:

bash scripts/get_trace_project/run.sh

2. Search Traces (Latency & Errors)

To find traces matching specific criteria, such as a root span of /v1/booking/book with a duration of at least 1.5s:

bash scripts/search_traces/run.sh --filter 'root:/v1/booking/book latency:1.5s' --projects '<PROJECT_ID>'

Note: --filter is required. To list traces without specific filtering, pass --filter '' or --filter 'root:'. Filter syntax: The Cloud Trace API uses latency:<duration> (such as latency:1.5s for duration >= 1.5s), which corresponds to "Span duration" in Trace Explorer. The script outputs JSON where each cluster's examples array contains sample trace objects with trace_id, duration_seconds, span count, and error status.

3. Fetch Entire Trace Hierarchy

To view all spans and status codes/labels within a trace:

bash scripts/fetch_entire_trace/run.sh --trace-id '<TRACE_ID>' --project '<PROJECT_ID>'

4. Fetch Correlated Application Logs

To retrieve application log entries correlated with a trace ID:

bash scripts/fetch_related_logs/run.sh --trace-id '<TRACE_ID>' --trace-projects '<PROJECT_ID>'

Application log entries are useful when inspecting stack traces, exception messages, and log events emitted during span execution. When diagnosing errors or service crashes, inspect the returned log entries for severity: "ERROR" to confirm root causes or uncover unhandled exceptions. Note: fetch_related_logs queries the default log scope (_Default), searching across configured log views in the target project. An empty response can occur if: (1) no log entries match the criteria, (2) the caller lacks IAM permissions to view the matching entries, or (3) matching entries reside in log views outside the searched log scope.

5. Fetch Specific Trace Span

To inspect attributes and metadata of a single span within a trace:

bash scripts/fetch_trace_span/run.sh --trace-id '<TRACE_ID>' --span-id '<SPAN_ID>' --project '<PROJECT_ID>'

6. Generate Cloud Console Deep Links

To generate direct Cloud Console URLs for browser inspection of traces or correlated logs:

bash scripts/generate_links/run.sh --trace-id '<TRACE_ID>' --project '<PROJECT_ID>' [--span-id '<SPAN_ID>']

7. Format Output

  • Terminal / CLI: Render span trees as indented ASCII timelines using |--.
  • UI Presentation: Render as A2UI JSON graph structures when requested for UI.

8. Upstream Service Error Handling

If the Cloud Trace API or Cloud Logging API returns an upstream HTTP service error (such as 500 Internal Server Error, 503 Service Unavailable, or GoogleAPICallError), report the upstream service outage directly to the user. Do not attempt to inspect virtual environments, modify internal scripts, or debug local libraries.

Reference Documentation

Operational Workflows

Query Syntax & Tools

Semantic Conventions

Concepts & Architecture

Templates & Assets

Official Documentation Links

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for standard infrastructure monitoring unrelated to AI agents, or when the agent is not instrumented with OpenTelemetry (for Reliability, Cost, Safety, Security alerts). NOTE: Reliability, Cost, Safety, and Security alerts use generic OTel metrics and work across runtimes (such as Cloud Run, Vertex AI). Quality alerts rely on Vertex AI Online Monitors and are strictly bound to Vertex AI deployments.

日本語の概要は準備中です。原文の説明を表示しています。

google/skills2.1万2026年10月10日 更新

Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available models, check if a specific model is deployable (`gcloud ai model-garden models list-deployment-config`), query deployment cost, troubleshoot deployment errors (like quota limits), or undeploy/clean up endpoints. Also use when copying and deploying a 1P Tuned Model. Don't use for pure listing/discovery questions of the form "is X deployed?", "list my endpoints", or "which regions have models running?" — for those use `agent-platform-endpoint-management`. Don't use for running model evaluations (use `agent-platform-eval-flywheel` skill).

日本語の概要は準備中です。原文の説明を表示しています。

google/skills2.1万2026年10月10日 更新

Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for running model evaluations.

日本語の概要は準備中です。原文の説明を表示しています。

google/skills2.1万2026年10月10日 更新

Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when generating synthetic user scenarios, evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results before and after a fix, or when guidance is needed on Agent Platform eval methodology — including dataset schema, LLM-as-judge scoring, and common failure causes. For fine-tuning, use agent-platform-tuning. For general production deployment, use agent-platform-deploy.

日本語の概要は準備中です。原文の説明を表示しています。

google/skills2.1万2026年10月10日 更新

Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate code for calling Gemini or OpenMaaS models, authenticate with GenAI SDK, OpenAI SDK, or legacy Agent Platform SDK, configure base URLs and global/regional endpoints, or troubleshoot 429 Resource Exhausted (DSQ), 400 User Validation, or 404 Not Found errors. Don't use for deploying models to endpoints or for running model evaluations.

日本語の概要は準備中です。原文の説明を表示しています。

google/skills2.1万2026年10月10日 更新

Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry).

日本語の概要は準備中です。原文の説明を表示しています。

google/skills2.1万2026年10月10日 更新

google のスキルをすべて見る

このスキルの問題を報告する