Module 6 of 8 · 10 min

# Custom Metrics and Alerts

Expressing a business specific quality rule in SQL and routing it to someone who can act.

## Why this matters

Some rules are specific to your business: an order never has a negative total, a settlement date never precedes its trade date. This module writes one as a SQL metric and routes the alert to someone who can act on it.

## Before you start

### Write the rule in SQL

Built in checks cover common shapes: nulls, uniqueness, ranges, freshness. Anything that depends on the meaning of your data needs a custom metric, and SQL is the most direct way to say it.

### An alert needs a recipient who can do something

Send the alert to whoever can fix the cause. An alert that lands with people who cannot act on it teaches everyone to ignore the channel.

### Threshold design decides whether an alert is trusted

Too sensitive and it fires constantly and gets muted. Too loose and it misses the incident it existed for. Expect to tune a threshold after watching the metric for a while rather than getting it right at the moment you write it.

## The interactive demo

Work through the demo below. It runs in your browser with nothing to install. Watch for:

*   •Creating a custom metric with SQL
*   •Creating an alert based on that custom metric

This demo is also available on its own at [the Learning Center](/learning-center/product-demo-metrics-alerts).

## After this module you should be able to

*   ✓Write a custom metric that encodes a business specific rule
*   ✓Configure an alert and choose a recipient who can act on it
*   ✓Explain how you would tune a threshold that is firing too often