Opsgenie api is not working with http_proxy in alertmanager version v0.24.0

47 views
Skip to first unread message

Dheerendra Solanki

unread,
Jul 14, 2025, 7:53:22 AMJul 14
to Prometheus Users
Hi, 

I am trying to access `api.opsgenie.com` by using http_proxy, https_proxy via ENV variables in alertmanager pod but its not working with opsgenie.

Could you please suggest a way to fix it as I don't have internet access in my kubernetes cluster?

Brian Candler

unread,
Jul 14, 2025, 9:41:44 AMJul 14
to Prometheus Users
You can configure a proxy directly in the configuration file, or you can set "proxy_from_environment: true". See:
The http_config: block goes inside the opsgenie_configs: block(s)

However, alertmanager v0.24.0 is more than three years old (March 2022). The current version is v0.28.1.
I don't know if these features existed in v0.24.0, but they weren't documented until a year later, in March 2023:

commit 5004dff1f84caf80f342992e815ffddea85c2667
Author: Simon Pasquier <spas...@redhat.com>
Date:   Tue Mar 28 11:35:02 2023 +0200

    docs: document the new proxy-related settings

    The version of `github.com/prometheus/common` imported by Alertmanager
    adds several fields to the `http_config` and `oauth2` structs for
    setting proxy parameters:
    * `no_proxy`
    * `proxy_from_environment`
    * `proxy_connect_header`

    Signed-off-by: Simon Pasquier <spas...@redhat.com>

Dheerendra Solanki

unread,
Jul 14, 2025, 9:59:17 AMJul 14
to Prometheus Users
I added below config in opsgenie_configs, but still same result as earlier. I tried this setup in alertmanager version v0.28.0 as well.

    http_config:
        proxy_from_environment: true


Proxy variables do populate when accessing api.opsgenie.com but getting error in response. This behavior was present also when haven't used http_config.

/alertmanager $ wget -S https://<apikey>@api.opsgenie.com/v2/alerts --no-check-certificate
Connecting to 10.2.7.10:8080 (10.2.7.10:8080)
wget: error getting response: Resource temporarily unavailable
/alertmanager $ alertmanager --version
alertmanager, version 0.28.1 (branch: HEAD, revision: b2099eaa2c9ebc25edb26517cb9c732738e93910)
  build user:       root@fa3ca569dfe4
  build date:       20250307-15:05:18
  go version:       go1.23.7
  platform:         linux/amd64
  tags:             netgo
/alertmanager $

Son Vu Thai

unread,
Jul 14, 2025, 12:14:59 PMJul 14
to Prometheus Users
Hi, Did you try to set proxy_from_environment : true

Brian Candler

unread,
Jul 14, 2025, 2:18:24 PMJul 14
to Prometheus Users
On Monday, 14 July 2025 at 14:59:17 UTC+1 Dheerendra Solanki wrote:
/alertmanager $ wget -S https://<apikey>@api.opsgenie.com/v2/alerts --no-check-certificate
Connecting to 10.2.7.10:8080 (10.2.7.10:8080)
wget: error getting response: Resource temporarily unavailable
/alertmanager $ alertmanager --version
alertmanager, version 0.28.1 (branch: HEAD, revision: b2099eaa2c9ebc25edb26517cb9c732738e93910)
  build user:       root@fa3ca569dfe4
  build date:       20250307-15:05:18
  go version:       go1.23.7
  platform:         linux/amd64
  tags:             netgo
/alertmanager $

If it's broken with wget, then this is something you'll just have to debug between your k8s cluster and your proxy.

Maybe "curl -v" will give you more detail, but "wget -S" should show you response headers, so clearly something is broken. If you're running this inside a container, maybe there's something that's stopping the container from making outbound TCP connections entirely (including to the proxy, which I guess is 10.2.7.10) - or perhaps some policy on the proxy is blocking access. Running tcpdump on the proxy and/or looking at proxy logs might help diagnose.

In any case, if wget is affected, this is nothing to do with alertmanager.

Dheerendra Solanki

unread,
Jul 16, 2025, 1:22:16 AMJul 16
to Prometheus Users
Its working now. Thanks for the help.
Reply all
Reply to author
Forward
0 new messages