Monitor what fails without an error
A feature layer usually breaks quietly, with no error anywhere.
Five monitors catch a stale or broken feature
| Monitor | How it's computed | Alert when |
|---|---|---|
| Freshness | now minus the newest event time, per feature group | daily: the load hasn't landed 2 hours after its usual time, or age passes 30 hours. Streaming: p99 lag over 2 minutes |
| Fallback and null rate | share of requests where each feature was defaulted or missing | 3 times its usual rate, or a jump right after a deploy |
| Fetch latency | p50 and p99 per store, and the timeout rate | the stage's p99 nears its slice of the budget |
| Drift against training | distance between this hour's served values and the training set, per feature | above a threshold tuned per feature |
| Parity | logged served value against the value recomputed offline, on a sample | mismatch rate over a small threshold |
Most feature failures throw no errors. The model keeps scoring on values that are stale, defaulted or shifted. These five catch them.
Drift: how far this hour's values are from the training set
| Device, an example | Share in training | Share in serving | Difference |
|---|---|---|---|
| TV | 50% | 40% | 0.10 |
| Phone | 30% | 45% | 0.15 |
| Laptop | 20% | 15% | 0.05 |
TensorFlow Data Validation (TFDV) makes a fine default to name. It measures drift with L-infinity distance for categorical features, and approximate Jensen-Shannon divergence for numeric ones.
L-infinity distance is the largest difference, over all categories, between a category's share in serving and its share in training. In this example it's 0.15, from phones. Jensen-Shannon divergence is a symmetric, bounded score for how far apart two distributions are, 0 when they match.
TFDV also warns that setting the right distance is usually an iterative process, which takes domain knowledge and experiments.
In the editor, write shares(values) and l_inf(train, serve). TRAIN and SERVE are the device shares from the table, so the distance should come out at 0.15.