Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of sending custom header in Alertmanagers in operatorconfig #307

Open
kartik7153 opened this issue Aug 18, 2022 · 10 comments
Open
Labels
enhancement New feature or request

Comments

@kartik7153
Copy link

kartik7153 commented Aug 18, 2022

Hi,
We are running our cortex and want to use alertmanager for cortex for routing the alerts. I couldn't see support for adding headers in alertmanagers

@lyanco
Copy link
Collaborator

lyanco commented Aug 18, 2022

Sorry, I don't understand... GMP has nothing to do with Cortex. What are you trying to accomplish?

@kartik7153
Copy link
Author

I am trying to use cortex's alertmanager to push alert to respective channels.

@lyanco
Copy link
Collaborator

lyanco commented Aug 19, 2022

OK, I'm not familiar with that. Why do you need headers to be able to communicate with it?

@kartik7153
Copy link
Author

So cortex's alert-manager needs X-Scope-OrgID to be able to authenticate the request and to be able to figure out the tenant. more on this here.

@kartik7153
Copy link
Author

Hi any updates on this?

@pintohutch
Copy link
Collaborator

Hi @kartik7153 - IIUC you want the ability to add a custom header to the alert HTTP request going to the configured alertmanager endpoint?

@kartik7153
Copy link
Author

Yes right.

@pintohutch
Copy link
Collaborator

At this point in time, Prometheus does not support custom HTTP headers in its config. The idea has been discussed from the scrape side, but was decided against.

However, this should be possible through a forwarding proxy in the proxy_url section of alertmanager_config. In fact, someone on that thread suggested a solution using an nginx container that works for scraping. I wonder if the same thing can work from the alerting side.

@pintohutch
Copy link
Collaborator

Note - this soon may be possible with prometheus/common#416..

@pintohutch pintohutch added the enhancement New feature or request label Jan 20, 2023
@gviczai
Copy link

gviczai commented Nov 5, 2023

At this point in time, Prometheus does not support custom HTTP headers in its config. The idea has been discussed from the scrape side, but was decided against.

However, this should be possible through a forwarding proxy in the proxy_url section of alertmanager_config. In fact, someone on that thread suggested a solution using an nginx container that works for scraping. I wonder if the same thing can work from the alerting side.

I have some issues about this "use a proxy" workaround as the "official solution". Also the "decided against" is actually a very short conversation, not a real discussion with arguments and counter-arguments, just an "I don't think this is the responsibility of the scraper." statement. I have a counter-argument however, I think it IS the responsibility of the scraper to set headers required by the exporter. No third-party man-in-the-middle service should be required just for doing that. Details in prometheus/prometheus#13098.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants