Skip to content

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:

  1. Drift Scans — Each drift includes a cost estimation showing the financial impact of the change (added/removed resources, pricing delta)
  2. 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

FieldDescription
totalMonthlyCostTotal estimated monthly cost
orphanMonthlyCostMonthly cost of orphan resources
driftCostImpact.addedCost of resources added by drift
driftCostImpact.removedCost of resources removed by drift
driftCostImpact.netNet drift cost change
byProviderCost breakdown by cloud provider
resourceCountNumber of resources in snapshot

API

GET /api/cost-snapshots?range=30d

Returns snapshots for the specified time range. Used by the Cost Trend chart.


Cost Alerts

Configure budget thresholds in Organization Settings:

SettingDescription
monthlyBudgetAlert when total monthly cost exceeds this amount
orphanThresholdAlert when orphan cost exceeds this amount
driftCostThresholdAlert 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 exceeded
  • cost_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 change
  • costEstimation.after — Monthly cost after the change
  • costEstimation.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

FeatureFreeProTeamEnterprise
Per-drift cost estimation-YesYesYes
Orphan cost tracking-YesYesYes
Cost snapshots & trends-YesYesYes
Cost alerts & budgets--YesYes