Official agent skill

Cloud Trace Querying

by google in google/skills

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.

OfficialApache-2.0Auto-check passedDatabases

Install Cloud Trace Querying

skills CLI
$ npx skills add google/skills --skill cloud-trace-querying -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install google/skills cloud-trace-querying --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/google/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cloud/cloud-trace-querying .claude/skills/cloud-trace-querying && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cloud-trace-querying
GitHub stars
21k
Token cost
~1.7k tokens
SKILL.md length
594 words
Files
118 (incl. scripts, references, assets)
Skills in repo
147
Repo updated
First seen
Licence
Apache-2.0

At a glance

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.

  • Works in 8 steps: Identify Google Cloud Project ID → Search Traces (Latency & Errors) → Fetch Entire Trace Hierarchy → …
  • Investigating slow requests
  • SKILL.md covers Prerequisites & Setup, Quickstart Workflows, Reference Documentation and Official Documentation Links
  • Calls bash and gcloud

What it does

Cloud Trace Querying is an agent skill from google/skills, published by the product's own GitHub organization. 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.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 129 other files, including scripts, reference files and assets (for example `assets/formatting/a2ui/single_span/display.a2ui.json`, `assets/formatting/a2ui/trace_chart/display.a2ui.json` and `assets/formatting/a2ui/trace_flow/display.a2ui.json`).

It sits in Databases, covering Query optimization. It works with Google Cloud. The repository describes itself as: Agent Skills for Google products and technologies. The licence is Apache-2.0.

When your agent uses it

  • Investigating slow requests
  • Analyzing trace hierarchies
  • Resolving latency regressions
  • Querying non-GCP telemetry

Example prompts

  • “/cloud-trace-querying”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Identify Google Cloud Project ID
  2. Search Traces (Latency & Errors)
  3. Fetch Entire Trace Hierarchy
  4. Fetch Correlated Application Logs
  5. Fetch Specific Trace Span
  6. Generate Cloud Console Deep Links
  7. Format Output
  8. Upstream Service Error Handling

What it can do on your machine

Read from SKILL.md and the folder at commit 7d97937. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • bash
    • gcloud

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.cloud.google.com
    • opentelemetry.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cloud Trace Querying loads about 1.7k tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 100 tokens; SKILL.md has 594 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~16k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from google/skills at commit 7d97937, republished under its Apache-2.0 licence (© google). 594 words, ~1,721 tokens.

