Control costs skill
This page explains how to use the Control costs skill to give AI coding agents the ability to analyze usage and optimize Axiom costs.
The Control costs skill helps AI agents optimize Axiom usage and reduce costs:
- Waste review: Find columns and datasets with little or no query activity during the analysis period
- Query analysis: Analyze query patterns to identify optimization opportunities
- Dashboard management: Create or update cost dashboards with ingest trends, burn rate, and projections
- Cost monitors: Track total ingest and detect spikes in dataset ingest and query costs
- Analysis workflow: Systematic approach to prioritize and analyze datasets by impact
Prerequisites
Set up the following:
- Create an Axiom account.
- Connect Axiom MCP Server in your AI client and sign in to your Axiom organization.
- Grant query access to an audit dataset or a view containing usage events. To check which data is queried, also grant access to query history, typically in
axiom-history. Query history is optional for dashboard and monitor setup. - To create or update dashboards and monitors, grant permission to manage those resources.
- Install Python 3.10 or later, Bash, and
jqto run the local scripts.
Install Axiom Skills
Follow the Axiom Skills installation instructions. If you install standalone skills, connect Axiom MCP separately.
The skill uses MCP to find datasets, query usage, and manage dashboards, monitors, and notifiers. If MCP is disconnected or authentication fails, the agent asks you to connect or sign in before continuing. No SRE configuration or separate API-token file is required.
Local scripts analyze the query results and prepare dashboard and monitor JSON. All access to Axiom goes through MCP.
Use Control costs skill
The Control costs skill activates automatically when you ask your AI agent to:
- Reduce Axiom costs or find waste
- Set up cost control dashboards and monitors
- Analyze query coverage and potential waste
- Track ingest spend and burn rate
Example prompts:
- "Help reduce Axiom costs"
- "Which columns haven't been queried in the last 30 days?"
- "Set up cost control monitoring for the organization"
- "Which datasets haven't been queried in the last 30 days?"
Cost control workflow
The skill follows these steps based on your request:
| Phase | Description |
|---|---|
| Discovery and baseline | Collect usage through MCP and rank datasets by ingest volume and query activity |
| Dashboard | Create or update a cost control dashboard through MCP |
| Monitors | Create or tune the three cost monitors through MCP |
| Optimization | Review query activity and report potential savings, supporting evidence, and gaps in the analysis |
Cost monitors
The skill validates the queries for these three monitors before saving them through MCP:
| Monitor | Purpose |
|---|---|
| Total ingest guard | Detect ingest above 120% of the supplied daily contract allowance or sustained growth |
| Per-dataset spike | Identify datasets with significant ingest increases compared with their historical baseline |
| Query cost spike | Identify datasets with sustained query cost increases compared with their historical baseline |
Provide your daily ingest allowance for the total ingest guard and choose where to send alerts. When updating a monitor, the skill keeps its existing notification routing. A saved or running monitor doesn't confirm that a notification was delivered.
Review potential waste
Review the findings before changing what you ingest or retain. Finding no queries during the analysis period doesn't prove that the data is unused. Check for missing history, queries the analysis didn't fully interpret, sampling limits, and dependencies outside that period.
An analysis request produces findings and proposed actions. It doesn't change ingestion, remove fields, or delete datasets.