Add label-based Slack channel routing - #7
Merged
Merged
Conversation
vaclav-dvorak
approved these changes
Jul 13, 2026
Route alerts to different Slack channels based on pod label rules. Each route lists label regexes (all must match) and one or more target channels; all matching routes apply with channels deduplicated. Events matching no route, and label-less messages (PVC alerts, startup ping), fall back to the default channel. Token mode only; webhook mode ignores routes with a warning. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
smolaon
force-pushed
the
slack-label-routing
branch
from
July 13, 2026 14:49
6a714d3 to
05561a6
Compare
A route with includeDefault: true also sends matching events to the default channel (dual-send), without hardcoding its name in the route. Needed because the default channel may come from the SLACK_CHANNEL environment variable and vary per deployment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
|
Added |
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
^...$to anchor) and one or more target channels; all matching routes apply, channels deduplicated in first-seen orderchannel; webhook mode is unchanged and ignoresrouteswith a warningerrors.Joinand don't block remaining channelsSLACK_TOKEN/SLACK_CHANNELenv fallback (feat(slack): Add environment variable fallback for config #6): credentials come from the Secret-backed env vars, while the non-secretroutesstay in the ConfigMap-mounted config fileConfig example
Test plan
go build ./...,go vet, package tests green after rebase onto main (includes added support for slack token #3 token support and feat(slack): Add environment variable fallback for config #6 env fallback)LoadConfig→NewSlackpath🤖 Generated with Claude Code