Skip to content

Cost Trends

After every scan, CloudSlash appends a cost record to ~/.cloudslash/trend.jsonl. Run cs trend to see how your savings are moving over time.

How It Works

Each scan appends a data point to ~/.cloudslash/trend.jsonl:

{"ts":"2026-04-25T03:00:00Z","nodes":10420,"waste":847,"total_cost":142300,"savings":14230}

This lightweight append-only format grows at roughly 1KB per scan.

# Default: last 30 days
cs trend

# Longer window
cs trend --days=90

Terminal Output

COST TREND
  Last 30 days (47 data points)

  Current waste          847 nodes
  Current savings        $14,230/mo
  Savings trend          +$2,100/mo ↑
  Waste trend            -15 nodes ↓

  Waste over time:
  ▅▆▇▇█▇▆▅▅▄▃▃▂▂▁▁▁▁▁▁▂▂▃▃▃▂▂▁▁▁
  Apr 01                        Apr 25

Web Dashboard

The same trend data is available via the daemon API:

curl http://localhost:8080/api/v1/trend?days=30

The web dashboard at http://localhost:8080 renders this as an interactive chart.

Snapshot History

For deeper infrastructure comparison, snapshots are saved to ~/.cloudslash/snapshots/:

# List all snapshots
cs diff --list

# Compare two specific dates
cs diff --from=2026-04-18 --to=2026-04-25

Retention

Snapshots are retained for 90 days by default. Configure in config.yaml:

snapshot_retention_days: 180

In CI/CD

Track cost trends across deployments:

cs scan                  # Scans all cloud providers detected from your credentials
cs trend --days=7

Use the JSON report for alerting:

cs report --format=json | jq 'if .projected_savings > 10000 then "ALERT" else "OK" end'