-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic alerting, refactored to use slack-go instead (#866)
For now, an alerting function logs an entry in an alerts table in catalog, and also dispatches notifications to one or more slack channels. Events are staggered to be atleast 15 minutes apart by default, as long as the same "alert key" is used. This delay can be configured via the `PEERDB_ALERTING_GAP_MINUTES` environment variable, and alerts can be disabled by setting it to 0. Logs alerts in the following 2 cases for now: 1) When computed slot size of a peer exceeds a threshold, which is `5000MB` by default. This limit is configurable via the environment variable `PEERDB_SLOT_LAG_MB_ALERT_THRESHOLD`. Setting it to 0 should disable this type of alerts entirely. 2) When the number of connections from the configured user for a peer exceed a threshold, which is 5 by default. This limit is configurable by the environment variable `PEERDB_PGPEER_OPEN_CONNECTIONS_ALERT_THRESHOLD`. Setting it to 0 should disable this type of alerts entirely. To configure alerting, insert a row into the `peerdb_stats.alerting_config` table like this: ``` INSERT INTO peerdb_stats.alerting_config(service_type,service_config) VALUES('slack','{"auth_token": "SLACK_AUTH_TOKEN", "channel_ids": ["SLACK_CHANNEL","IDS_IN_ARRAY"]}'); ``` --------- Co-authored-by: Philip Dubé <[email protected]> Co-authored-by: Kaushik Iska <[email protected]>
- Loading branch information
1 parent
65c585a
commit 08861aa
Showing
19 changed files
with
602 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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
Oops, something went wrong.