cloud-trace-querying
Query Cloud Trace spans, filter by latency thresholds or error status, correlate distributed traces with Cloud Logging, and diagnose latency bottlenecks…
Skill by googleOfficial
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/google-cloud-trace-querying
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, cloud
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/cloud-trace-querying
What's inside
- Skill name
cloud-trace-querying- Description
- 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.
- License
- Apache-2.0
- Metadata
- version: 1.0.2 · category: CloudObservabilityAndMonitoring
- Instructions
- 136 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (90)
- SKILL.md
- display.a2ui.json · assets/formatting/a2ui/single_span/
- display.a2ui.json · assets/formatting/a2ui/trace_chart/
- display.a2ui.json · assets/formatting/a2ui/trace_flow/
- display.a2ui.json · assets/formatting/a2ui/traces_heat_map/
- display.txt · assets/formatting/ascii/single_span/
- display.txt · assets/formatting/ascii/trace_chart/
- display.txt · assets/formatting/ascii/trace_flow/
- display.txt · assets/formatting/ascii/traces_heat_map/
- SCENARIO.md · assets/queries/billing_errors/
- query.txt · assets/queries/billing_errors/
- SCENARIO.md · assets/queries/checkout_latency/
- query.txt · assets/queries/checkout_latency/
- SCENARIO.md · assets/queries/customer_spans/
- query.txt · assets/queries/customer_spans/
- SCENARIO.md · assets/queries/prod_outliers/
- query.txt · assets/queries/prod_outliers/
- SCENARIO.md · assets/queries/slow_db/
- query.txt · assets/queries/slow_db/
- api-limits.md · references/
- attribution.md · references/
- concepts-span.md · references/
- concepts-trace.md · references/
- console-deep-links.md · references/
- conventions-gcp-legacy.md · references/
- conventions-gcp.md · references/
- conventions-otel-genai.md · references/
- conventions-otel-grpc.md · references/
- conventions-otel-http.md · references/
- conventions-otel.md · references/
- conventions.md · references/
- correlated-logs.md · references/
- decision-tree.md · references/
- filter-syntax.md · references/
- index.md · references/
- knowledge-overview.md · references/
- logs-trace-correlation.md · references/
- observability-scopes.md · references/
- querying-mcp.md · references/
- querying-observability-analytics.md · references/
- troubleshoot-latency.md · references/
- workflows-overview.md · references/
- run.sh · scripts/fetch_entire_trace/
- main.py · scripts/fetch_entire_trace/src/
- test.sh · scripts/fetch_entire_trace/
- main_test.py · scripts/fetch_entire_trace/tests/
- run.sh · scripts/fetch_related_logs/
- log_fetcher.py · scripts/fetch_related_logs/src/
- main.py · scripts/fetch_related_logs/src/
- observability_scopes.py · scripts/fetch_related_logs/src/
- timestamp_utils.py · scripts/fetch_related_logs/src/
- test.sh · scripts/fetch_related_logs/
- main_test.py · scripts/fetch_related_logs/tests/
- timestamp_utils_test.py · scripts/fetch_related_logs/tests/
- run.sh · scripts/fetch_trace_span/
- main.py · scripts/fetch_trace_span/src/
- test.sh · scripts/fetch_trace_span/
- main_test.py · scripts/fetch_trace_span/tests/
- run.sh · scripts/generate_links/
- main.py · scripts/generate_links/src/
- …and 30 more
SKILL.md (first lines)
# 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](references/attribution.md). For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix `gcloud` with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="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](https://docs.cloud.google.com/sdk/docs/install-sdk)). 2. **Authentication**: Authenticate CLI and application default credentials: ```bash 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: ```bash gcloud config set project <PROJECT_ID> ``` 4. **API Enablement**: Verify Cloud Trace and Cloud Logging APIs are enabled: ```bash 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 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 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 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 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 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 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 - **Master Index**: [Reference Documentation Index](./references/index.md) ### Operational Workflows - [Troubleshoot Latency Workflow](./references/troubleshoot-latency.md) - [Correlated Logs Workflow](./references/correlated-logs.md) - [Trace Querying Decision Tree](./references/decision-tree.md) - [Console Deep Links](./references/console-deep-links.md) - [Workflows Overview](./references/workflows-overview.md) ### Query Syntax & Tools - [Filter Syntax](./references/filter-syntax.md) (`root:`, `latency:`, `+span:`, `error:true`) - [API Limits and Constraints](./references/api-limits.md) - [Observability Analytics (BigQuery SQL)](./references/querying-observability-analytics.md) - [Cloud Trace MCP Tools](./references/querying-mcp.md) ### Semantic Conventions - [Conventions Overview](./references/conventions.md) - [OpenTelemetry Core](./references/conventions-otel.md) - [OpenTelemetry HTTP](./references/conventions-otel-http.md) - [OpenTelemetry gRPC & RPC](./references/conventions-otel-grpc.md) - [OpenTelemetry GenAI](./references/conventions-otel-genai.md) - [GCP App Hub & Service Conventions](./references/conventions-gcp.md) - [GCP Legacy Labels](./references/conventions-gcp-legacy.md) ### Concepts & Architecture
From google/skills, Apache-2.0.
More from google/skills
- 0.865score
google-ads-api-account-diagnostics
google-ads-api-teamOfficial
Diagnoses Google Ads account performance issues such as conversion loss (value or volume), low lead flow/volume, and lost impression share (opportunities) due…
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-triage
Google LLCOfficial
Expert guidance for security alert triage in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-detection-engineering
Google LLCOfficial
Author, validate, test, and deploy YARA-L 2.0 detection rules and evaluate end-to-end detection coverage gaps in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-hunt
Google LLCOfficial
Expert guidance for proactive threat hunting in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-cases
Google LLCOfficial
Manage Google Security Operations (SecOps) SOAR cases throughout their lifecycle.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-investigate
Google LLCOfficial
Expert guidance for deep security incident and entity investigations in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.824score
google-ads-api-quickstart
google-ads-api-teamOfficial
Guides developers through Google Ads API quickstart: credential setup, choosing from 6 client libraries/REST, configuring environments, and running a…
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.819score
google-ads-api-mcp-setup
google-ads-api-teamOfficial
Guides developers through downloading, configuring, and installing the official open-source Google Ads MCP Server.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.815score
ima-dai-sdk
Google LLCOfficial
Integrates the Google Interactive Media Ads (IMA) Dynamic Ad Insertion (DAI) SDK into websites, web apps, mobile apps, or TV apps.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.815score
ima-sdk-client-side
Google LLCOfficial
Supports Interactive Media Ads (IMA) SDK.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.699score
gcloud
googleOfficial
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-deploy
googleOfficial
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…
SkillAFreshness: A★ 21.5KClaude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 21,542
- Forks
- 1,821
- Open issues
- 21
- Last commit (this folder)
- Oct 19, 2026 (9 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.2
- License
- Apache-2.0
- Repository
- github.com/google/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from google
- 0.699score
retrieving-developer-knowledge
googleOfficial
Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome, Web, Flutter, Go, Firebase, and…
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
data-manager-api-setup
googleOfficial
Guides developers through client library installation and authentication setup steps for the Data Manager API.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-migrate-from-ai-studio
googleOfficial
Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI).
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
gcloud
googleOfficial
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
google-cloud-recipe-onboarding
googleOfficial
Guides a developer's first steps on Google Cloud, covering account creation, billing setup, project management, and deploying a first resource.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-deploy
googleOfficial
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…
SkillAFreshness: A★ 21.5KClaude Code +9
Cite this page
cloud-trace-querying skill. Agent Mart. https://agentmart.dev/skills/google-cloud-trace-querying (last updated 2026-10-24)