Skip to content
Skillpedia
Deploy & cloud (DevOps)9.5k Β· #12229

controlling-costs

What it does

This skill looks at how Axiom is queried to find data that nobody uses, then sets up dashboards and monitors to track ingest spend. It is for teams trying to lower their logging bill.

When to use it

  • βœ“When you are asked to reduce Axiom costs.
  • βœ“When you want to find columns or field values that nobody queries.
  • βœ“When you want to track how much data you are ingesting over time.

Skill link

https://github.com/openclaw/clawhub/blob/main/.agents/skills/controlling-costs/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/openclaw/clawhub/blob/main/.agents/skills/controlling-costs/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œFind the unused fields in our Axiom data and show me where we can cut ingest.”

5 new skills a week. 1 minute to read.

How it works

The skill reads Axiom's audit data to see which fields are queried, then compares that with what is stored. It then builds cost dashboards and monitors. It asks you to confirm the audit dataset name and your contract limit before it starts.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Axiom Cost Control

Dashboards, monitors, and waste identification for Axiom usage optimization.

Before You Start

  1. Load required skills:

    skill: axiom-sre
    skill: building-dashboards
    

    Building-dashboards provides: dashboard-list, dashboard-get, dashboard-create, dashboard-update, dashboard-delete

  2. Find the audit dataset. Try axiom-audit first:

    ['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 usageCalculated events β†’ wrong dataset, ask user
  3. Verify axiom-history access (required for Phase 4):

    ['axiom-history'] | where _time > ago(1h) | take 1
    

    If not found, Phase 4 optimization will not work.

  4. Confirm with user:

    • Deployment name?
    • Audit dataset name?
    • Contract limit in TB/day? (required for Phase 3 monitors)
  5. Replace <deployment> and <audit-dataset> in all commands below.

Tips:

  • Run any script with -h for full usage
  • Do NOT pipe script output to head or tail β€” causes SIGPIPE errors
  • Requires jq for JSON parsing
  • Use axiom-sre's axiom-query for 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.


Phase 1: Discovery

scripts/baseline-stats -d <deployment> -a <audit-dataset>

Captures daily ingest stats and produces the Analysis Queue (needed for Phase 4).


Phase 2: Dashboard

scripts/deploy-dashboard -d <deployment> -a <audit-dataset>

Creates dashboard with: ingest trends, burn rate, projections, waste candidates, top users. See reference/dashboard-panels.md for details.


Phase 3: Monitors

Contract is required. You must have the contract limit from preflight step 4.

Step 1: List available notifiers

scripts/list-notifiers -d <deployment>

Present the list to the user and ask which notifier they want for cost alerts. If they don't want notifications, proceed without -n.

Step 2: Create monitors

scripts/create-monitors -d <deployment> -a <audit-dataset> -c <contract_tb> [-n <notifier_id>]

Creates 3 monitors:

  1. Total Ingest Guard β€” alerts when daily ingest >1.2x contract OR 7-day avg grows >15% vs baseline
  2. Per-Dataset Spike β€” robust z-score detection, alerts per dataset with attribution
  3. Query Cost Spike β€” hardened z-score with 30d baseline, 5d exclusion gap, persistence-based gating (median_z > 3, p25_z > 2.5)

The spike monitors use notifyByGroup: true so each dataset triggers a separate alert.

See reference/monitor-strategy.md for threshold derivation.


Phase 4: Optimization

Get the Analysis Queue

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.

Analyze datasets in order

Work top-to-bottom. For each dataset:

Step 1: Column analysis

scripts/analyze-query-coverage -d <deployment> -D <dataset> -a <audit-dataset>

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):

scripts/analyze-query-coverage -d <deployment> -D <dataset> -a <audit-dataset> -f <field>

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,

FAQ

Does it need the audit data?

Yes. It looks for an audit dataset in Axiom and asks you to name it if it is not found.

Which phases run?

It runs only the phases that match your request, such as finding unused data or setting up monitors.

Why does it ask for a contract limit?

The cost monitors compare usage against your contract limit, which is set in terabytes per day.

Details

Original description by the author

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.

repo: openclaw/clawhub

Popularity

GitHub stars
9.5k
Ranking position
#12229
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills