Skip to content

Implementation plan / Session plan / Handover RC-1-S10

Handover RC-1-S10 Build: Platform: observability

Card: RC-1-S10. Issue: cema-care/his#24. Branch: session/RC-1-S10. Slice: RC-1. Decision record: ADR-HIS-054.

What was built and where

Everything is in platform/observability/, except the decision record and its row in the index. The unit's README, platform/observability/README.md, gives the layout, how the parts work together, the indicator names, routing and escalation, the settings and the checks.

Scope as read. The card covers MOD-ISE-008 for FR-ISE-OBS-001: correlated telemetry, dashboards and alerting. RC-1-S10 also has the contract points of the contracts/ise/README.md: - the service state board; - ServiceStateChanged; - dashboard and alert links for the catalogue; - telemetry with the correlation identifier.

SIEM forwarding (IF-ISE-006) belongs to FR-ISE-OBS-002, in RC-3-S09, and is not here.

What was built:

  • The telemetry pipeline, collector/collector.yaml. It is the OpenTelemetry Collector (contrib 0.165.0, pinned by digest), for every environment. It does three things before storage:
  • puts the correlation identifier on every span (his.correlation_id) and every log record (correlationId), whichever name the source used;
  • redacts secrets and national identity numbers, and marks the record;
  • counts telemetry per source, as a heartbeat.

It also reads: - pod or container logs in the units' ECS JSON; - Kafka consumer lag; - its own metrics; - synthetic checks of each unit's readiness (collector/synthetic-checks.yaml).

It sends everything to Prometheus, Loki and Tempo over OTLP, with a disk queue while a backend is down. - Grafana content, applied by bin/grafana-apply through Grafana's API: - the integration operations dashboard (REP-ISE-001) and the platform reliability dashboard (REP-ISE-002), with every PRS Appendix B indicator as a panel of that name; - a per-service dashboard, his-service, which is the dashboardRef of each catalogue entry; - nine alert rules: HisWatchdog, TelemetrySourceSilent, DeadLetterRaised, SecretInTelemetry, SyntheticCheckFailing, ServiceErrorRateHigh, ServiceLatencyHigh, ConsumerLagHigh and TelemetryExportFailing.

Red is used only for "Tier 1 services unavailable" (UX-ISE-008). - Runbooks, runbooks/: one per rule, and one for the unit's own MonitoringPipelineDegraded. - Retention, backends/retention.yaml, from CFG-ISE-021: logs 90 days, traces 14 days, metrics 13 months. - The service ise-observability, made from the service template with --into platform/observability. It has one module, mod-ise-008, with schema mod_ise_008 and migration V1__observability.sql. It does the following: - Service state board. It serves listServiceStates and readServiceState (contracts/ise). A service is Unavailable or Degraded while one of its open alerts carries that his_state, and Normal otherwise. Each change publishes ServiceStateChanged on his.ise.service.v1, through the outbox, ordered per service. The admitted services and their tiers come from the catalogue (listServices); the last ones read are kept while the catalogue is down. - Alert lifecycle. Each cycle (15 s) it reads Grafana's active alerts and silences, and records alerts as Firing, Acknowledged or Resolved. It routes them by the tier of the catalogue entry, escalates them by CFG-ISE-023 while they are not acknowledged, and sends again any notification that failed. Pages and tickets go to one webhook per support role. Its operator API (api/alerts.v1.openapi.yaml) lists, reads and acknowledges alerts, through the policy decision point. - Self-monitoring. If Grafana cannot be read, or the watchdog alert is missing for more than 2 minutes, it raises MonitoringPipelineDegraded itself and pages SRE directly. - Indicators. It counts InterfaceMessageDeadLettered (his_integration_dead_letters_total) and ReleaseDeployed (his_release_deployments_total, for the change failure rate). It exports his_service_state, his_alerts_open, his_alert_escalations_total and his_observability_pipeline_degraded. - Audit. Each creation, change and expiry of a Grafana silence becomes an ise.config.changed audit event through the kit, with the silence's author as actor. - Checks: - scripts/ends-when.sh: the card's "Ends when" and TEST-ISE-030, repeatable by RC-3-S09 and later sessions; - scripts/lib/: the check itself, the host stubs it uses (decision point, catalogue, pager) and an OTLP sender. - ADR-HIS-054 and its row in the decision record index (50 records).

