Repository navigation
Alert when Piri stops receiving chain notifications - #162
Merged
Merged
Conversation
A stopgap for a Lotus whose head has stopped moving. Piri's chain scheduler (curio lib/chainsched) logs "no notifications received in 5m0s, resubscribing to ChainNotify" about every ten minutes while the head is stuck, and nothing Piri exports shows it otherwise. The rule counts that line per node over fifteen minutes in Piri's log stream, narrowed to the alerting stages by the appliance label the way the metric rules are, and fires after fifteen minutes pending so a single line does not page. It joins the appliance group with the same team = "forge" routing label as every other rule. It is the first rule here to read logs, so this adds a loki_datasource_uid variable alongside the Prometheus one, set to grafanacloud-logs by the same Grafana Cloud convention. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ
Peeja
added this pull request to stack #165
September 30, 2026 18:11
Peeja
added a commit
that referenced
this pull request
Sep 30, 2026
…ame the Regions groups (#166) * grafana: say every data source a rule reads needs a query grant, and rename the Regions group Applying #162 failed with a 403 putAlertRuleGroupForbidden: its rule is the first to read grafanacloud-logs, and forge-terraform could query only grafanacloud-prom. The handler refuses a group that reads any data source the caller cannot query. The header now says the grant is needed on every data source a rule reads, today prom and logs, and before the rule merges. The appliance group is renamed Forge Regions, matching its dashboard. The provider replaces a rule group whose name changes, so its rules are recreated with new uids and fresh state. observability.md's rule table follows, and gains the chain-notification rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ * grafana: rename the appliance containers group Forge Regions containers It stays its own group: a group's rules share one evaluation interval, and this one runs every 60s where Forge Regions runs every 300s. Like the Regions rename, the provider replaces the group, so its rule is recreated with a new uid and fresh state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ * grafana: don't list the data sources the query grant covers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ * grafana: rewrap the query-grant comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ * grafana: reflow the query-grant comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written by Claude.
Part of FIL-1383
Problem
On 2026-09-28, staging's Lotus stopped following the chain. Piri stayed up, answered its health check and kept sending metrics, but it stopped proving. Nothing alerted, and the problem surfaced more than a day later, when a deploy hung.
Piri exports no chain or proving metrics yet; FIL-1383 adds them. Until then, the one signal is in its logs. Curio's chain scheduler, which Piri runs, logs this while the head isn't moving:
The text is at curio
lib/chainsched/chain_sched.go:209, at the version Piri pins. It recurs about every ten minutes, and staging's Piri logged it throughout the incident.Change
terraform/envs/grafana/alerts.tf: a fifth rule in the appliance group, "Piri has stopped receiving chain notifications". It's the first rule here that reads logs rather than metrics.alert_stages = ["staging"], asterraform.tfvarssets it, it renders as:(staging)group comes fromlocal.stages, which joinsalert_stageswith|. Adding production would make it(staging|prod).> 0, the same shape as the other rules.for = 15m, so one line doesn't fire the alert by itself. It fires about twenty minutes after the head stops moving.no_data_state = OK: an empty result is the healthy state, as in the 5xx rule.severity = critical: a node that isn't proving is what matters most.team = forge, like every other rule here.runbook_url: the runbook's "When something is wrong" section, as the other appliance rules use.alert_stages, as the other appliance rules do, so today it watches staging and not dev.loki_datasource_uid: a new variable, set interraform.tfvarslike the Prometheus one. Its value,grafanacloud-logs, is confirmed from the data source's settings page URL.Testing
node="staging/eu-central-3". The stream carriesappliance="staging-eu-central-3"andservice_name="appliance-staging-eu-central-3-piri". That confirms the selector, the log text and the labels the summary uses.tofu fmt -check -recursivepasses.tofu validatepasses, withinit -backend=falseand the pinned grafana provider 4.46.0. The lock file is unchanged.Notes
GRAFANA_APPLY_ENABLEDis set.🤖 Generated with Claude Code
https://claude.ai/code/session_01JCF8gyb8jNRmHmWqQmVhRJ
✴️