Download SKILL.mdSave it as .claude/skills/cloud-trace-querying/SKILL.md (or your agent's skills folder). This skill also uses 117 other files; get the full folder from GitHub.
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.
metadata.version
1.0.0
metadata.category
CloudObservabilityAndMonitoring

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:
    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.

Show full SKILL.md (218 more words)Show less
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>'

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

Operational Workflows
Query Syntax & Tools
Semantic Conventions
Concepts & Architecture
Templates & Assets

© google, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 117 other files (scripts, references, assets) in skills/cloud/cloud-trace-querying of google/skills.

  • SKILL.md
  • 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.a2ui.json
  • 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/display.txt
  • … and 109 more

Open the folder on GitHubat commit 7d97937

Compare with similar skills

Cloud Trace Querying next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cloud Trace Querying compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cloud Trace Querying this skillgoogle/skills21k—~1.7kAutomated safety check: PassApache-2.0
Analyze Usageopenshift-eng/ai-helpers120—~2.7kAutomated safety check: PassApache-2.0
SQL Optimization Patternsynulihao/AgentSkillOS61711 repos~3.3kAutomated safety check: PassNone
Query Engine Designrevfactory/claude-code-harness120—~474Automated safety check: PassNone
Query Plan Snapshot CLIeclipse-rdf4j/rdf4j420—~1.5kAutomated safety check: PassBSD-3-Clause
Wp Acf And Content Modelingjorgerosal/wordpress-skills101—~3.2kAutomated safety check: PassMIT

Similar skills

  • Analyze Usage

    openshift-eng/ai-helpers

    A skill your agent uses when analyzing BigQuery usage patterns, costs, and query performance for a GCP project

    120 GitHub stars~2.7k tokensUpdated yesterday
    DatabasesAuto-check passed
  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 11 repos~3.3k tokens
    DatabasesAuto-check passed
  • Query Engine Design

    revfactory/claude-code-harness

    SQL query engine design and implementation guide. An agent skill from revfactory/claude-code-harness.

    120 GitHub stars~474 tokensUpdated 7 mo ago
    DatabasesAuto-check passed
  • Query Plan Snapshot CLI

    eclipse-rdf4j/rdf4j

    Use QueryPlanSnapshotCli to capture and compare RDF4J query plans, then assess likely performance improvements/regressions from execution verification and semantic plan diffs.

    420 GitHub stars~1.5k tokensUpdated today
    DatabasesAuto-check passed
  • Wp Acf And Content Modeling

    jorgerosal/wordpress-skills

    WordPress ACF and content modeling review. An agent skill from jorgerosal/wordpress-skills.

    101 GitHub stars~3.2k tokensUpdated 4 mo ago
    DatabasesAuto-check passed
  • Jpa Patterns

    affaan-m/ECC

    JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.

    275k GitHub starsUsed in 5 repos~1.2k tokens
    DatabasesAuto-check passed

More from google/skills

All 147 skills in this repo
  • Official

    Manages Google Cloud Privileged Access Manager entitlements and grants: create and edit entitlements, request temporary access, and approve or deny pending grants.

    21k GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Official

    Writes Terraform alerting policies for AI agents that emit OpenTelemetry metrics, covering reliability, cost, safety, security and quality signals on Google Cloud.

    21k GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Official

    Deploys open models or custom weights from Model Garden to Agent Platform endpoints, checks deployment status and cleans up endpoints, confirming before any change.

    21k GitHub stars~5k tokensUpdated today
    Auto-check passed
  • Official

    Searches, manages and scaffolds skills in the Gemini Enterprise Agent Platform Skill Registry using bundled Python scripts and Google Cloud credentials.

    21k GitHub stars~584 tokensUpdated today
    Auto-check passed
  • Designs GCP infrastructure as local Terraform, validates and scans it against best practices, then imports it to Application Design Center for deployment and troubleshooting.

    21k GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Official

    Analyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans.

    21k GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Cloud Trace Querying

What does Cloud Trace Querying do?

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. Cloud Trace Querying is an agent skill from google/skills, published by the product's own GitHub organization. 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.

When should I use Cloud Trace Querying?

Cloud Trace Querying fits situations like: investigating slow requests; analyzing trace hierarchies; resolving latency regressions; querying non-GCP telemetry.

How do I install Cloud Trace Querying in Claude Code?

Run `npx skills add google/skills --skill cloud-trace-querying -a claude-code`. Or copy the skill folder (skills/cloud/cloud-trace-querying in google/skills) into .claude/skills/cloud-trace-querying in your project. Claude Code loads it when a task matches its description.

How do I install Cloud Trace Querying in Codex?

Run `npx skills add google/skills --skill cloud-trace-querying -a codex`. Or copy the skill folder (skills/cloud/cloud-trace-querying in google/skills) into .agents/skills/cloud-trace-querying in your project. Codex loads it when a task matches its description.

Can I use Cloud Trace Querying in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google/skills --skill cloud-trace-querying -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cloud-trace-querying, .gemini/skills/cloud-trace-querying, .github/skills/cloud-trace-querying and .opencode/skills/cloud-trace-querying in your project.

What does Cloud Trace Querying need to run?

Going by SKILL.md and its folder, Cloud Trace Querying needs the command-line tools its instructions call (bash and gcloud). Our summary lists: Python 3.

Does Cloud Trace Querying access the network?

SKILL.md names 2 domains. As links in the text: docs.cloud.google.com and opentelemetry.io. This is read from the text; nothing was executed.

Is Cloud Trace Querying safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Cloud Trace Querying use?

Cloud Trace Querying is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cloud Trace Querying use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 15k tokens, read only when the agent opens those files.

What are the alternatives to Cloud Trace Querying?

Skills that share tags, products or a category with Cloud Trace Querying: Analyze Usage (openshift-eng/ai-helpers, 120 stars), SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars), Query Engine Design (revfactory/claude-code-harness, 120 stars) and Query Plan Snapshot CLI (eclipse-rdf4j/rdf4j, 420 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cloud Trace Querying?

google (a GitHub organization, an official publisher) maintains it in google/skills, which has 21,032 GitHub stars. The repository holds 147 skills in this directory. The repository was last updated on October 8, 2026.

Source: google/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.