The unit's buildSrc passes his.repository and his.unit-dir to the tests, so that they read the contract and this folder's files. No dependency was added: the lockfiles are those new-unit.sh and --write-locks wrote.

Checks and their result

The integration environment ran as HIS_SESSION=RC-1-S10 (his-rc-1-s10), light profile for the build and full profile for the check. Node.js is not installed on this server: the contract tool ran in the pinned node:22.18-bookworm image.

Check Command Result
Build and every test ./gradlew build in platform/observability Passed: 66 tests, none failed or skipped (after review round 2)
Provider contract test ServiceStateContractTest (in the build) his-contract verify contracts/ise --operation listServiceStates --operation readServiceState: passed, 4 cases. validate-event on the 3 ServiceStateChanged events published: passed
Consumer contract test ServiceStateContractTest (in the build) The catalogue client read listServices from his-contract serve contracts/ise; no violation recorded
Collector configuration otelcol-contrib validate with both files Valid
Ends when / TEST-ISE-030 HIS_SESSION=RC-1-S10 platform/observability/scripts/ends-when.sh Passed, 10 of 10 steps after review round 2 (below; step 10 in "Review round 2"); evidence written to platform/observability/build/ends-when/<run>/evidence.json (build output, not committed)
Dependency scan, image scan, static analysis, secret scan platform/delivery-pipeline/bin/dependency-scan, image-scan and static-analysis on platform/observability; secret-scan code and secret-scan docs from origin/main See "Scans" below
Documentation links python3 docs/implementation_plan/tools/check_links.py 0 broken, 0 duplicate anchors
Documentation site mkdocs build See "Scans" below

The steps of the end-to-end check, on the full profile, with the unit's image, the collector and this folder's Grafana content:

  1. One transaction is followed by its correlation identifier across the gateway, a service, the integration engine and the backbone (the four hops sent through the collector), plus a real call to the unit. Tempo finds all five services by span."his.correlation_id", and Loki finds the four hops by correlationId.
  2. Dashboards. Both dashboards hold every Appendix B indicator, and each indicator's query runs on Prometheus. Message volume, queue depth, availability, latency and saturation have data now. The per-service dashboard exists.
  3. An induced dead letter, the contract's sample InterfaceMessageDeadLettered put on the backbone, is counted. It shows in the dashboard's "Dead-letter count" panel, DeadLetterRaised fires, the unit records it, and on-call L2 is paged.
  4. The alert is acknowledged through the API. The unit's own log line, read by the collector from the container log, is in Loki under the request's correlation identifier, and its span is in Tempo.
  5. A failing synthetic check. A Tier 1 service fails its check and becomes Unavailable on the board. ServiceStateChanged is on his.ise.service.v1. The events pass validate-event, and the running unit passes verify for both board operations.
  6. Redaction. A log record with a bearer token, a NIK and a password is stored redacted, and the source gets a SecretInTelemetry ticket.
  7. Silence audit. A Grafana silence is audited as ise.config.changed, with action ise.silence.create and actor grafana:dev.sre.
  8. No data. A source that sent once and went silent raises TelemetrySourceSilent after 2 minutes.
  9. Pipeline health. The watchdog arrives and no MonitoringPipelineDegraded is firing.

Scans

Each was run on this host before the push.

