Policy rules
Use post-diff rules to suppress noise, route important changes, and escalate notification severity.
Policy rules
Policy rules are deterministic, post-diff rules that run after Diffmon computes a diff.
Plan availability: Pro and above.
What policy rules can do
- Suppress notifications for matched low-value changes.
- Add destination routes for matched high-impact changes.
- Escalate notification severity labels.
- Add labels for downstream routing and triage.
What policy rules do not change
- Diff computation.
- Incident grouping.
- Baseline logic.
- Snapshot/diff persistence.
Suppression only stops notification event and delivery creation. Evidence and incidents still persist.
Matching inputs
Rules can match on:
classification_in:schema_change | value_change | mixed | content_changemin_severity:critical | high | medium | infopath_prefix_any: one or more JSON path prefixes
path_prefix_any is normalized to a slash-prefixed canonical form and deduped.
Rule schema (v1)
{
"schemaVersion": "v1",
"rules": [
{
"id": "breaking-payments",
"enabled": true,
"when": {
"classification_in": ["schema_change", "mixed"],
"min_severity": "high",
"path_prefix_any": ["/v1/payments"]
},
"then": {
"suppress_notifications": false,
"route_destination_ids_add": ["dest_pagerduty"],
"escalate_to": "critical",
"labels_add": ["payments", "breaking"]
}
}
]
}Evaluation behavior
- Rules evaluate in persisted list order.
- Disabled rules are skipped.
- A rule matches only when all specified predicates match.
suppress_notificationsaccumulates with logical OR.- Routes and labels are unioned, deduped, and sorted.
- Escalation uses highest matched severity and is monotonic against original severity.
Configure with API (v1)
Policy rules are stored on monitor settings.
GET /api/monitors/:id/settingsreturnspolicyRulesJsonwhen entitled.PATCH /api/monitors/:id/settingsacceptspolicyRulesusing strict schema validation.- Replace-all semantics apply:
- send
rules: []to clear - omit
policyRulesto leave unchanged
- send
Example update:
{
"policyRules": {
"schemaVersion": "v1",
"rules": [
{
"id": "ignore-timestamps",
"enabled": true,
"when": {
"classification_in": ["value_change"],
"path_prefix_any": ["/timestamp", "/generated_at"]
},
"then": {
"suppress_notifications": true
}
}
]
}
}Validation and entitlement behavior
- Unknown keys are rejected with
400 VALIDATION. - Invalid enums/ranges are rejected with
400 VALIDATION. - Rules over limit are rejected with
400 VALIDATION. - If not entitled, updates are rejected with
403 FORBIDDEN.
Best practices
- Start with one suppression rule for known noisy paths.
- Add one escalation rule for breaking schema paths.
- Keep rule IDs stable and descriptive.
- Prefer narrow
path_prefix_anyscopes over broad global suppression.