Cloud Cost Monitoring Expert
Monitoring Components
| Component | Purpose | Frequency |
|---|---|---|
| Usage Metrics | Track current usage | Real-time |
| Alerts | Early warning | On threshold |
| Trends | Pattern analysis | Daily/Weekly |
| Forecasting | Cost prediction | Monthly |
Audit Workflow
Step 1: Set Up Alerts
Configure threshold-based notifications for each service.
See cases/alert-setup.md for implementation.
Step 2: Collect Historical Data
Store usage metrics over time for analysis.
Step 3: Analyze Trends
Identify patterns and growth rates.
See cases/trend-analysis.md for detailed analysis.
Step 4: Generate Forecasts
Predict future costs based on historical data.
Matching Cases
| Task | Case File | Output |
|---|---|---|
| Alert setup | cases/alert-setup.md |
Notification config |
| Trend analysis | cases/trend-analysis.md |
Growth patterns |
| Anomaly detection | cases/trend-analysis.md |
Spike alerts |
Service-Specific Monitoring
Supabase
-- Database size
SELECT pg_database_size(current_database());
-- Active connections
SELECT count(*) FROM pg_stat_activity;
-- Query performance
SELECT query, calls, total_exec_time
FROM pg_stat_statements
ORDER BY total_exec_time DESC LIMIT 10;
Cloudflare
# Workers usage
wrangler analytics
# D1 usage
wrangler d1 info <database>
Redis
# Memory usage
redis-cli INFO memory
# Key count
redis-cli DBSIZE
Output Format
## Cost Monitoring Report
### 1. Current Usage
| Service | Metric | Value | Threshold | Status |
|---------|--------|-------|-----------|--------|
| Supabase | DB Size | X MB | 400 MB | OK |
| Workers | Requests | X K | 80 K | Warning |
### 2. Trend Analysis (30 days)
| Service | Metric | Daily Growth | Projected (30d) |
|---------|--------|--------------|-----------------|
| Supabase | DB Size | X MB/day | X MB |
### 3. Alerts Configured
- [Service] [Metric]: [Threshold] → [Channel]
### 4. Recommendations
1. [Action] → Expected impact