Scan Result
Dependency scan, platform/observability 0 blocking (4 medium). The first run found three high CVEs in the compression libraries of kafka-clients: lz4-java 1.11.2 (CVE-2026-106451), and snappy-java 1.1.10.7 (CVE-2026-108106, CVE-2026-93451). They are raised to 1.11.4 and 1.1.10.9 by a constraint in the unit's service-kit/build.gradle.kts, as RC-1-S04 did, and the lockfiles were rewritten. The template still has the old versions (follow-up)
Image scan, his/observability 0 blocking (15 low, 38 medium)
Static analysis (Semgrep) No blocking finding
Secret scan, code and documentation, every commit of the change No secret
Protected files No exception added

Requirements and test scenarios

Item Test
FR-ISE-OBS-001 AC-01: a transaction traced across gateway, service, integration engine and backbone End-to-end steps 1 and 4; ConfigurationFilesTest "the collector puts the correlation identifier on every span and log record"
AC-02: every service has dashboards, alert rules and their links (the observability part; owner, runbook and SLO of the catalogue entry are FR-ISE-PLT-002's, RC-1-S20) ConfigurationFilesTest "the per-service dashboard ... takes the service as its variable"; every rule is multi-dimensional by service; end-to-end step 2
AC-03: dashboards, runbooks and escalation paths operational ConfigurationFilesTest "every alert rule has a severity, a summary and a runbook that exists"; AlertLifecycleTest (escalation paths); end-to-end steps 2, 3 and 9
AC-04: an induced dead letter on the dashboard and in an alert IndicatorsTest "a dead-lettered event (EVT-ISE-002) is counted once"; ConfigurationFilesTest "the rules the requirement names exist"; end-to-end step 3
Behaviours 1 and 2: collection and correlation End-to-end steps 1 and 4
Behaviour 3: business events Integration operations dashboard; IndicatorsTest; end-to-end step 3 (queue depth and dead letters with data)
Behaviour 4: reliability indicators Platform reliability dashboard; IndicatorsTest "a deployment (EVT-ISE-007) is counted"; end-to-end step 2
Behaviour 5: dashboards and alerts linked from the catalogue entry Per-service dashboard; the link forms in the README; AlertLifecycleTest (notifications carry runbookUrl and dashboardRef)
Behaviour 6 and PR-OBS-001-2: routing by tier, escalation AlertLifecycleTest: Tier 1 chain, acknowledgement stops it, Tier 2 at 30 minutes, Tier 3 and 4 tickets, Medium and Low tickets, clinical safety label, unknown service as Tier 1, an alert raised under a silence, a silence during an escalation, failed delivery sent again, no start without a webhook for every role, API acknowledgement and refusals
Behaviour 7: synthetic checks End-to-end step 5 (health checks; see "Differences")
Behaviour 8: no secrets, patient data minimized CollectorRedactionTest "the collector stores no secret or identity number from a body, an attribute, a nested ECS field or a span event ..." (records run through the pinned collector); ConfigurationFilesTest "the collector redacts ..."; end-to-end step 6
Behaviour 9: retention; available during a failure of the monitored service ConfigurationFilesTest "retention"; ServiceStateBoardTest "keep working while the catalogue is down"
PR-OBS-001-1: Tier 1 without dashboards or rules refused The admission check is FR-ISE-PLT-002's (RC-1-S20); this unit supplies the links (README, "Contract points served")
PR-OBS-001-3: silent source gives a "no data" alert End-to-end step 8; ConfigurationFilesTest "the rules the requirement names exist"
Section 10: monitoring pipeline degraded, independent path SelfMonitoringAndAuditTest "when Grafana cannot be read ...", "when the watchdog alert stops ..." and "each completed cycle sets the heartbeat ..."; ConfigurationFilesTest "the independent alert path ..."; end-to-end steps 9 and 10 (the unit stopped, Grafana pages SRE)
Section 10: secret in a log redacted, defect raised End-to-end step 6
Section 11: Firing, Acknowledged, Resolved AlertLifecycleTest "resolve and refire", "acknowledgement stops escalation"; end-to-end step 4
Section 12: audit of silences SelfMonitoringAndAuditTest "each creation, change and expiry of a silence is audited once"; end-to-end step 7
EVT-ISE-008 and the board (contract points) ServiceStateBoardTest (6 tests); ServiceStateContractTest; end-to-end step 5
TEST-ISE-030 End-to-end steps 1 (trace across all hops), 3 and 8 (dead letter and silent source, alerts raised), and 2 (indicators present); tagged tests IndicatorsTest and ConfigurationFilesTest
NFR-ISE-005 Security Token validation and the policy decision on every API call (kit); redaction; no secrets in the repository (secret scan)
NFR-ISE-009 Interoperability Contract tests, provider and consumer
NFR-ISE-012 Observability End-to-end step 1
NFR-ISE-016 Time integrity Every time is UTC (Instant, timestamptz, Grafana in UTC); clock offset telemetry belongs to FR-ISE-PLT-004, not in this card
NFR-ISE-018 Localization Dashboards use the viewer's time zone (timezone: browser), shown in Grafana's time picker

Review round 2

The review asked for four changes, all made on this branch:

  • Independent alert path when the unit itself fails (section 10). The unit sets a heartbeat, his_observability_cycle_completed_seconds, at the end of each completed cycle. Grafana's rule ObservabilityUnitSilent fires when the heartbeat is more than 3 minutes old or missing: a crash, a lost database, or a cycle that keeps failing. The rule's alerts carry route=independent, and Grafana sends them through one notification route to the SRE webhook (contact point his-sre-independent, from HIS_SRE_WEBHOOK_URL in bin/grafana-apply), without the unit.
  • Tests: SelfMonitoringAndAuditTest "each completed cycle sets the heartbeat ...", which also shows that a failing cycle leaves it stale; ConfigurationFilesTest "the independent alert path ...".
  • End-to-end step 10 waits until the rule is quiet while the unit runs, stops the unit, and sees Grafana page SRE 191 s later. Grafana pages a webhook receiver on the session network, because a host firewall may drop traffic from containers to the host.
  • The rule also fires between applying the rules and the unit's first heartbeat. That is a page while the unit is not running, which is what it is for. A deployment starts the unit before it runs grafana-apply.
  • Rerun of scripts/ends-when.sh from a fresh environment: 10 of 10 steps passed, with 66 tests in the build.
  • Recorded in ADR-HIS-054, decisions 2 and 4. Runbook runbooks/ObservabilityUnitSilent.md.
  • Clinical safety escalation. The specification does not say which alerts take it. That is asked as Q3 on issue #24, under rule 3. The mechanism stays, and no rule sets the label until the answer comes.
  • Q1 closed by D02-ISE 9.1, as above.
  • escalateDue now returns the number of escalations it sent, as its Javadoc says.

Review round 1

The review asked for five changes, all made on this branch:

  • Silenced alerts and escalation (behaviour 6, PR-OBS-001-2). Before, an alert raised under a silence never sent step 0, and when the silence ended escalateDue moved one step per cycle from detection. Now each alert keeps an escalation base and the time its silence started (escalation_base, silenced_at in V1__observability.sql, which is not merged yet). While silenced nothing is due. When the silence ends:
  • the time spent silenced moves the base on;
  • the step due is sent at once, unless it was delivered before the silence;
  • the next step comes after the remaining time.

Tests: AlertLifecycleTest "an alert raised under a silence ..." and "a silence in the middle of an escalation pauses it ...". - Redaction everywhere (behaviour 8, section 10, NFR-ISE-005). The collector now: - flattens nested attributes (ECS error.message, error.stack_trace) and map bodies; - applies all five patterns to bodies and to every attribute value; - covers span attributes and span events (spanevent context); - marks every log record or span in which anything was found.

Redacted spans are counted as his_telemetry_span_redactions_total, and SecretInTelemetry fires on either counter. - A test that runs the collector. CollectorRedactionTest starts the pinned collector with collector.yaml and a file exporter. It sends these through it: - a container log line in ECS form with nested error fields; - text and map bodies, and attributes; - a span with a secret header, a query key and an exception event.

It asserts that no secret value is stored, that each record is marked and a clean one is not, and that the counters appear per source. It needs Docker, as the pipeline's Java job has. - No page lost to a missing webhook. Pager.Webhook refuses to start while any role of the escalation has no webhook: every urgent and routine chain, clinical safety, and the SRE role of the independent path (Escalation.roles()). Test: AlertLifecycleTest "the unit does not start when a support role of the escalation has no webhook". - The check itself: on a fresh environment, Kafka reports consumer lag only once a group has committed an offset. The queue depth check therefore moved from step 2 to step 3, after the dead letter is consumed. Rerun of scripts/ends-when.sh after the changes: 9 of 9 steps passed, with 64 tests in the build. - Image name: his/observability (his/<unit folder name>, CLAUDE.md section 4) in ADR-HIS-054, the README and the check scripts.

Differences from the card or specification

  • The alert operator API is this unit's own (api/alerts.v1.openapi.yaml), not part of contracts/ise.
  • FR-ISE-OBS-001 section 3 has the service desk acknowledge alerts, and no contract or RC-1 screen offers that. A build session changes only its unit (card, "Ends when").
  • The API follows the contracts/common conventions, so the contract session of UI-ISE-005 can move it as it is (ADR-HIS-054).
  • Routing defaults where CFG-ISE-023 is silent. CFG-ISE-023 names no target for the Tier 2 escalation, which goes to secondary-on-call. It gives no route for Medium and Low alerts, which become a service-desk ticket on any tier. An alert for a service the catalogue does not hold is routed as Tier 1. All three are settings (his.observability.escalation).
  • The board answers 503 while the policy decision point is down, as every kit endpoint does. D02-ISE 9.1 ("policy service unavailable") requires exactly this for internal non-clinical paths: an explicit "authorization service unavailable" error with a retry indication.
  • Clinical safety escalation is supported (escalation=clinical-safety), but no rule sets it: the specification does not say which alerts take it (question Q3).
  • Synthetic checks test each unit's readiness endpoint. Synthetic transactions of key clinical workflows (behaviour 7) need those workflows, which RC-1's build sessions are still making. They are added to synthetic-checks.yaml as each workflow lands (follow-up).
  • Indicators without a producer yet. Six Appendix B indicators show "No data" until their producers emit them under the names of the README, "Indicators": ACK/NACK, retries, latency, unmatched, partner availability, backup and restore, and incidents.
  • Retention is set in backends/retention.yaml for the deployment. The integration environment's telemetry container is FN-S02's and keeps its own defaults. Preservation orders, which suspend deletion, come with FR-ISE-OBS-002.
  • Logs with patient references. In RC-1 the pipeline redacts identity numbers, and the units log no patient data, so no log is Sensitive yet. A separate, access-audited store for Sensitive logs (sections 12 and 13) is built when the first one is needed: with the security events of RC-3-S09, or the first unit that must log a patient reference.
  • Acknowledgement is recorded on the alert, with who acknowledged it and when, and not as an audit event. D02-ISE 9.5 has no audit event type for it.
  • In the local check the collector runs as root, to read Docker's container log file. On Kubernetes it reads /var/log/pods as its DaemonSet allows.
  • No Kubernetes manifests for Argo CD yet. The collector as a DaemonSet and a gateway, the unit's Deployment and the grafana-apply post-sync job need the environments and namespaces of RC-1-S20 (follow-up).

Questions for a person

None stops this session. Both are listed under "Needs a person" in the pull request and posted on issue #24. Q1, whether the board should answer during an outage of the policy decision point, is closed: D02-ISE 9.1 already requires internal paths of this kind to be denied with an explicit error and a retry indication, which the 503 with Retry-After does.

# Question Owner What the unit does now
Q3 Which alerts go to clinical safety escalation (FR-ISE-OBS-001 behaviour 6, the support model "L1, L2, L3, clinical safety escalation"), and when: for example every Tier 1 clinical service Unavailable, at once or only when not acknowledged in time; or only once downtime is declared (WF-ISE-006)? Clinical safety officer with the owner of D02-ISE (clinical behaviour, rule 3) The unit pages clinical-safety at once for an alert labelled escalation=clinical-safety; no rule sets that label yet
Q2 Please confirm the routing defaults where CFG-ISE-023 is silent: Tier 2 escalation to the secondary on-call at 30 minutes; Medium and Low alerts as service desk tickets on every tier Platform engineering / SRE lead (owner of CFG-ISE-023) As stated; each is a setting

Follow-ups outside the card

  • FN-S02 (platform/dev-environment): his-env makes unit databases only for services/*. A platform unit with settings.gradle.kts (here ise_observability) has to make its own, as scripts/lib/ends_when.py does.
  • Service template (services/_template, a card that covers it):
  • raise lz4-java to 1.11.4 and snappy-java to 1.1.10.9 in the template's kit, so that a new unit does not start with the CVEs above;
  • the first policy decision of a cold unit can take longer than 250 ms (CFG-ISE-031) and be answered as an outage (503). A warm-up of the decision client at start would avoid it. This check waits for it;
  • the inbox could count delivery retries as his_integration_retries_total.
  • RC-1-S20 (platform/deployment-topology):
  • catalogue entries take dashboardRef and alertRuleRefs in the forms of this README;
  • the admission check of PR-OBS-001-1 refuses a Tier 1 entry without them;
  • client credentials for ise-observability to read listServices;
  • the Kubernetes manifests of this unit and the collector, and the grafana-apply job;
  • Grafana sign-in through Keycloak, with the roles of FR-ISE-OBS-001 section 3 (SRE and service teams edit, service desk and integration operations read) and folder permissions.
  • RC-1-S16 (decision service): register the resource types ise.ServiceState and ise.Alert, and the actions ise.service-state.read, ise.alert.read and ise.alert.acknowledge. The audit event type ise.config.changed, which the silence audit uses with the actions ise.silence.create, ise.silence.update and ise.silence.expire, is already in the audit catalogue of RC-1-S04.
  • RC-1-S13 (platform/event-backbone) emits his_integration_retries_total and his_event_propagation_milliseconds. RC-1-S12 (platform/gateways) sends spans with the correlation identifier. Both send OTLP to the collector.
  • Integration engine slice (MOD-ISE-003): his_integration_acknowledgements_total, his_integration_unmatched, his_integration_partner_up and his_integration_round_trip_milliseconds.
  • Backup and recovery and the incident process (MOD-ISE-009, WF-ISE-006): his_backup_last_success_timestamp_seconds, his_restore_test_last_success_timestamp_seconds and his_incidents_open.
  • RC-1-S26 (integrate):
  • add ise-observability and the collector to e2e/scenarios/RC-1/stack.json;
  • step 7 of the scenario finds telemetry in Loki by correlationId, which this collector provides;
  • add a synthetic transaction of the registration workflow to synthetic-checks.yaml.
  • The contract session of UI-ISE-005: move api/alerts.v1.openapi.yaml into contracts/ise.
  • D10 notification service (IF-ESS-009): replace the webhook pager once it is contracted, keeping the roles.
  • RC-3-S09 (FR-ISE-OBS-002):
  • SIEM forwarding;
  • preservation orders that suspend retention;
  • the Sensitive log store with access audit;
  • security alerts on UI-ISE-006.
  • D8 ANL: the operational indicators feed of section 9 (outputs). ServiceStateChanged and the Prometheus indicators are its sources; the extract comes with an ANL slice.