Cost Management & FinOps
Controlinfra provides cost visibility across your cloud infrastructure — tracking drift cost impact, orphan resource waste, and cost trends over time.
Overview
Cost data is collected from two sources:
- Drift Scans — Each drift includes a cost estimation showing the financial impact of the change (added/removed resources, pricing delta)
- Cloud Discovery — Orphan resources are priced using AWS, Azure, and GCP pricing APIs to show monthly waste
These are unified on the main dashboard as total infrastructure cost impact.
Cost Dashboard
The main dashboard (/dashboard) shows a Cost Overview card with:
- Drift cost impact — Net monthly cost change from detected drifts
- Orphan resource cost — Total monthly cost of unmanaged resources
- Combined waste — Total infrastructure inefficiency
- Mini trend — Sparkline showing cost direction over recent scans
Cost Trend Chart
The Cost Trend dashboard card shows a stacked area chart:
- Drift cost impact over time (30/60/90 days)
- Orphan cost over time
- Combined trend line
Data comes from cost snapshots — point-in-time records saved after each scan/discovery.
Cost Snapshots
A CostSnapshot record is created automatically after:
- Each repository scan completion
- Each cloud discovery scan completion
Snapshot Fields
| Field | Description |
|---|---|
totalMonthlyCost | Total estimated monthly cost |
orphanMonthlyCost | Monthly cost of orphan resources |
driftCostImpact.added | Cost of resources added by drift |
driftCostImpact.removed | Cost of resources removed by drift |
driftCostImpact.net | Net drift cost change |
byProvider | Cost breakdown by cloud provider |
resourceCount | Number of resources in snapshot |
API
GET /api/cost-snapshots?range=30dReturns snapshots for the specified time range. Used by the Cost Trend chart.
Cost Alerts
Configure budget thresholds in Organization Settings:
| Setting | Description |
|---|---|
monthlyBudget | Alert when total monthly cost exceeds this amount |
orphanThreshold | Alert when orphan cost exceeds this amount |
driftCostThreshold | Alert when a single drift costs more than this |
When a threshold is exceeded after a scan, notifications are sent to all org admins via configured channels.
Notification Types
cost_budget_exceeded— Monthly budget exceededcost_threshold_alert— Individual threshold breached
Cost Estimation Engine
AWS Pricing
Resources are priced using the AWS Pricing API:
- EC2 instances — On-demand pricing by instance type and region
- RDS instances — By engine, instance class, and multi-AZ
- S3 buckets — Estimated by storage class and size
- Lambda functions — By memory, invocations, and duration
- EBS volumes — By type, size, and IOPS
- Load balancers — By type (ALB/NLB/CLB)
Azure Pricing
Azure resources are priced using the Azure Retail Prices API:
- Virtual Machines — By VM size and region
- SQL Databases — By tier and DTU/vCore
- Storage Accounts — By redundancy and access tier
- AKS Clusters — By node pool size
- Key Vaults — By operations and secrets
GCP Pricing
GCP resources are priced using the gcpPricing.js engine:
- Compute Instances — By machine type and zone
- Cloud SQL — By tier, storage, and HA configuration
- GKE Clusters — By node pool machine type and count
- Cloud Storage — By storage class and location
- Cloud Run / Cloud Functions — By vCPU, memory, and invocations
- Memorystore Redis — By tier and capacity
- Pub/Sub — By message volume
Right-sizing recommendations are available across all three cloud providers, highlighting over-provisioned resources and suggesting optimal instance types or configurations.
Per-Drift Cost Impact
Each drift in a scan includes:
costEstimation.before— Monthly cost before the changecostEstimation.after— Monthly cost after the changecostEstimation.delta— Cost difference
Visible in the scan detail Cost tab with before/after comparison per resource.
Orphan Cost Tracking
Cloud Discovery identifies orphan resources (not in Terraform state) and estimates their monthly cost:
- Displayed on the Discovery Dashboard
- Broken down by service and provider
- Each orphan resource card shows its estimated monthly cost
- Total orphan cost shown in dashboard summary
Plan Availability
| Feature | Free | Pro | Team | Enterprise |
|---|---|---|---|---|
| Per-drift cost estimation | - | Yes | Yes | Yes |
| Orphan cost tracking | - | Yes | Yes | Yes |
| Cost snapshots & trends | - | Yes | Yes | Yes |
| Cost alerts & budgets | - | - | Yes | Yes |