bigquery
Original:🇺🇸 English
Translated
Query Mozilla telemetry data directly from BigQuery using the bq CLI. Use when the user wants to run SQL against Firefox telemetry, analyze Windows version distribution, count DAU/MAU/WAU, query Glean metrics, or investigate user populations. Triggers on "bigquery", "bq", "telemetry query", "DAU", "MAU", "Windows distribution", "macOS distribution", "Darwin version", "Linux distribution", "kernel version", "client count", "user count", "Glean metrics query", "baseline_clients".
7installs
Sourcejwmossmoz/agent-skills
Added on
NPX Install
npx skill4agent add jwmossmoz/agent-skills bigqueryTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →BigQuery
Query Mozilla telemetry data directly using the CLI.
bqPrerequisites
- and
gcloudCLI installed (bq)brew install google-cloud-sdk - Authenticated: with a Mozilla account
gcloud auth login - Billing project set: queries run against a project you have on
bigquery.jobs.create - (Optional but highly recommended) mozdata-claude-plugin — provides Glean Dictionary MCP for metric/ping discovery, making it much easier to find the right tables and columns
Authentication
bash
# Check current account
gcloud config get-value account
# Re-authenticate if needed
gcloud auth login
# List available projects
gcloud projects list --format="table(projectId,name)"
# Set billing project (mozdata is the standard choice)
gcloud config set project mozdataIf queries fail with "Access Denied", the billing project likely lacks permissions. Try .
--project_id=mozdataRunning Queries
bash
# Basic query
bq query --project_id=mozdata --use_legacy_sql=false --format=pretty "SELECT ..."
# Dry run (check cost before executing)
bq query --project_id=mozdata --use_legacy_sql=false --dry_run "SELECT ..."Always use and .
--project_id=mozdata--use_legacy_sql=falseTable Selection
Choose the right table — this is the most important optimization:
| Query Type | Table | Why |
|---|---|---|
| Windows version distribution | | Pre-aggregated, instant |
| DAU/MAU by standard dimensions | | Pre-computed, 100x faster |
| DAU with custom dimensions | | One row per client per day |
| MAU/WAU/retention | | Bit patterns, scan 1 day not 28 |
| Event analysis | | Pre-unnested, clustered |
| Mobile search | | Pre-aggregated |
| Specific Glean metric | | Raw metrics ping |
All tables are in the project. Fully qualify as .
moz-fx-data-shared-prod`moz-fx-data-shared-prod.{dataset}.{table}`Critical Rules
- Always use aggregate tables first — raw tables are 10-100x more expensive
- Always include partition filter — or
submission_dateDATE(submission_timestamp) - Use for development (1% sample) — remove for production
sample_id = 0 - Say "clients" not "users" — BigQuery tracks , not actual humans
client_id - Never join across products by client_id — each product has its own namespace
- Use for events — never raw
events_stream(requires UNNEST)events_v1 - Use for MAU — bit patterns, scan 1 day not 28
baseline_clients_last_seen
References
- — Detailed table schemas and common query patterns
references/tables.md - — Windows, macOS, and Linux version distribution queries with build number, Darwin, and kernel version mappings
references/os-versions.md
Related Skills
- redash — Web UI frontend to BigQuery with visualizations and sharing
- mozdata:query-writing — Guided query writing with Glean Dictionary MCP
- mozdata:probe-discovery — Find Glean metrics and telemetry probes