Conversation
Per-task and per-push cost attribution for FXCI tasks across both clouds. Implements the RELOPS-2330 reference query as a five-stage pipeline: three BigQuery extracts (across two gcloud accounts, since human IAM is split between moz-fx-data-shared-prod and moz-fx-data-billing-prod-9147) plus a local DuckDB cross-cloud join. The skill defaults to a `>=` filter with `LEAST(1.0, ratio)` cap on the attribution formula. This deviates from the strict `>` in the original RELOPS-2330 query: empirically it shrinks the unattributed Azure spend gap from ~27% to ~12% by including single-task VMs (which are otherwise excluded entirely). methodology.md documents the bucket decomposition and how to flip back to strict `>` if exact ticket reproduction is needed. Cross-platform: install commands for macOS (Homebrew) and Windows (Chocolatey) for both `gcloudsdk` and `duckdb`. PowerShell command forms documented alongside bash where syntax diverges. Distinct from the existing `azure-cost-analysis` skill, which queries the Azure Cost Management REST API for pool/SKU rollups. This skill joins BigQuery billing exports against `fxci_derived.task_runs_v1` and `tasks_v2` for per-task granularity. Retires when RELOPS-2330's bigquery-etl pipeline lands and `fxci_derived.task_run_costs_v1` covers Azure VMs end-to-end.
The previous version of methodology.md only treated the uptime
approximation. Empirical decomposition of the Azure billing export shows
the `virtualMachines/vm-*` filter captures only 87.5% of total FXCI
Azure spend in a representative window. The remaining 12.5% is:
- 4.7% non-`vm-*` VMs (management, image-build, persistent
scriptworkers — correctly excluded from per-task attribution since
they're not task workers)
- 4.1% Virtual Network (NICs, public IPs)
- 2.6% Storage (managed disks attached to VMs)
- 1.1% Network egress
- 0.0% misc (Automation, Key Vault)
Network, storage, and egress are real per-task costs in spirit but the
billing export attributes them per-resource, not per-VM. RELOPS-2330
doesn't cover this either.
Also documents the day-boundary effect (1-2% of tasks have odd ratios
when started near midnight UTC) and the marginal-vs-attributed
distinction (don't read per-tree numbers as "what we would save by
killing this tree" since pool overhead is largely fixed).
Per-tree totals from the skill should be read as VM-compute,
attributable share, +/-10-15%, with an additional ~12% systematic
understatement of total Azure cost if quoting full Azure spend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New skill that answers per-task and per-push FXCI cost questions across both clouds while the RELOPS-2330 production pipeline is still pending.
The workflow now uses a six-stage pipeline:
task_run_costs_v1pathvm-*task runs from FXCI task tablestaskclusteretl.worker_metricsThis is distinct from
azure-cost-analysis, which is for pool/SKU-level Azure Cost Management rollups. This skill is for task, push, tree, kind, and label attribution.Worker Metrics Update
Azure uptime now comes from generic-worker
WORKER_METRICSlifecycle events intaskclusteretl.worker_metrics, rather than a first-task/last-task approximation fromtask_runs_v1.That gives a better denominator without needing Azure Monitor. The docs still call out the remaining limitation: worker metrics are Taskcluster-side data and do not fully capture Azure VM lifetime after the worker has stopped but before the VM is deleted.
Public Data Cleanup
Removed the sample cost breakdowns and dollar figures from the public PR text and methodology docs. The skill documents the workflow and caveats without publishing internal cost totals.
Why Two Gcloud Accounts
Human IAM is split between
moz-fx-data-shared-prodandmoz-fx-data-billing-prod-9147. No single human principal can read both billing datasets, so the workflow runs the BigQuery halves separately and joins locally with DuckDB.Structure
Retires When
Once the RELOPS-2330 bigquery-etl pipeline lands and
fxci_derived.task_run_costs_v1covers Azure VMs end-to-end, most users can query that table directly. Until then, this skill is the local workaround.Test Plan
taskclusteretl.worker_metricshas Azure Windows generic-worker lifecycle eventstask_runs_v1@references/*andqueries/*links updated for the six-stage workflow