Repository navigation
feat: add alert function templates - #507
Merged
Merged
Conversation
Three Node templates that act on monitor alert events: alerts-to-chat posts firing and resolved alerts to Slack, Discord, Teams or Google Chat; pause-on-usage-spike disables the function or site a usage monitor is scoped to; uptime-incident-log records uptime alerts as incident rows and notifies a Messaging topic.
Alert IDs are 32 characters, so the state and channel suffix has to stay at three.
Code review
Adds three Node.js templates for monitor alert events: chat notifications, pausing scoped resources on usage alerts, and recording uptime incidents with optional topic notifications. Each template includes setup documentation, dependency manifests and lockfiles, and its function implementation. Walkthrough (3)
Reviewed Tip Comment |
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.

Three Node templates that act on monitor alert events (
monitors.*.alerts.*.firing/.resolved).node/alerts-to-chatCHAT_TARGET)node/pause-on-usage-spikeMIN_SEVERITY+; ignores project-wide alerts and itself; never auto re-enablesfunctions.*,sites.*node/uptime-incident-logtopics.read,messages.writeeventtrigger (403), so a forged HTTP call to the function domain does nothing.firingnever reopens a resolved one); topic messages use fixed IDs per incident and state.Verified end to end against a local stack with real monitors (screenshots in the server PR). Needs a
1.6.0tag after merge; the server config pins it.