From c09fe72d24905d0ba8902357343433214a84dac3 Mon Sep 17 00:00:00 2001 From: Kunal Gupta <39487888+iamKunalGupta@users.noreply.github.com> Date: Tue, 12 Mar 2024 23:18:46 +0530 Subject: [PATCH] chore: add log on email alert errors --- flow/alerting/email_alert_sender.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flow/alerting/email_alert_sender.go b/flow/alerting/email_alert_sender.go index ec55d377ea..20d85a3c82 100644 --- a/flow/alerting/email_alert_sender.go +++ b/flow/alerting/email_alert_sender.go @@ -2,11 +2,12 @@ package alerting import ( "context" - + "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ses" "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/PeerDB-io/peer-flow/logger" "github.com/PeerDB-io/peer-flow/peerdbenv" "github.com/PeerDB-io/peer-flow/shared/aws_common" ) @@ -64,6 +65,9 @@ func (e *EmailAlertSender) sendAlert(ctx context.Context, alertTitle string, ale }, }) if err != nil { + logger.LoggerFromCtx(ctx).Warn(fmt.Sprintf( + "Error sending email alert from %v to %s subject=[%s], body=[%s], configurationSet=%s, replyToAddresses=[%v]", + e.sourceEmail, e.emailAddresses, alertTitle, alertMessage, e.configurationSetName, e.replyToAddresses)) return err } return nil