Skip to content
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

feat: add receiver for notification #279

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

Gentleelephant
Copy link
Collaborator

No description provided.

@@ -125,7 +130,9 @@ func (s *notifyStage) Exec(ctx context.Context, l log.Logger, data interface{})
func (s *notifyStage) addExtensionLabels(receiver internal.Receiver, data []*template.Data) {
for _, d := range data {
for _, alert := range d.Alerts {
alert.Labels[constants.ReceiverName] = receiver.GetName()
if alert.Labels[constants.ReceiverName] == "" {
alert.Labels[constants.ReceiverName] = receiver.GetName()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能把 receiver 的 type 也加上吗,比如 slack 还是 wechat

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加上了

- Add ReceiverType constant in constants.go
- Update notify.go to set ReceiverType label for alerts

Signed-off-by: Gentleelephant <[email protected]>
@benjaminhuo benjaminhuo merged commit 0c9b1fe into kubesphere:master Dec 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants