Segmented Metrics: Why One Monitor Per Dimension Beats One Monitor Total
An aggregate is a great summary and a terrible alert. Here is the case for putting the alert where the problem actually is.
The aggregate-smoothing problem
The most common pattern that quietly burns a data team goes like this. You set up a monitor on a top-line metric. Revenue per day, sign-ups per hour, p95 latency across the fleet. The metric looks healthy for weeks. Then on a Tuesday, your CEO asks why EMEA bookings are flat and you realize the metric has been hiding a regional collapse for nine days.
The math is simple. AMER does 60% of revenue, EMEA does 25%, APAC does 15%. If EMEA drops 60% on Monday, the overall number is down 15%. That looks like noise. Three days of noise is still noise. By the time the trend asserts itself in the aggregate, the dashboard has been quietly wrong for a week.
This is not an alerting-sensitivity problem. You cannot tune the global monitor to fire on a 15% drop without making it fire on every benign Wednesday. The problem is that the metric you alerted on is the wrong granularity for the failure mode you care about.
The fix is segmentation, not sensitivity
The fix is to monitor the metric one level deeper. Instead of revenue per day, monitor revenue per region per day. Each region gets its own baseline. EMEA's baseline is calibrated to EMEA's typical volume and rhythm, not to the global noise floor. When EMEA drops 60%, the EMEA monitor fires immediately. AMER and APAC stay green. The on-call alert names the segment so the engineer reads it once and knows what to investigate.
The same logic generalizes. Latency per tenant catches the noisy enterprise customer without paging on a healthy fleet. Row counts per upstream source catch a partner that stopped delivering at 3 AM. Null rates per environment catch the case where a fix made it to staging but never landed in production.
The rule of thumb: if you would want a separate ticket per dimension value when something breaks, you want a segmented monitor.
How segmented monitors work in Sparvi
In Sparvi, every monitor can be segmented. You pick a dimension column and the monitor runs one evaluation per segment value.
- Built-in metrics (row count, null %, distinct count, min, max, avg, stddev): pick any column on the same table as your segment-by dimension. Sparvi groups the metric by that column and tracks each value separately.
- Custom SQL metrics: alias your dimension column in the query (for example
region AS segment) and Sparvi reads the segmented values from the result set.
Each segment has its own baseline (for statistical evaluation) or its own threshold check (for threshold evaluation). The dashboard collapses per-segment results into one overall number using your chosen rollup: sum, average, min, or max. The detail view shows all four side by side so you can sort by deviation and surface the most-broken slice first.
Three patterns we see most often
1. Revenue or activity per region
A custom SQL monitor that returns one row per region with the daily sum. Segment by region, statistical evaluation, sensitivity 1.0, baseline window 14 days. This catches regional collapses on the day they happen instead of at end-of-month close.
SELECT
region AS segment,
SUM(amount) AS value
FROM orders
WHERE created_at >= DATEADD(day, -1, CURRENT_TIMESTAMP())
GROUP BY region2. Latency or error rate per tenant
For multi-tenant SaaS shops, a column-metric monitor on p95 latency or error rate, segmented by tenant_id, catches the noisy enterprise customer without paging on a healthy fleet. Combine with threshold mode for SLA contracts: warning at 200ms, critical at 300ms per tenant.
3. Row counts per upstream source
For pipelines that ingest from multiple providers, a row-count monitor segmented by source_system catches a single broken upstream without flatlining the global count. The healthy sources cover for the broken one in aggregate, but a per-source monitor surfaces the problem immediately.
What this changes about the on-call experience
Three things, all of which compound over the first month.
- Alert specificity goes up. "Revenue is off" is a four-hour debug. "EMEA revenue is 62% below baseline" is a ten-minute one. The alert names the segment so the on-call reads it once and goes straight to the right team or system.
- Aggregate noise goes down. When the global monitor fires every other day on benign global drift, on-call learns to ignore it. With per-segment monitors, the global monitor stays quiet and only the actually-broken segments page. Signal goes up; alert fatigue goes down.
- Resolution history compounds. If the EMEA segment had an incident in March that was caused by a partner outage, the next on-call to see an EMEA alert can read the March resolution. Per-segment history makes "same root cause as last time" a one-click realization instead of a multi-hour rediscovery.
When not to segment
Segmentation has a cost. More monitors means more compute, more alerts to maintain, and more cardinality in your dashboard. The decision rule:
- Segment when an aggregate would hide the problem. Revenue per region, latency per tenant, row counts per source. The aggregate cannot localize the failure.
- Do not segment when the aggregate IS the metric you care about. Total daily order count for a single-region business is a scalar monitor. Adding a fake segmentation does not help.
- Watch cardinality. Segmenting by
user_idon a table with 50M users is not segmentation; it is a row-level lookup pretending to be a monitor. A good segment dimension has 5 to 500 values.
Pairing with evaluation modes
Segmented monitors work with both statistical evaluation and threshold evaluation, and the choice matters more than people expect.
- Statistical, per segment: Sparvi learns a baseline for each segment independently. AMER's baseline is calibrated to AMER, EMEA's to EMEA. This is the default for metrics that drift with the business.
- Threshold, per segment: use this for SLAs that apply uniformly. "Every tenant's p95 latency must stay below 300ms." The threshold is the same across segments; the evaluation runs per segment.
- Mixed: some teams use statistical evaluation for the bulk of segments and an explicit threshold override for a handful of strategic customers or regions that warrant tighter contracts. Sparvi supports both as separate monitors on the same metric.
The two-minute setup
For a fresh Sparvi connection, the path is:
- Pick the metric you want to monitor. Built-in (row count, null %, distinct, min/max/avg/stddev) for warehouse-side metrics; custom SQL for business KPIs.
- Pick the dimension you want to segment by. For built-in metrics, any column on the same table. For custom SQL, alias the dimension column in your query.
- Pick the evaluation mode. Statistical for "learn what is normal" metrics; threshold for "here is the contract" metrics.
- Pick the schedule. Most teams start with hourly for critical tables and daily for reference tables.
- Save. The first baseline gets collected on the next run; alerts begin firing once the minimum-data-points guard has been satisfied.
Put the alert where the problem actually is
Sparvi gives you monitors on row counts, columns, and custom SQL, with ML or threshold detection, segmented by region, product, tenant, or any dimension you care about. 14-day free trial, no credit card. Connect Snowflake or BigQuery, get the first segmented alert in 30 minutes.
Start Free TrialRelated reading
- Monitors: the full reference on source types, evaluation modes, and schedules
- Segmented Metrics: feature page with worked examples
- Why Your Revenue Dashboard Is Wrong This Morning, the incident-response companion to this post
- Detecting Silent Pipeline Failures, the failure modes segmentation catches