Stage 4 · Provision
Observability-Driven Design
Cost as a Signal
Tracking cloud spend per service, per request, and per team to make cost a first-class metric.
Why Cost Observability?
Cloud costs can spiral without visibility. A single misconfigured service running oversized instances can cost thousands per month. Cost observability gives you the same level of insight into spending that performance observability gives you into latency and errors.
Cost Metrics
- Cost per request — Total cloud cost divided by total requests.
- Cost per user — Total cost divided by active users.
- Cost per transaction — Cost of a specific business transaction end-to-end.
- Cost per GB transferred — Egress cost tracking.
- Cost trend — Month-over-month cost growth rate.
Cost Allocation
Tag every cloud resource with the owning team, service, and environment. This enables chargeback (billing teams for their usage) and showback (showing teams their cost without billing). Without tags, cost is an undifferentiated blob.
tags:
service: payment-api
team: payments
environment: production
cost-center: engineering
managed-by: terraform
on-call: payments-oncallEnforce tag policies at the infrastructure level. Use Terraform or CloudFormation to apply tags to every resource. Reject untagged resources.
Cost Alerting
Set up budget alerts at 50%, 80%, and 100% of expected monthly spend. Alert on unusual cost spikes — a 2x increase in daily cost within 24 hours indicates a problem. Cost alerts are as important as performance alerts.
FinOps Practices
- Monthly cost reviews — Review cloud spend with every team.
- Right-sizing recommendations — Use AWS Compute Optimizer or GCP Recommender.
- Reserved capacity — Purchase reserved instances for predictable workloads.
- Spot instances — Use spot/preemptible instances for fault-tolerant workloads.
- Automated cleanup — Delete unused resources, snapshots, and volumes.
Cost Optimization Strategies
| Strategy | Savings | Effort |
|---|---|---|
| Right-sizing | 20-40% | Low |
| Reserved instances | 30-60% | Low |
| Spot instances | 60-90% | Medium |
| Auto-scaling | 20-50% | Medium |
| Graviton/ARM | 20% | Low |
Cost efficiency is a product feature. Lower costs mean lower prices, higher margins, or more investment in features. Treat cost optimization with the same rigor as performance optimization.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.