Agent skill · google
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.
What it needs
About 3k tokens when loaded.
What this skill does
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. Attribution MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDKMETRICSREQUESTATTRIBUTION="agent-skills/1.0 (skill:cloud-trace-querying)" and append agent-skills/1.0 (skill:cloud-trace-querying) to User-Agent headers. Prerequisites & Setup 1. Google Cloud SDK: Verify gcloud is installed (Installation Guide). 2. Authentication: Authenticate CLI and application default credentials: 3. Project & Billing: Identify the target <PROJECTID> (from the user's prompt or via bash scripts/gettraceproject/run.sh), ensure an active billing account is attached, and configure the project if not already set: 4. API Enablement: Verify Cloud Trace and Cloud Logging APIs are enabled: 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: 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: 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. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills google/cloud-trace-querying