Alertmanager slack and proxy variables ($HTTP_PROXY / $HTTPS_PROXY)

1,310 views
Skip to first unread message

chib...@gmail.com

unread,
Jan 12, 2018, 11:13:45 AM1/12/18
to Prometheus Users
Hi all,

I am running alertmanager in a box that can only access slack via http_proxy/https_proxy (using the curl command that slack has provided, it's the only way).
I have tried to define http_proxy while loading alertmanager but this doesn't send any data to slack either.

Is there a way to tweak the code so that go's http.DefaultClient can use proxy definitions as well as it is on the documentation for http's go implementaion?


Regards,
Panos

Brian Brazil

unread,
Jan 12, 2018, 11:46:09 AM1/12/18
to chib...@gmail.com, Prometheus Users
The default Go client should be picking up those environment variables, though we'll be moving to officially support it in the alertmanger config file at which point that'll be the only way to do it.

--

Panagiotis Halatsakos

unread,
Jan 12, 2018, 2:52:43 PM1/12/18
to Brian Brazil, Prometheus Users
Hi Brian,

it seems that this was not working at least for me. My setup is mainly utilizing nohup along with alertmanager like this:

nohup alertmanager -[options] &

I tried defining the exports before the nohup but no luck sending to slack. If I use the usual http_proxy=http://proxy.site:PORT curl -v https://slack-endpoint/etc/etc with the parameters given by slack it works. I am not using the latest alertmanager (the one released in 2018), but this is not the behavior I see in alertmanager.

Regards,
Panos

Matt Palmer

unread,
Jan 12, 2018, 9:11:59 PM1/12/18
to Prometheus Users
On Fri, Jan 12, 2018 at 09:52:41PM +0200, Panagiotis Halatsakos wrote:
> it seems that this was not working at least for me. My setup is mainly
> utilizing nohup along with alertmanager like this:
>
> nohup alertmanager -[options] &

How sure are you that the environment variables are actually part of the
alertmanager process' environment? Check `/proc/<pid>/environ | tr '\0'
'\n'` for starters.

- Matt

Panagiotis Halatsakos

unread,
Jan 15, 2018, 5:57:35 AM1/15/18
to Matt Palmer, Prometheus Users
Hi Matt,

the following variables are present to the proc/pid you gave me above:

http_proxy
https_proxy
HTTP_PROXY
HTTPS_PROXY

still can't see this sending to slack.

Regards,
Panos


- Matt

--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/-AHUSPjGs4c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/20180113021152.i7okhnmudkqxq4re%40hezmatt.org.
For more options, visit https://groups.google.com/d/optout.

joshua...@pearson.com

unread,
Mar 21, 2018, 1:31:36 PM3/21/18
to Prometheus Users
Hello. I'm wondering if you folks found a solution for this? I just asked basically the same question in the prometheus-operator Github repo.


On Monday, January 15, 2018 at 4:57:35 AM UTC-6, Panagiotis Halatsakos wrote:
Hi Matt,

the following variables are present to the proc/pid you gave me above:

http_proxy
https_proxy
HTTP_PROXY
HTTPS_PROXY

still can't see this sending to slack.

Regards,
Panos
On 13 January 2018 at 04:11, Matt Palmer <mpa...@hezmatt.org> wrote:
On Fri, Jan 12, 2018 at 09:52:41PM +0200, Panagiotis Halatsakos wrote:
> it seems that this was not working at least for me. My setup is mainly
> utilizing nohup along with alertmanager like this:
>
> nohup alertmanager -[options] &

How sure are you that the environment variables are actually part of the
alertmanager process' environment?  Check `/proc/<pid>/environ | tr '\0'
'\n'` for starters.

- Matt

--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/-AHUSPjGs4c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.

David Karlsen

unread,
Mar 21, 2018, 6:34:37 PM3/21/18
to joshua...@pearson.com, Prometheus Users
It works if you define the proxy variables, see: https://github.com/prometheus/alertmanager/issues/628

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/81790246-859a-4ecd-8c71-690cf2a783a6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

chib...@gmail.com

unread,
Mar 22, 2018, 1:39:17 AM3/22/18
to Prometheus Users
Hi all,

The problem is that in the environment I am working on it doesn't have docker and it has a very strict policy for everything including I am guessing proxies.
The funny thing is that if you do a curl using the proxy variable it can send a slack message, and I can see them in proc variables that they are set.

Probably it's environment-based issue so ok.

Regards,
Panos
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.

To post to this group, send email to promethe...@googlegroups.com.

David Karlsen

unread,
Mar 22, 2018, 3:18:18 AM3/22/18
to chib...@gmail.com, Prometheus Users
You don't have to run it in docker. Just set the env vars

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages