prometheus / alertmanager

Prometheus Alertmanager
https://prometheus.io
Apache License 2.0
6.46k stars 2.12k forks source link

OpsGenie `api_host` incorrectly documented #3206

Open azelezni opened 1 year ago

azelezni commented 1 year ago

What did you do?

  1. Configured Alertmanager with OpsGenie receiver
  2. Created an alert in Grafana UI that will always fire

What did you expect to see? Expected Alertmanager to create a new alert in OpsGenie

What did you see instead? Under which circumstances? No alert created in OpsGenie, looking at the logs I get this error:

Notify for alerts failed" num_alerts=1 err="devops-opsgenie/opsgenie[0]: notify retry canceled due to unrecoverable error after 1 attempts: unexpected status code 405: {\"message\":\"Request method 'POST' not supported\",\"took\":0.001,\"requestId\":\"d50741e2-e518-4d31-b562-7b1d0ac21f4d\"}

Environment

Now, I was able to solve this by simply removing the key global.opsgenie_api_url, and upon reading the docs again I noticed the strange wording used:

# The host to send OpsGenie API requests to.
[ api_url: [<string>](https://prometheus.io/docs/alerting/latest/configuration/#string) | default = global.opsgenie_api_url ]

So which is it? host or url? this is a big distinction and the above just makes it confusing. The default value configured at global.opsgenie_api_url is https://api.opsgenie.com/, this is a URL.

simonpasquier commented 1 year ago

:wave: why did you change the default opsgenie_api_url value? It should be the base URL of the OpsGenie API (e.g. https://api.opsgenie.com/ or https://api.eu.opsgenie.com/).

azelezni commented 1 year ago

Well that's why I'm here isn't it, the documentation isn't clear at all about the actual value. The doc says: The host to send OpsGenie API requests to The key is: api_url but the actual expected value is the root URL?

simonpasquier commented 1 year ago

but the actual expected value is the root URL?

yes, feel free to send a PR to improve the documentation :)