diff --git a/go.mod b/go.mod index d01a00adc3b..3ee335564ef 100644 --- a/go.mod +++ b/go.mod @@ -78,7 +78,7 @@ require ( github.com/googleapis/gax-go/v2 v2.12.3 // @grafana/grafana-backend-group github.com/gorilla/mux v1.8.1 // @grafana/grafana-backend-group github.com/gorilla/websocket v1.5.0 // @grafana/grafana-app-platform-squad - github.com/grafana/alerting v0.0.0-20240607182251-835aff588914 // @grafana/alerting-backend + github.com/grafana/alerting v0.0.0-20240712142914-5558735b4462 // @grafana/alerting-backend github.com/grafana/authlib v0.0.0-20240711083030-f139ff397f7b // @grafana/identity-access-team github.com/grafana/codejen v0.0.3 // @grafana/dataviz-squad github.com/grafana/cuetsy v0.1.11 // @grafana/grafana-as-code @@ -481,7 +481,7 @@ replace github.com/crewjam/saml => github.com/grafana/saml v0.4.15-0.20240523142 // Use our fork of the upstream alertmanagers. // This is required in order to get notification delivery errors from the receivers API. -replace github.com/prometheus/alertmanager => github.com/grafana/prometheus-alertmanager v0.25.1-0.20240422145632-c33c6b5b6e6b +replace github.com/prometheus/alertmanager => github.com/grafana/prometheus-alertmanager v0.25.1-0.20240625192351-66ec17e3aa45 exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible diff --git a/go.sum b/go.sum index 2f13b9b60be..6e397d30d75 100644 --- a/go.sum +++ b/go.sum @@ -2305,8 +2305,8 @@ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grafana/alerting v0.0.0-20240607182251-835aff588914 h1:WXLbSnnomltxdNcE20CI8RD8quZ/L0YpXP0WK+0S1BU= -github.com/grafana/alerting v0.0.0-20240607182251-835aff588914/go.mod h1:U7Ta3K4T7jVgqGSYuPsfuPKHFiL2GbCZSHa3nHjmCos= +github.com/grafana/alerting v0.0.0-20240712142914-5558735b4462 h1:MWpvVoPcSej4YfxSIuAllr9vg0UgVEG5CQifD5fK+ps= +github.com/grafana/alerting v0.0.0-20240712142914-5558735b4462/go.mod h1:DLj8frbtCaITljC2jc0L85JQViPF3mPfOSiYhm1osso= github.com/grafana/authlib v0.0.0-20240711083030-f139ff397f7b h1:gSVS/MIIP3C9ZbGaboOCtzDm3D5roR4m6NDkxyAMjyI= github.com/grafana/authlib v0.0.0-20240711083030-f139ff397f7b/go.mod h1:+MjD5sxxgLOIvw0ox18wJmjBzz8tOECo7quiiZAmgJY= github.com/grafana/codejen v0.0.3 h1:tAWxoTUuhgmEqxJPOLtJoxlPBbMULFwKFOcRsPRPXDw= @@ -2350,8 +2350,8 @@ github.com/grafana/grafana/pkg/util/xorm v0.0.1 h1:72QZjxWIWpSeOF8ob4aMV058kfgZy github.com/grafana/grafana/pkg/util/xorm v0.0.1/go.mod h1:eNfbB9f2jM8o9RfwqwjY8SYm5tvowJ8Ly+iE4P9rXII= github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8= github.com/grafana/otel-profiling-go v0.5.1/go.mod h1:ftN/t5A/4gQI19/8MoWurBEtC6gFw8Dns1sJZ9W4Tls= -github.com/grafana/prometheus-alertmanager v0.25.1-0.20240422145632-c33c6b5b6e6b h1:HCbWyVL6vi7gxyO76gQksSPH203oBJ1MJ3JcG1OQlsg= -github.com/grafana/prometheus-alertmanager v0.25.1-0.20240422145632-c33c6b5b6e6b/go.mod h1:01sXtHoRwI8W324IPAzuxDFOmALqYLCOhvSC2fUHWXc= +github.com/grafana/prometheus-alertmanager v0.25.1-0.20240625192351-66ec17e3aa45 h1:AJKOtDKAOg8XNFnIZSmqqqutoTSxVlRs6vekL2p2KEY= +github.com/grafana/prometheus-alertmanager v0.25.1-0.20240625192351-66ec17e3aa45/go.mod h1:01sXtHoRwI8W324IPAzuxDFOmALqYLCOhvSC2fUHWXc= github.com/grafana/pyroscope-go/godeltaprof v0.1.7 h1:C11j63y7gymiW8VugJ9ZW0pWfxTZugdSJyC48olk5KY= github.com/grafana/pyroscope-go/godeltaprof v0.1.7/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= github.com/grafana/pyroscope/api v0.3.0 h1:WcVKNZ8JlriJnD28wTkZray0wGo8dGkizSJXnbG7Gd8= diff --git a/go.work.sum b/go.work.sum index 4f2cc78d04e..5c0b83e6359 100644 --- a/go.work.sum +++ b/go.work.sum @@ -416,6 +416,8 @@ github.com/grafana/e2e v0.1.1-0.20221018202458-cffd2bb71c7b h1:Ha+kSIoTutf4ytlVw github.com/grafana/e2e v0.1.1-0.20221018202458-cffd2bb71c7b/go.mod h1:3UsooRp7yW5/NJQBlXcTsAHOoykEhNUYXkQ3r6ehEEY= github.com/grafana/e2e v0.1.1 h1:/b6xcv5BtoBnx8cZnCiey9DbjEc8z7gXHO5edoeRYxc= github.com/grafana/e2e v0.1.1/go.mod h1:RpNLgae5VT+BUHvPE+/zSypmOXKwEu4t+tnEMS1ATaE= +github.com/grafana/prometheus-alertmanager v0.25.1-0.20240422145632-c33c6b5b6e6b h1:HCbWyVL6vi7gxyO76gQksSPH203oBJ1MJ3JcG1OQlsg= +github.com/grafana/prometheus-alertmanager v0.25.1-0.20240422145632-c33c6b5b6e6b/go.mod h1:01sXtHoRwI8W324IPAzuxDFOmALqYLCOhvSC2fUHWXc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= diff --git a/pkg/apiserver/go.mod b/pkg/apiserver/go.mod index 897519e8a68..02c45a35ce4 100644 --- a/pkg/apiserver/go.mod +++ b/pkg/apiserver/go.mod @@ -3,7 +3,6 @@ module github.com/grafana/grafana/pkg/apiserver go 1.21.10 require ( - github.com/bwmarrin/snowflake v0.3.0 github.com/google/go-cmp v0.6.0 github.com/grafana/grafana/pkg/apimachinery v0.0.0-20240701135906-559738ce6ae1 github.com/prometheus/client_golang v1.19.1 diff --git a/pkg/apiserver/go.sum b/pkg/apiserver/go.sum index 2f5d7253ff3..75eaa231ca3 100644 --- a/pkg/apiserver/go.sum +++ b/pkg/apiserver/go.sum @@ -6,8 +6,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= -github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= diff --git a/pkg/build/go.mod b/pkg/build/go.mod index 4542a341f4c..86ccb753357 100644 --- a/pkg/build/go.mod +++ b/pkg/build/go.mod @@ -129,7 +129,7 @@ replace github.com/crewjam/saml => github.com/grafana/saml v0.4.15-0.20240523142 // Use our fork of the upstream alertmanagers. // This is required in order to get notification delivery errors from the receivers API. -replace github.com/prometheus/alertmanager => github.com/grafana/prometheus-alertmanager v0.25.1-0.20240422145632-c33c6b5b6e6b +replace github.com/prometheus/alertmanager => github.com/grafana/prometheus-alertmanager v0.25.1-0.20240625192351-66ec17e3aa45 exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible diff --git a/pkg/services/ngalert/notifier/email_test.go b/pkg/services/ngalert/notifier/email_test.go index 391fba8eac1..beb0251e17d 100644 --- a/pkg/services/ngalert/notifier/email_test.go +++ b/pkg/services/ngalert/notifier/email_test.go @@ -222,13 +222,6 @@ func (e emailSender) SendWebhook(ctx context.Context, cmd *receivers.SendWebhook } func (e emailSender) SendEmail(ctx context.Context, cmd *receivers.SendEmailSettings) error { - attached := make([]*notifications.SendEmailAttachFile, 0, len(cmd.AttachedFiles)) - for _, file := range cmd.AttachedFiles { - attached = append(attached, ¬ifications.SendEmailAttachFile{ - Name: file.Name, - Content: file.Content, - }) - } return e.ns.SendEmailCommandHandlerSync(ctx, ¬ifications.SendEmailCommandSync{ SendEmailCommand: notifications.SendEmailCommand{ To: cmd.To, @@ -236,10 +229,8 @@ func (e emailSender) SendEmail(ctx context.Context, cmd *receivers.SendEmailSett Template: cmd.Template, Subject: cmd.Subject, Data: cmd.Data, - Info: cmd.Info, ReplyTo: cmd.ReplyTo, EmbeddedFiles: cmd.EmbeddedFiles, - AttachedFiles: attached, }, }) } diff --git a/pkg/services/ngalert/notifier/sender.go b/pkg/services/ngalert/notifier/sender.go index 11c17c12d8a..55677c987d2 100644 --- a/pkg/services/ngalert/notifier/sender.go +++ b/pkg/services/ngalert/notifier/sender.go @@ -26,16 +26,6 @@ func (s sender) SendWebhook(ctx context.Context, cmd *receivers.SendWebhookSetti } func (s sender) SendEmail(ctx context.Context, cmd *receivers.SendEmailSettings) error { - var attached []*notifications.SendEmailAttachFile - if cmd.AttachedFiles != nil { - attached = make([]*notifications.SendEmailAttachFile, 0, len(cmd.AttachedFiles)) - for _, file := range cmd.AttachedFiles { - attached = append(attached, ¬ifications.SendEmailAttachFile{ - Name: file.Name, - Content: file.Content, - }) - } - } return s.ns.SendEmailCommandHandlerSync(ctx, ¬ifications.SendEmailCommandSync{ SendEmailCommand: notifications.SendEmailCommand{ To: cmd.To, @@ -43,10 +33,8 @@ func (s sender) SendEmail(ctx context.Context, cmd *receivers.SendEmailSettings) Template: cmd.Template, Subject: cmd.Subject, Data: cmd.Data, - Info: cmd.Info, ReplyTo: cmd.ReplyTo, EmbeddedFiles: cmd.EmbeddedFiles, - AttachedFiles: attached, }, }) } diff --git a/pkg/services/ngalert/remote/alertmanager_test.go b/pkg/services/ngalert/remote/alertmanager_test.go index b04c7194ee0..e3d923f0ea3 100644 --- a/pkg/services/ngalert/remote/alertmanager_test.go +++ b/pkg/services/ngalert/remote/alertmanager_test.go @@ -767,6 +767,7 @@ global: http_config: follow_redirects: true enable_http2: true + http_headers: null smtp_hello: localhost smtp_require_tls: true pagerduty_url: https://events.pagerduty.com/v2/enqueue diff --git a/pkg/tests/api/alerting/api_alertmanager_test.go b/pkg/tests/api/alerting/api_alertmanager_test.go index 040b80ffcec..37d433c6439 100644 --- a/pkg/tests/api/alerting/api_alertmanager_test.go +++ b/pkg/tests/api/alerting/api_alertmanager_test.go @@ -1974,7 +1974,7 @@ func TestIntegrationAlertmanagerCreateSilence(t *testing.T) { StartsAt: util.Pointer(strfmt.DateTime(time.Now())), }, }, - expErr: "unable to upsert silence: silence invalid: invalid label matcher 0: invalid label name \"\": unable to create silence", + expErr: "unable to upsert silence: invalid silence: invalid label matcher 0: invalid label name \"\": unable to create silence", }, { name: "can't create silence for missing label value", silence: apimodels.PostableSilence{ @@ -1991,7 +1991,7 @@ func TestIntegrationAlertmanagerCreateSilence(t *testing.T) { StartsAt: util.Pointer(strfmt.DateTime(time.Now())), }, }, - expErr: "unable to upsert silence: silence invalid: at least one matcher must not match the empty string: unable to create silence", + expErr: "unable to upsert silence: invalid silence: at least one matcher must not match the empty string: unable to create silence", }} for _, tc := range cases {