Cost & Usage Analytics
The Cost & Usage module is Quper's core FinOps intelligence layer. It is powered by the FOCUS v1.2 (FinOps Open Cost and Usage Specification) data model and surfaces seven distinct analytical capabilities — from unit economics to statistical anomaly detection — through a set of interconnected dashboards.
Data foundation
qup_fact_cost_usage_daily), which is pre-aggregated daily from the raw FOCUS silver table. This means all views reflect amortized effective cost by default, with list cost and billed cost available as alternative cost bases.Module Structure
/cost-and-usage
├── / → Overview — KPI cards + spend trend
├── /unit-cost
│ ├── /summary → Unit cost + efficiency by dimension
│ └── /timeseries → Daily unit cost trend with lag growth
├── /period-compare → Side-by-side window comparison
├── /optimization
│ ├── /indicators → Idle, overprovision, concentration
│ ├── /baseline → Z-score anomaly detection
│ ├── /stability → Volatility (CV) classification
│ └── /advanced → Idle days, zero-query, off-hours, underutil
└── /config → Threshold configuration panelOverview Dashboard
The landing page aggregates the gold table into four KPI cards and a 30-day spend sparkline:
- Total effective cost — SUM(effective_cost) for the current billing period, displayed with period-over-period delta
- List cost savings — 1 − (effective_cost ÷ list_cost), showing the aggregate discount rate vs. public pricing
- Idle spend — SUM(idle_cost) and its percentage of total effective cost
- Tag coverage — 1 − (required_tag_missing_flag rows ÷ total rows), a FOCUS-derived tag governance signal
Unit Cost Analysis
Summary View
Computes unit cost and efficiency for any grouping dimension over two configurable time windows. The result is a ranked table showing each group with its current and previous unit cost, growth percentages, and an efficiency ratio.
The efficiency ratio answers: is cost growing proportionally to usage, faster, or slower? A ratio above 1.0 means cost grew faster than usage (spending more per unit); below 1.0 means usage grew faster (better economies of scale). The value is clamped to ±10 to suppress extreme readings from near-zero denominators.
Grouping dimensions available: service, region, resource, billing_account, workload, cost_type, or any tag:<key> value. All are direct FOCUS v1.2 columns or derived from them.
Time-Series View
Renders daily unit cost as a line chart using Recharts, with a secondary line for the day-over-day growth rate. Data is computed using a SQL LAG window function partitioned by group key — a single query pass produces all daily deltas without self-joins.
Period Comparison
Side-by-side bar chart comparing two time windows of equal length. Two modes are supported:
- Previous period — The N days immediately before the current window. Best for detecting week-over-week or sprint-over-sprint drift.
- Month-to-date (MTD) — The same calendar day span in the prior month. Best for budget-cycle comparisons.
The comparison uses a FULL OUTER JOIN so resources present in only one period are still surfaced — newly provisioned workloads appear with a 100 % increase; decommissioned ones appear with a 100 % decrease. The chart uses Recharts BarChart with negative values to show deltas inline.
Optimization Indicators
Indicators Dashboard
Three optimization signals displayed as gauge cards, each with a current value, a configurable threshold, and a status badge:
| Indicator | What it measures | Default threshold |
|---|---|---|
| Idle Spend % | SUM(idle_cost) ÷ SUM(effective_cost) × 100, where idle_cost is pre-flagged in the gold table by the enrichment job | Alert when > 5 % |
| Overprovisioning | Resources where avg_cpu < 20 %, avg_queue_time < 5 s, AND avg_latency_p95 < 100 ms simultaneously | All three conditions must hold |
| Usage Concentration | Top-3 groups' share of total usage_quantity. High concentration = single-team risk | Flag when top-3 > 80 % |
Baseline Anomaly Detection
A line chart overlaying daily spend against a 14-day rolling baseline band (mean ± 1 standard deviation). Days where the Z-score exceeds the configured threshold are highlighted with a red point marker.
The baseline window spans D-16 to D-3 — the 14 days ending two days before the current day. This prevents today's spike from influencing its own reference. A minimum of 7 data points are required before any anomaly flag is shown.
Stability (Volatility) View
Each resource or service group is classified into one of four stability buckets based on the 14-day rolling Coefficient of Variation (CV = stddev ÷ mean) of daily spend. The view renders a scatter plot of CV vs. cost magnitude, allowing teams to identify high-cost, high-volatility workloads as the primary commitment candidates.
| Stability | CV | Commitment recommendation |
|---|---|---|
| Stable | < 0.15 | 3-year Reserved Instance or Savings Plan |
| Moderate | 0.15 – 0.40 | 1-year commitment with flex |
| Volatile | 0.40 – 0.75 | On-demand or Compute Savings Plan |
| Highly Volatile | ≥ 0.75 | No commitment — investigate scheduling |
Advanced Optimization
Four deeper waste-detection views, each addressing a pattern that the summary indicators cannot capture alone:
- Idle Days — Calendar heatmap of days where
idle_flag = TRUEper resource, plus total idle_cost attributable to those days - Zero-Query Days — Redshift-specific: days where compute cost was charged but no queries were executed (query_count = 0 in the gold table)
- Off-Hours Spend — Donut chart of cost incurred outside business hours, computed from the silver table's hourly charge_period_start. Business hours are configurable per tenant (default 09:00 – 18:00 UTC)
- Underutilised Clusters — Table of resources where measured CPU was above zero but below 30 % (default threshold), distinguishing under-use from true idle
Threshold Configuration
The /config route renders a form backed by the qup_config_idle_thresholds table. All nine threshold values — idle CPU, idle query count, overprovisioning CPU/queue/latency, concentration top-N, business hours start/end, and underutilisation CPU — can be updated at runtime. Changes propagate to all subsequent queries without a service restart.
API Reference