
Controlling Costs
Analyzes Axiom query patterns to find unused data, then builds dashboards and monitors...
Install
npx skills add openclaw/clawhub --skill controlling-costs -g -a claude-code -y- Repository
- openclaw/clawhub9.5k
- Category
- Engineering
- Updated
- 3d ago
- License
- MIT
- Context cost
- Mediumabout 1,618 tokens
- Runs scripts
- Yes, review before use
What it does
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.
Axiom Cost Control
Dashboards, monitors, and waste identification for Axiom usage optimization.
Before You Start
-
Load required skills:
skill: axiom-sre skill: building-dashboardsBuilding-dashboards provides:
dashboard-list,dashboard-get,dashboard-create,dashboard-update,dashboard-delete -
Find the audit dataset. Try
axiom-auditfirst:['axiom-audit'] | where _time > ago(1h) | summarize count() by action | where action in ('usageCalculated', 'runAPLQueryCost')- If not found → ask user. Common names:
axiom-audit-logs-view,audit-logs - If found but no
usageCalculatedevents → wrong dataset, ask user
- If not found → ask user. Common names:
-
Verify
axiom-historyaccess (required for Phase 4):['axiom-history'] | where _time > ago(1h) | take 1If not found, Phase 4 optimization will not work.
-
Confirm with user:
- Deployment name?
- Audit dataset name?
- Contract limit in TB/day? (required for Phase 3 monitors)
-
Replace
<deployment>and<audit-dataset>in all commands below.
Tips:
- Run any script with
-hfor full usage - Do NOT pipe script output to
headortail, causes SIGPIPE errors - Requires
jqfor JSON parsing - Use axiom-sre's
axiom-queryfor ad-hoc APL, not direct CLI
Which Phases to Run
| 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 |
Phase 0: Check Existing Setup
# Existing dashboard?
dashboard-list <deployment> | grep -i cost
# Existing monitors?
axiom-api <deployment> GET "/v2/monitors" | jq -r '.[] | select(.name | startswith("Cost Control:")) | "\(.id)\t\(.name)"'
If found, fetch with dashboard-get and compare to templates/dashboard.json for drift.
