Repository navigation
docs(ops): paging woke the phone; close #377 and publish sev1-paging #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # sev1-paging Specification | ||
|
|
||
| ## Purpose | ||
| A SEV1 wakes a person: ops alerts carry a severity derived from which checks are critical, Pushover pages at emergency priority through Do Not Disturb once per incident, and a Healthchecks.io dead man's switch pages when the monitor itself goes silent. Created by archiving change sev1-paging. | ||
| ## Requirements | ||
| ### Requirement: Pushover is an alert channel type | ||
|
|
||
| The system SHALL accept `pushover` as an alert channel type, store its | ||
| application token and user key encrypted, never return them, and deliver alerts | ||
| to Pushover's messages API without raising on failure. | ||
|
|
||
| #### Scenario: Credentials are validated and never returned | ||
|
|
||
| - **WHEN** an admin creates a `pushover` channel without a user key | ||
| - **THEN** the request is rejected with 422 | ||
| - **AND WHEN** the channel is created with both | ||
| - **THEN** no response ever contains the token or the user key | ||
|
|
||
| ### Requirement: Ops alerts carry a severity from the critical checks | ||
|
|
||
| The system SHALL classify each ops alert as `page` when `database` or | ||
| `migrations` is critical, `urgent` when `backup_freshness` or `secrets` is | ||
| critical (and no paging check is), and `info` otherwise, and SHALL map them to | ||
| Pushover priorities 2, 1 and 0. | ||
|
|
||
| #### Scenario: The database going down pages | ||
|
|
||
| - **WHEN** the database check becomes critical | ||
| - **THEN** a Pushover channel receives a priority-2 message with `retry` and | ||
| `expire` set | ||
|
|
||
| #### Scenario: A stale backup does not wake anyone | ||
|
|
||
| - **WHEN** only `backup_freshness` is critical | ||
| - **THEN** the Pushover message has priority 1 | ||
|
|
||
| #### Scenario: Slack sees the same classification | ||
|
|
||
| - **WHEN** an alert is `page` | ||
| - **THEN** its Slack message starts with `[PAGE]` | ||
|
|
||
| ### Requirement: A page is sent once per incident | ||
|
|
||
| The system SHALL send severity `page` only when the set of critical paging | ||
| checks grows relative to the previous observation, and SHALL send reminders and | ||
| unrelated changes during that incident as `info`. | ||
|
|
||
| #### Scenario: A reminder during an outage does not page again | ||
|
|
||
| - **WHEN** the database has been critical for longer than the reminder interval | ||
| - **THEN** the reminder is sent at priority 0 | ||
|
|
||
| #### Scenario: A second paging check failing pages again | ||
|
|
||
| - **WHEN** migrations become critical while the database already was | ||
| - **THEN** a new priority-2 page is sent | ||
|
|
||
| ### Requirement: The monitor reports that it is alive | ||
|
|
||
| The system SHALL, when `UKIP_OPS_HEARTBEAT_URL` is set, ping it after every | ||
| monitor cycle, ping `<url>/fail` when the evaluation raised, never raise, and | ||
| never log the URL. | ||
|
|
||
| #### Scenario: A failed evaluation reports failure | ||
|
|
||
| - **WHEN** the checks raise during a cycle | ||
| - **THEN** the heartbeat request goes to the `/fail` path | ||
|
|
||
| #### Scenario: An unreachable heartbeat service does not break the cycle | ||
|
|
||
| - **WHEN** the heartbeat request times out | ||
| - **THEN** the cycle completes and the next one runs | ||
|
|
||
| ### Requirement: The paging path is testable end to end | ||
|
|
||
| The system SHALL, for a Pushover channel's test action, send a real | ||
| emergency-priority message that expires on its own within a minute. | ||
|
|
||
| #### Scenario: Testing a Pushover channel | ||
|
|
||
| - **WHEN** an admin tests a Pushover channel | ||
| - **THEN** a priority-2 message with `expire` of 60 seconds is sent | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When PostgreSQL is actually unavailable, this scenario cannot deliver the promised Pushover page:
_db_checkrecords a critical result, but the later unguarded database queries in_scheduler_checkmakerun_operational_checksraise;run_oncethen builds anevaluation_failedreport anddispatch_eventitself raises while queryingAlertChannelfrom the same unavailable database. The only recorded exercise used the channel's test action, so it does not validate this production path; a real database outage falls back to the dead-man page after its grace period instead of sending this priority-2 message.Useful? React with 👍 / 👎.