Skip to content

Conversation

@pracucci
Copy link
Contributor

@pracucci pracucci commented Apr 16, 2021

In Cortex we have a use case where we would need to customize the dialer used by the HTTP client in the upstream Prometheus alertmanager. Specifically, we're trying to customise the dialer used by HTTP client used by Alertmanager notifiers (eg. webhook). Unfortunately we can't do it without changing it upstream so, in this PR, I'm proposing to add HTTP options to receveirs New() functions.

@pracucci pracucci force-pushed the allow-to-customize-http-client-in-receiver-integrations branch from 669aac2 to 04d683e Compare April 21, 2021 10:01
@pracucci pracucci marked this pull request as ready for review April 21, 2021 10:02

// New returns a new OpsGenie notifier.
func New(c *config.OpsGenieConfig, t *template.Template, l log.Logger) (*Notifier, error) {
client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "opsgenie", false, false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The boolean flags in the previous version of commoncfg.NewClientFromConfig() were related to disableKeepAlives, enableHTTP2 bool, so false, false did mean "keepalive enabled, HTTP2 disabled". Keepalive and HTTP2 are now enabled by default so, to keep the same exact behaviour, I'm adding WithHTTP2Disabled().

Same comment applies to all other receiver integrations.

@roidelapluie roidelapluie merged commit cb8a467 into prometheus:master Apr 22, 2021
@roidelapluie
Copy link
Member

Thanks!

@pracucci pracucci deleted the allow-to-customize-http-client-in-receiver-integrations branch April 22, 2021 10:02
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