From 1f7e42a85586490dcc452f8a84388107778e13d0 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sun, 26 Sep 2021 23:13:37 +0200 Subject: [PATCH] Enable HTTP 2 again We are re-enabling HTTP 2 again. There has been a few bugfixes upstream in go, and we have also enabled ReadIdleTimeout. Signed-off-by: Julien Pivotto --- go.mod | 2 +- go.sum | 2 ++ notify/opsgenie/opsgenie.go | 2 +- notify/pagerduty/pagerduty.go | 2 +- notify/pushover/pushover.go | 2 +- notify/slack/slack.go | 2 +- notify/sns/sns.go | 2 +- notify/victorops/victorops.go | 2 +- notify/webhook/webhook.go | 2 +- notify/wechat/wechat.go | 2 +- 10 files changed, 11 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index b9e1c40f73..fc558a914a 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/oklog/ulid v1.3.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 - github.com/prometheus/common v0.30.0 + github.com/prometheus/common v0.31.0 github.com/prometheus/common/sigv4 v0.1.0 github.com/prometheus/exporter-toolkit v0.6.1 github.com/rs/cors v1.8.0 diff --git a/go.sum b/go.sum index d517b11dc9..d8d0245e20 100644 --- a/go.sum +++ b/go.sum @@ -416,6 +416,8 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9 github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.31.0 h1:FTJdLTjtrh4dXlCjpzdZJXMnejSTL5F/nVQm5sNwD34= +github.com/prometheus/common v0.31.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.6.1 h1:Aqk75wQD92N9CqmTlZwjKwq6272nOGrWIbc8Z7+xQO0= diff --git a/notify/opsgenie/opsgenie.go b/notify/opsgenie/opsgenie.go index 89ae217d32..5419cbea5b 100644 --- a/notify/opsgenie/opsgenie.go +++ b/notify/opsgenie/opsgenie.go @@ -45,7 +45,7 @@ type Notifier struct { // New returns a new OpsGenie notifier. func New(c *config.OpsGenieConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { - client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "opsgenie", append(httpOpts, commoncfg.WithHTTP2Disabled())...) + client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "opsgenie", httpOpts...) if err != nil { return nil, err } diff --git a/notify/pagerduty/pagerduty.go b/notify/pagerduty/pagerduty.go index 3e90db7c60..6c6465f544 100644 --- a/notify/pagerduty/pagerduty.go +++ b/notify/pagerduty/pagerduty.go @@ -49,7 +49,7 @@ type Notifier struct { // New returns a new PagerDuty notifier. func New(c *config.PagerdutyConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { - client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "pagerduty", append(httpOpts, commoncfg.WithHTTP2Disabled())...) + client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "pagerduty", httpOpts...) if err != nil { return nil, err } diff --git a/notify/pushover/pushover.go b/notify/pushover/pushover.go index 5dd555d7d7..eae0af0075 100644 --- a/notify/pushover/pushover.go +++ b/notify/pushover/pushover.go @@ -43,7 +43,7 @@ type Notifier struct { // New returns a new Pushover notifier. func New(c *config.PushoverConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { - client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "pushover", append(httpOpts, commoncfg.WithHTTP2Disabled())...) + client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "pushover", httpOpts...) if err != nil { return nil, err } diff --git a/notify/slack/slack.go b/notify/slack/slack.go index b297caea98..08dd783b7c 100644 --- a/notify/slack/slack.go +++ b/notify/slack/slack.go @@ -43,7 +43,7 @@ type Notifier struct { // New returns a new Slack notification handler. func New(c *config.SlackConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { - client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "slack", append(httpOpts, commoncfg.WithHTTP2Disabled())...) + client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "slack", httpOpts...) if err != nil { return nil, err } diff --git a/notify/sns/sns.go b/notify/sns/sns.go index c947b1b6fa..281e46a880 100644 --- a/notify/sns/sns.go +++ b/notify/sns/sns.go @@ -48,7 +48,7 @@ type Notifier struct { // New returns a new SNS notification handler. func New(c *config.SNSConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { - client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "sns", append(httpOpts, commoncfg.WithHTTP2Disabled())...) + client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "sns", httpOpts...) if err != nil { return nil, err } diff --git a/notify/victorops/victorops.go b/notify/victorops/victorops.go index 8b83546fdc..3fdbf41dc1 100644 --- a/notify/victorops/victorops.go +++ b/notify/victorops/victorops.go @@ -42,7 +42,7 @@ type Notifier struct { // New returns a new VictorOps notifier. func New(c *config.VictorOpsConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { - client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "victorops", append(httpOpts, commoncfg.WithHTTP2Disabled())...) + client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "victorops", httpOpts...) if err != nil { return nil, err } diff --git a/notify/webhook/webhook.go b/notify/webhook/webhook.go index 59c7ee5ffa..00c525024b 100644 --- a/notify/webhook/webhook.go +++ b/notify/webhook/webhook.go @@ -41,7 +41,7 @@ type Notifier struct { // New returns a new Webhook. func New(conf *config.WebhookConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { - client, err := commoncfg.NewClientFromConfig(*conf.HTTPConfig, "webhook", append(httpOpts, commoncfg.WithHTTP2Disabled())...) + client, err := commoncfg.NewClientFromConfig(*conf.HTTPConfig, "webhook", httpOpts...) if err != nil { return nil, err } diff --git a/notify/wechat/wechat.go b/notify/wechat/wechat.go index 63f9ab4ec6..762d467ad7 100644 --- a/notify/wechat/wechat.go +++ b/notify/wechat/wechat.go @@ -72,7 +72,7 @@ type weChatResponse struct { // New returns a new Wechat notifier. func New(c *config.WechatConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { - client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "wechat", append(httpOpts, commoncfg.WithHTTP2Disabled())...) + client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "wechat", httpOpts...) if err != nil { return nil, err }