bigquery-troubleshooting
它能做什么
这个技能帮你逐步诊断 BigQuery 问题。它适用于查询出错、变慢或费用突然超出预期的人。
适用场景
- ✓当 BigQuery 作业失败或运行速度远低于预期的时候。
- ✓当你的 BigQuery 支出突然激增,需要找出原因的时候。
- ✓当查询计划显示某个阶段是 BigQuery 中的瓶颈的时候。
技能链接
https://github.com/google/skills/blob/main/skills/cloud/bigquery-troubleshooting/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 BigQuery 查询以前只要一分钟,现在要一个小时。你能找出是什么让它变慢的吗?”
每周 5 个新技能,1 分钟读完。
工作原理
它遵循逐步检查清单,提取作业详情和阶段耗时,以找出瓶颈。然后它会用通俗的语言解释发现的问题。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
BigQuery Troubleshooting
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
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:bigquery-troubleshooting)"
and append agent-skills/1.0 (skill:bigquery-troubleshooting) to User-Agent headers.
Prerequisites & Environment Setup
Before running diagnostic queries or investigating incident telemetry:
Google Cloud SDK: Ensure the Google Cloud SDK is installed and configured.
Project Selection: Set the active Google Cloud project:
gcloud config set project {project_id}API Enablement: Ensure BigQuery and Cloud Monitoring APIs are enabled:
gcloud services enable bigquery.googleapis.com monitoring.googleapis.comAuthentication: Authenticate the environment:
- CLI commands (
bq show -j):gcloud auth login - SDKs and automated diagnostic scripts:
gcloud auth application-default login - Service accounts: Set
GOOGLE_APPLICATION_CREDENTIALS="/path/to/key.json"
- CLI commands (
Billing & IAM Roles:
- Verify an active Google Cloud Billing account is attached to
{project_id}. - Ensure appropriate IAM roles:
roles/bigquery.jobUser: Executing diagnostic queries.roles/bigquery.resourceViewerorroles/bigquery.admin: Inspecting reservation and job execution telemetry.roles/monitoring.viewer: Cloud Monitoring metrics.roles/billing.viewer: Cloud Billing reports and cost attribution.
- Verify an active Google Cloud Billing account is attached to
Companion Skills Installation: This skill is part of a 3-pillar operations suite (
bigquery-observability,bigquery-optimization,bigquery-troubleshooting). If any companion skill is not yet installed in your environment, install the full suite:npx skills add google/skills --skill bigquery-observability --skill bigquery-optimization --skill bigquery-troubleshooting(If
bigquery-observabilityis not installed, use the self-contained baseline formulas and query templates provided directly in the reference sections below).
Workflow
- Scope & Symptom Identification: Identify the primary symptom, target
project_id,region,reservation_id, orjob_id, and domain (Performance, Compute Cost, or Storage Cost). If the request falls outside incident diagnosis or asks for a sibling domain, follow Routing Boundaries below. - Telemetry Tool Selection: Follow the tool-selection guidance in
bigquery-observability
(
bigquery_observability) to select the appropriate telemetry interface (REST APIbq show --location={location} -j {project_id}:{job_id}for single-job stage bottlenecks vs.INFORMATION_SCHEMAfor system-wide factors). Diagnostic workflows, symptom-to-cause mappings, key tables/fields, CLI triage commands, and remediation levers are fully defined in this skill. For pre-composed SQL query templates and full schema dictionaries, consultbigquery-observability. - Open-Ended Triage (Stage 1 Baseline Scan & Conversational Gate): When
the user inquiry is open-ended or vague (e.g. "Why is BigQuery slow
today?" or "Why did my bill spike?"), execute a bounded high-level
baseline scan to isolate the affected domain before drilling into deep-dive
diagnostics:
- Bounded Initial Scan: Follow the baseline scan guidance in the corresponding domain reference under Domain References. Ensure initial queries are strictly bounded (e.g. 7-day Period-over-Period with partition and job-type filters; for unspecified cost spikes, scan the 3 primary vectors: On-Demand TiB, Capacity slot-hours, and Storage GiB) to keep diagnostic telemetry overhead minimal.
- Conversational Gate: Factually summarize high-level baseline findings first and propose 2–3 focused drill-down options rather than dumping downstream sub-vector queries unsolicited.
- Domain Deep Dive & Comparative Analysis: Execute the step-by-step diagnostic workflow defined in the corresponding do
常见问题
它也涵盖费用激增吗?
是的。它涵盖按需查询费用、槽位自动扩缩和存储增长。
它使用哪些工具?
它使用 bq 命令行工具、INFORMATION_SCHEMA 查询和 Cloud Monitoring。
它需要结算权限吗?
需要。读取作业数据需要有效的结算账户和正确的 BigQuery 角色。
详情
作者的原始描述
Provides diagnostic workflows and step-by-step root-cause analysis procedures for actively broken, failing, or slow BigQuery jobs, execution graph and query plan stage bottlenecks, system performance issues, or unexpectedly expensive workloads. Use when interpreting symptoms, isolating bottlenecks, diagnosing cost spikes (on-demand query spend, capacity slot autoscaling, storage growth), execution graph stages or substep variables, identifying root causes, and determining remediation steps. Don't use for writing or optimizing SQL, proactive capacity planning, or storage layout design (use bigq
repo: google/skills
热度
- GitHub 星标
- 22k
- 排名
- #10230
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
finding-google-skills
22k帮你的智能体为某项设置任务找到合适的 Google 指南,例如托管、数据库、存储、登录或 AI 模型服务。
gcloud
22k帮你的智能体编写并检查 Google Cloud gcloud 命令,在运行任何内容之前查阅准确的语法,避免猜测参数。
google-cloud-recipe-auth
22k引导你的智能体了解 Google Cloud 的身份与访问管理,包括人员和服务如何登录,以及它们各自获得哪些权限。
google-cloud-recipe-onboarding
22k带领新开发者完成在 Google Cloud 上的第一步,包括选择项目、关联计费,以及部署第一个资源。