npx skills add ...
npx skills add axiomhq/skills --skill controlling-costs
npx skills add axiomhq/skills --skill controlling-costs
Analyzes Axiom query patterns to find unused data, then builds dashboards and monitors for cost optimization. Use when asked to reduce Axiom costs, find unused columns or field values, identify data waste, or track ingest spend.
Dashboards, monitors, and waste identification for Axiom usage optimization.
Load required skills:
Building-dashboards provides: dashboard-list, dashboard-get, dashboard-create, dashboard-update, dashboard-delete
Find the audit dataset. Try axiom-audit first:
axiom-audit-logs-view, audit-logsusageCalculated events → wrong dataset, ask userVerify axiom-history access (required for Phase 4):
If not found, Phase 4 optimization will not work.
Confirm with user:
Replace <deployment> and <audit-dataset> in all commands below.
Tips:
-h for full usagehead or tail — causes SIGPIPE errorsjq for JSON parsingaxiom-query for ad-hoc APL, not direct CLI| User request | Run these phases |
|---|---|
| "reduce costs" / "find waste" | 0 → 1 → 4 |
| "set up cost control" | 0 → 1 → 2 → 3 |
| "deploy dashboard" | 0 → 2 |
| "create monitors" | 0 → 3 |
| "check for drift" | 0 only |
If found, fetch with dashboard-get and compare to templates/dashboard.json for drift.
Captures daily ingest stats and produces the Analysis Queue (needed for Phase 4).
Creates dashboard with: ingest trends, burn rate, projections, waste candidates, top users. See reference/dashboard-panels.md for details.
Contract is required. You must have the contract limit from preflight step 4.
Present the list to the user and ask which notifier they want for cost alerts.
If they don't want notifications, proceed without -n.
Creates 3 monitors:
The spike monitors use notifyByGroup: true so each dataset triggers a separate alert.
See reference/monitor-strategy.md for threshold derivation.
Run scripts/baseline-stats if not already done. It outputs a prioritized list:
| Priority | Meaning |
|---|---|
| P0⛔ | Top 3 by ingest OR >10% of total — MANDATORY |
| P1 | Never queried — strong drop candidate |
| P2 | Rarely queried (Work/GB < 100) — likely waste |
Work/GB = query cost (GB·ms) / ingest (GB). Lower = less value from data.
Work top-to-bottom. For each dataset:
Step 1: Column analysis
If 0 queries → recommend DROP, move to next.
Step 2: Field value analysis
Pick a field from suggested list (usually app, service, or kubernetes.labels.app):
Note values with high volume but never queried (⚠️ markers).
Step 3: Handle empty values
If (empty) has >5% volume, you MUST drill down with alternative field (e.g., kubernetes.namespace_name).
Step 4: Record recommendation
For each dataset, note: name, ingest volume, Work/GB, top unqueried values, action (DROP/SAMPLE/KEEP), estimated savings.
All P0⛔ and P1 datasets analyzed. Then compile report using reference/analysis-report-template.md.
Note: Running create-monitors twice creates duplicates. Delete existing monitors first if re-deploying.
| Field | Description |
|---|---|
action | usageCalculated or runAPLQueryCost |
properties.hourly_ingest_bytes | Hourly ingest in bytes |
properties.hourly_billable_query_gbms | Hourly query cost |
properties.dataset | Dataset name |
resource.id | Org ID |
actor.email | User email |
| Dataset type | Primary field | Alternatives |
|---|---|---|
| Kubernetes logs | kubernetes.labels.app | kubernetes.namespace_name, kubernetes.container_name |
| Application logs | app or service | level, logger, component |
| Infrastructure | host | region, instance |
| Traces | service.name | span.kind, http.route |
| Contract | TB/day | GB/month |
|---|---|---|
| 5 PB/month | 167 | 5,000,000 |
| 10 PB/month | 333 | 10,000,000 |
| 15 PB/month | 500 | 15,000,000 |
| Signal | Action |
|---|---|
| Work/GB = 0 | Drop or stop ingesting |
| High-volume unqueried values | Sample or reduce log level |
| Empty values from system namespaces | Filter at ingest or accept |
| WoW spike | Check recent deploys |