From 38ee8ad9370081ca6e9eeb472cc4295adde30c59 Mon Sep 17 00:00:00 2001 From: TJ Hoplock <t.hoplock@gmail.com> Date: Wed, 6 Nov 2024 11:04:09 -0500 Subject: [PATCH] ref(webhook): return error if unable to parse group key Addresses feedback from another PR https://github.com/prometheus/alertmanager/pull/4089#discussion_r1824480384 Signed-off-by: TJ Hoplock <t.hoplock@gmail.com> --- notify/webhook/webhook.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/notify/webhook/webhook.go b/notify/webhook/webhook.go index 1b5546ddbe..9464d71cee 100644 --- a/notify/webhook/webhook.go +++ b/notify/webhook/webhook.go @@ -82,12 +82,10 @@ func (n *Notifier) Notify(ctx context.Context, alerts ...*types.Alert) (bool, er groupKey, err := notify.ExtractGroupKey(ctx) if err != nil { - // @tjhop: should we `return false, err` here as we do in most - // other Notify() implementations? - n.logger.Error("error extracting group key", "err", err) + return false, err } - // @tjhop: should we debug log the key here like most other Notify() implementations? + n.logger.Debug("extracted group key", "incident", groupKey) msg := &Message{ Version: "4",