Monitors and alert rules people will read
Turn a one-time check into a monitor, measure performance once outcomes arrive, and write alert rules that fire when you need them and stay quiet otherwise.
You will be able to
- Set up a monitor and say what each run measures
- Plan for outcomes that arrive late
- Write an alert rule, and predict how it behaves when a number is missing
- Avoid alert storms with thresholds on size, episodes and cooldowns
Read first
A check you have to remember isn't monitoring
ReadA monitor runs the same check again and again against a dataset's current version. Each run can:
- score the rows with the model, and compare predictions with training;
- compare the features with the training data;
- measure performance on any rows that have an outcome;
- check your alert rules.
You point a monitor at an alias or a pinned version. Following champion means the monitor moves on its own when you promote. Each run records which version it used.
Your outcomes arrive in 90 days
PredictPredict first
A model predicts loan default, and you learn the true outcome three months later. What can a monitor tell you this morning?
Reveal
Inputs and predictions today, performance later. Drift in features and in prediction_psi are your early warnings. They can't confirm a problem, but they don't have to wait. Performance is measured only on rows that carry the outcome, so it arrives late and describes the model as it was months ago.
Set one up
In the appOpen a version's Monitor & serve tab and press the + button (New monitor). Name it, choose the model to watch and the dataset to check ({{dataset}} in the walkthrough), then press Save monitor.
Use Run now for the first run. The calendar button sets a schedule. Schedules run while the app is open, and a missed run catches up once at the next start. Settings → Schedules can also run SQL-scored monitors while the app is closed.
Set Minimum rows too. A tiny batch can't support a drift check, so below that count the run is recorded and drift and accuracy are skipped.
A rule is a sentence about the numbers
ReadAn alert ruleAlert ruleA condition over a monitor's numbers that opens an alert when it is definitely true; missing numbers never fire it. is a condition checked after each run. The dialog offers these starting points:
max_psi() > 0.25
share_drifted() >= 50%
prediction_psi() > 0.2
metric("roc_auc") < champion.roc_auc - 0.03
roc_auc_30d < model.roc_auc - 0.05
rows() < 100
Combine them with AND, OR and NOT. Names such as model.roc_auc read the version's own scores, and champion.roc_auc reads the champion's. Test tries a rule on the latest run before you save it.
Each run also records env_drift: 0 when the Python or R setup matches the one at registration, 1 for a minor change, 2 for a major one. env_drift >= 2 is a rule worth having.
When a number is missing
PredictPredict first
Your rule is metric("roc_auc") < model.roc_auc - 0.05. Today's batch has no outcomes, so there's no AUC. What does the rule do?
Reveal
It doesn't fire, and its state is unknown. A rule fires only when its condition is definitely true. The logic has three values: unknown AND false is false, and unknown OR true is true. So a drift clause can still fire a rule while its accuracy clause waits for outcomes.
Looking every day has a price
ExploreA monitor looks at your model on a schedule, and every look is another chance for noise to cross a line.
EExplorable · Peeking at an A/A test
If you check an experiment with no effect every day, how often will it look like a winner?
With no real difference and a look every day, how often will this A/A test cross p < α at least once?
Scrub through one experiment's life.
Commit your prediction above to see the result
Make your prediction to see the result.
Here nothing is happening, and each daily look can still declare a change. Raise the number of looks and watch the share of false alarms climb.
For rules, this means thresholds on size work better than a bare p < .05 on each run. Ask for a change big enough to act on, or an average over time, such as roc_auc_30d. The next lesson adds detectors built for repeated looks.
Episodes, not storms
ReadA firing rule opens an alert. If it fires again, the same alert grows its count instead of opening a new one. When the condition clears, the alert resolves on its own.
Notify again after sets a cooldown in minutes, and repeats inside it only count. The default is 60. A system notification is optional for each rule, and Severity can be info, warning or critical.
Open alerts appear under the bell button, where you can acknowledge or resolve them.
Would anyone act on it?
ReflectAn alert nobody acts on trains people to ignore alerts.
Write one rule for a model you know. Then answer these:
- Who gets it?
- What do they check first?
- What would they do if the check confirms it?
If you can't answer, the rule is probably a chart you'd like to look at. Keep it on the run history, not in anyone's notifications.
Check your understanding
CheckpointCheck yourself
The rule is max_psi() > 0.25 OR metric("roc_auc") < 0.7. The largest PSI is 0.31, and this batch has no outcomes. What happens?
Show the answer
Answer: a
An OR is definitely true once one side is true, whatever the other side turns out to be.
Check yourself
A rule fires on five runs in a row, with a one-day cooldown and hourly runs. What do you get?
Show the answer
Answer: a
Repeats extend the open episode, and the cooldown limits notifications. The history still records every occurrence.
Check yourself
Put one monitor run in order.
Show the answer
The order:
- The monitor resolves the model through its alias or pinned version
- It scores the dataset's current version
- It compares features and predictions with training, and measures performance on labeled rows
- It checks the alert rules on the run's numbers
Rules run last because they read the numbers that the run produces.
Do it on your own data
In the appExpand your monitor, press New alert rule under Alert rules, and write a condition. Then press Test. The result says Would fire, Would not fire or Unknown (missing data), with the value of each term.
Discover scorers work here too. Registered clusterings and anomaly detectors report how segment shares and the anomaly rate move, so a rule can watch anomaly_rate. See the Discover scorerDiscover scorerA registered Discover run that assigns new rows to its clusters, scores their oddness or places them on its map. entry.
Recap
Recap- A monitor repeats scoring, drift, performance and rules, against an alias or a pinned version.
- Inputs and predictions warn you early; performance waits for outcomes.
- A rule fires only when its condition is definitely true, so missing numbers never fire it.
- Repeats extend one alert, and a cooldown limits notifications. Give every rule an owner and an action.