Install
$ agentstack add skill-mozilla-platform-ops-agent-skills-azure-cost-analysis ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Azure Cost Analysis
Diagnostic toolkit for FXCI Azure CI cost investigations. Covers all 3 CI subscriptions and multiple cost dimensions (pool, SKU, region, service). Designed for both routine cost trend analysis and deep diagnostic investigations.
Knowledge References
Read first: @references/README.md @references/user-inputs.md @references/methodology.md
Multi-dimensional and multi-subscription: @references/cost-dimensions.md @references/multi-subscription.md
API and task correlation: @references/cost-management-api.md @references/taskcluster-task-counting.md
For deep diagnostics: @references/fxci-config-lookup.md @references/taskcluster-service-changes.md @references/azure-spot-pricing.md @references/spot-evictions.md
Standalone SQL queries (copy-paste-ready, one file per query):
queries/azure-task-counts.sqlqueries/spot-evictions.sqlqueries/retry-rate.sqlqueries/schema-sample.sql
Prerequisites
- Azure CLI (
az) authenticated, with read access to the 3 CI subscriptions - Python 3.10+
curl(for Taskcluster API queries)- Redash access (for
taskclusteretl.derived_task_summaryqueries when correlating cost with tasks)
Quick Start
Routine: monthly cost trend
# Monthly costs by worker-pool-id, FXCI Azure DevTest
uv run scripts/query_costs.py --start 2026-01-01 --end 2026-03-31 --granularity monthly
# Compare two periods side by side
uv run scripts/query_costs.py --start 2026-01-01 --end 2026-03-31 --granularity monthly --compare-months
# Different subscription
uv run scripts/query_costs.py --start 2026-03-01 --end 2026-03-31 --subscription a30e97ab-734a-4f3b-a0e4-c51c0bff0701
Diagnostic: investigating a cost increase
- Read methodology.md first — picks daily-cost vs cost/task as your primary signal
- Run
query_costs.pyper subscription for the period of interest, monthly + daily - Check TC Engineering DevTest as a control — if it didn't grow, rule out general Azure pricing event
- Group by Meter in the Azure Portal Cost Analysis to see SKU-level breakdown
- Group by Resource location if you suspect regional spot pricing changes — pair with
azure-spot-pricing.mdfor the Retail Prices API - Pull
derived_task_summarytask data from Redash for the same window — seetaskcluster-task-counting.mdBigQuery section - Verify pool config via
fxci-config-lookup.md— SKU, regions, maxCapacity, initialWeight haven't changed - Check git history of
worker-pools.ymlfor cost-relevant changes during the window - Check TC services repo for cost-relevant changes —
taskcluster-service-changes.md. Bugs in worker-manager/worker-scanner can drive cost in ways fxci-config can't explain. - Check the TC issues tracker for any bug reports filed around the cost-anomaly window — engineering may have observed symptoms before you did
- If pattern is broad cost/task increase across regions/pools — investigate spot eviction (
spot-evictions.md) - If queue starvation observed alongside available capacity — likely a TC service-level state issue; cross-check
taskcluster-service-changes.md
Comparing task counts for a specific push (chunk count investigations)
uv run scripts/count_push_tasks.py --date 2026.03.30
Usage
query_costs.py
Queries the Azure Cost Management REST API for actual costs grouped by worker-pool-id.
| Flag | Description | |------|-------------| | --start | Start date (YYYY-MM-DD), required | | --end | End date (YYYY-MM-DD), required | | --granularity | monthly or daily (default: monthly) | | --compare-months | Show month-over-month deltas and identify top movers | | --top | Number of top pools to display (default: 25) | | --output, -o | Save raw API response as JSON | | --subscription | Override subscription ID (default: FXCI Azure DevTest). Use Trusted FXCI: a30e97ab-734a-4f3b-a0e4-c51c0bff0701, TC Engineering: 8a205152-b25a-417f-a676-80465535a6c9 |
countpushtasks.py
Counts tasks per worker pool and test suite in a mozilla-central push task group. Use this for drilling into a single push (e.g. chunk count investigations). For batch analysis across many pushes/days, use the BigQuery approach in taskcluster-task-counting.md.
| Flag | Description | |------|-------------| | --date | Push date in TC index format: YYYY.MM.DD | | --push-index | Which push on that date to analyze (default: 0 = first) | | --pool-filter | Only show tasks matching this pool substring |
Example Prompts
| Prompt | Action | |--------|--------| | "Why did Azure costs go up this month?" | Read methodology.md. Run query_costs.py --compare-months per subscription. Check TC Engineering as control. Group by Meter to identify SKU drivers. | | "Show me daily costs for March" | query_costs.py --start 2026-03-01 --end 2026-03-31 --granularity daily | | "Did per-task billing rate change?" | Compute volume-weighted cost/task by week using F8s v2 cost ÷ F8s v2 pool tasks. Read methodology.md for the cost/task amortization caveat. | | "Which worker pools are most expensive?" | query_costs.py for the period, sorted by total spend. | | "Are there new worker pools driving cost?" | query_costs.py --compare-months, look at the "new pools" section. | | "Did test task volume increase?" | Pull taskclusteretl.derived_task_summary task counts via Redash for the period. See taskcluster-task-counting.md. | | "Did spot prices change in our regions?" | Query Azure Retail Prices API for current SKU prices and effective dates. See azure-spot-pricing.md. | | "Are spot evictions causing the cost rise?" | Pull eviction events from Azure Activity Log + worker-manager preemption events. See spot-evictions.md. | | "Which test suites are running more on win11-64-24h2?" | count_push_tasks.py --pool-filter win11-64-24h2 for two dates, compare suite counts. | | "Did the VM SKU for this pool change?" | Check worker-pools.yml directly + git log via GitHub API. See fxci-config-lookup.md. | | "Is the cost increase Azure-wide or CI-specific?" | Compare cost growth in TC Engineering DevTest vs CI subs. If TC Engineering is flat, it's CI-specific. |
Workflow: Monthly Cost Review
- Query monthly costs for the period of interest with
--compare-months, all 3 subscriptions - Identify top movers — pools with the largest absolute increase
- Check for new pools — pools that didn't exist in the prior period
- Compute cost/task for stable-volume pools to detect rate vs volume changes
- Correlate with task volume — use
count_push_tasks.pyfor spot checks, BigQuery for batch - Drill into test suites — if a pool's cost grew, check which test suites gained the most tasks
- Save report to
~/moz_artifacts/with findings
Workflow: Diagnostic Investigation
For deeper cost investigations (cost rising more than volume can explain):
- Establish a clean baseline (a normal pre-anomaly month — see
methodology.md) - Compute volume-weighted daily cost/task; find the inflection date
- Rule out, with evidence: general Azure pricing event (TC Engineering control), single-region spot spike, OS/SKU migration, regional traffic shifts, volume alone
- Check fxci-config git history for changes in the inflection window
- Check taskcluster/taskcluster git history for service-level changes (worker-manager, worker-scanner) in the window
- Check the taskcluster/taskcluster issues tracker for bug reports filed around the window
- Pull spot price effective dates from Retail Prices API
- If pattern is broad cost/task increase across pools/regions: pull spot eviction telemetry from
fxci.task_runs - If queue starvation observed alongside available capacity: investigate TC service state-tracking bugs
- If structural changes (maxCapacity, initialWeight) candidate: design a rollback experiment
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: mozilla-platform-ops
- Source: mozilla-platform-ops/agent-skills
- License: MPL-2.0
- Homepage: https://agentskills.io/home
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.