bigquery

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

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "bigquery" with this command: npx skills add jwmossmoz/agent-skills/jwmossmoz-agent-skills-bigquery

BigQuery

Query Mozilla telemetry data directly using the bq CLI.

Prerequisites

  • gcloud and bq CLI installed (brew install google-cloud-sdk)
  • Authenticated: gcloud auth login with a Mozilla account
  • Billing project set: queries run against a project you have bigquery.jobs.create on
  • (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

# 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 mozdata

If queries fail with "Access Denied", the billing project likely lacks permissions. Try --project_id=mozdata.

Running Queries

# 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 --project_id=mozdata and --use_legacy_sql=false.

Table Selection

Choose the right table — this is the most important optimization:

Query TypeTableWhy
Windows version distributiontelemetry.windows_10_aggregatePre-aggregated, instant
DAU/MAU by standard dimensionsfirefox_desktop_derived.active_users_aggregates_v3Pre-computed, 100x faster
DAU with custom dimensionsfirefox_desktop.baseline_clients_dailyOne row per client per day
MAU/WAU/retentionfirefox_desktop.baseline_clients_last_seenBit patterns, scan 1 day not 28
Event analysisfirefox_desktop.events_streamPre-unnested, clustered
Mobile searchsearch.mobile_search_clients_daily_v2Pre-aggregated
Specific Glean metricfirefox_desktop.metricsRaw metrics ping

All tables are in the moz-fx-data-shared-prod project. Fully qualify as `moz-fx-data-shared-prod.{dataset}.{table}`.

Critical Rules

  • Always use aggregate tables first — raw tables are 10-100x more expensive
  • Always include partition filtersubmission_date or DATE(submission_timestamp)
  • Use sample_id = 0 for development (1% sample) — remove for production
  • Say "clients" not "users" — BigQuery tracks client_id, not actual humans
  • Never join across products by client_id — each product has its own namespace
  • Use events_stream for events — never raw events_v1 (requires UNNEST)
  • Use baseline_clients_last_seen for MAU — bit patterns, scan 1 day not 28

References

  • references/tables.md — Detailed table schemas and common query patterns
  • references/os-versions.md — Windows, macOS, and Linux version distribution queries with build number, Darwin, and kernel version mappings

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

redash

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

os-integrations

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

worker-image-investigation

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

bugzilla

No summary provided by upstream source.

Repository SourceNeeds Review