feat: support multiple webhooks per notification channel in monitor_metrics - #119
Open
jackclucas wants to merge 2 commits into
Open
feat: support multiple webhooks per notification channel in monitor_metrics#119jackclucas wants to merge 2 commits into
jackclucas wants to merge 2 commits into
Conversation
…etrics Allow each notification channel (slack, teams, email, script) to be configured as either a single mapping (existing behaviour, fully backward compatible) or a list of mappings so that the same alert is fanned out to multiple destinations - e.g. an IT Slack channel and a dev-team channel. Changes: - monitor_metrics.py: wrap dispatch loop body in an inner 'for cfg in cfg_list' loop where cfg_list is [raw_cfg] for a mapping or raw_cfg itself for a list - monitor_metrics.yaml: document the list form for the slack section with a commented-out two-webhook example All 11 existing tests pass unchanged, confirming backward compatibility.
Contributor
|
Tests for the new version too? |
Contributor
|
Sorry - been adding stuff to notifications. Can you resolve conflicts please and will look to get this in. |
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.
Summary
Customers running
monitor_metrics.py(the lslocks-based lock-contention detector) asked for the ability to send the same alert to multiple Slack channels — e.g. IT ops and a dev team — without needing to run a separate Alertmanager setup.Changes
scripts/monitor_metrics.py— each channel's config value (notifications.slack,.teams,.email,.script) may now be either a single mapping (unchanged, fully backward compatible) or a list of mappings. Every enabled entry in the list gets its own notification sent. Applies uniformly to all four channel types since they share one dispatch loop.scripts/monitor_metrics.yaml— added a commented-out example showing the two-webhook list form for theslacksection.Backward compatibility
Existing single-mapping configs work exactly as before — all 11 tests pass unchanged.
Example config (new list form)