Architecture / Decision records / ADR-HIS-097
ADR-HIS-097 The observability unit loads every unit's alert rules: Prometheus rule files stay with their unit and are imported by grafana-apply, and alerts a unit only counts or logs get their rule in the observability unit¶
| Status | Accepted |
| Decided | 2026-11-29 by session RC-1-S28-F13 |
| Record | Drafted 2026-11-29; approved 2026-11-30 by the Enterprise Architecture Board |
| Where the rule lives | platform/observability (bin/grafana-apply imported_groups, imported_rule, condition; grafana/alerting/rules.json imports and group his-interfaces; runbooks/; ConfigurationFilesTest; step 10 of scripts/lib/ends_when.py) |
Context¶
ADR-HIS-054 made Grafana the alert evaluator, with the rules of platform/observability/grafana/alerting/rules.json applied by bin/grafana-apply. Two other units then wrote Prometheus rule files for their own alerts: the gateways (platform/gateways/observability/alert-rules.yaml, 4 alerts) and the time service (platform/deployment-topology/observability/clock-drift.rules.yaml, 6 alerts). Both said that the observability unit loads them, and nothing did. The audit service, the event backbone, the policy decision service and the workflow service count or log their alerts (his.audit.alerts, his.backbone.alerts, his.authz.*, the stuck-work alert) for "the observability rules", and no rule read them. The gate of slice RC-1 found both (fix RC-1-S28-F13, issue #219, readiness finding F-02): criterion 6 (ACC-005, monitoring of each interface) and FR-ISE-OBS-001 and FR-ISE-PLT-004 of criterion 4 failed.
To be settled: where a unit's rules live, how they reach Grafana without each unit calling Grafana, and how they meet the conventions of FR-ISE-OBS-001 (a severity of CFG-ISE-023, a runbook, a service label for routing and for the catalogue's alertRuleRefs).
Decision¶
- A unit's own alert rules stay in its folder as a Prometheus rule file, which it tests with
promtool test rules. The observability unit'srules.jsonlists the file underimports, andbin/grafana-applyloads each group as a Grafana rule group of the same name, in the folderhis-platform. One script still applies every rule, in every environment, and no other unit needs Grafana's API or credentials. - Prometheus semantics are kept. An imported rule is query A (the expression as written) and the math condition
$A == $A || $A != $A, which is true for any value. So it fires for every series the expression returns, a value of 0 or NaN included (node_timex_sync_status == 0), and no series means no alert (noDataStateOK).foris kept.$valuein annotations becomes$values.A.Value, Grafana's numeric value of query A. A group's interval is rounded up to Grafana's step of 10 s (the clock-drift group's 15 s becomes 20 s). - The import entry adapts a file to FR-ISE-OBS-001, not the file itself.
severitymaps names that CFG-ISE-023 does not route onto its severities (the gateways'warningismedium, a ticket).serviceis set on a rule that has noservicelabel.runbooks: ise-observabilitytakes each rule's runbook from this folder, named as the last part of itsrunbook_urlor after the rule. The owning unit is free to change its expressions and thresholds; the observability unit owns how they are routed. - An alert a unit only counts or logs gets its rule in
rules.json, grouphis-interfaces, on the counter or log line the unit writes now. A counter rule counts the occurrences in a window, a new series in full (the pattern of DeadLetterRaised). A rule may also be a LogQL metric query on Loki ("datasource": "loki"), for an alert that is only a log line (StuckWorkRaised, fromess-coordination'sstuck <kind> <ref> (<reason>): alert to <roles>). - Drift is caught in the observability unit's build.
ConfigurationFilesTestloads every rule asgrafana-apply --print-rulessends it, checks that each alert of each imported file is there with its expression, duration and labels, and checks that the counter names, kinds and log text thehis-interfacesrules read are present in their units' sources. Those files are inputs of the test task. The full-profile check (step 10) loads the rules into Grafana, induces each condition as the units report it, and sees the rules fire and the unit page.
Consequences¶
- The gateway and clock-drift alerts and the audit, backbone, authorization and stuck-work alerts are evaluated, routed by tier and escalated like every other alert, each with a runbook.
grafana-applyneeds PyYAML for the imported files (python3-yaml). The post-sync job's image must have it.- A change to an imported file or to a counter a rule reads is checked only when the observability unit builds: the pipeline builds a unit only when its folder changes. A unit that renames such a counter must update the rule in the same change; the full-profile check and the next build of this unit catch a miss.
- Rules on a unit's counters live away from that unit. A unit that wants to own its rules writes a rule file and has it imported (decision 1); the rule in
his-interfacesis then removed. - The time service's
runbook_urls pointed atise-deployment-topology/…, where no runbook was written; they now point at this folder's runbooks.