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

HTTP Config custom headers OR OpsGenie heartbeat support #4314

Closed
therealgambo opened this Issue Jun 26, 2018 · 8 comments

Comments

Projects
None yet
5 participants
@therealgambo
Copy link

therealgambo commented Jun 26, 2018

Proposal

Trying to send a 'DeadManSwitch' alert to OpsGenie, however they expect a different Authorization header than what we can send via webhook

They expect Authorization GenieKey <api-key>, prometheus currently sends Authorization Bearer <api-key> when using the bearer_token setting in http_config

Bug Report

What did you do?
Tried to configure DeadManSwitch / Heartbeat for OpsGenie using Webhooks + HTTP Config

What did you expect to see?
Webhook successs

What did you see instead? Under which circumstances?
HTTP 401 error because of headers issue as stated

Environment

  • Prometheus version: 2.3.1

  • Alertmanager version: 0.15.0

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jun 26, 2018

You've got the wrong repository here, however we've discussed this in the past and do not plan on supporting OpsGenie heartbeats or similar as they give a false sense of security. An end-to-end test that goes from an alerting rule all the way through your paging provider to a deadmansswitch.

As a mater of general maintainability, we don't support bespoke or non-standard authentication methods either.

@therealgambo

This comment has been minimized.

Copy link
Author

therealgambo commented Jun 26, 2018

Do you mind sharing where exactly this was discussed in the past?

I agree with the bespoke statement, however I think the webhook functionality should at least support custom headers as this is what webhooks are exactly for, custom bespoke integrations.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jun 26, 2018

I believe it was prometheus/alertmanager#444

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jul 16, 2018

Closing this issue here, as it's an Alertmanager issue/question and this is the Prometheus repository.

@juliusv juliusv closed this Jul 16, 2018

@dano-o

This comment has been minimized.

Copy link

dano-o commented Sep 26, 2018

I know this is a closed thread but wanted to point it out regardless that it is possible to ping OpsGenie from the AlertManager without custom headers.

1.) You can simply use the apiKey in the target URL:

https://api.opsgenie.com/v2/heartbeats/heartbeatname/ping?apiKey=XXXX

2.) You can use the Basic authentication method in AlertManager. OpsGenie will accept the following:

Header Key: Authorization
Header Value: Basic base64(:$apiKey)

Basically, just leave the username empty, and use the apikey as the secret.

Hope this helps!

@therealgambo

This comment has been minimized.

Copy link
Author

therealgambo commented Sep 27, 2018

Thanks for this @dano-o. I can confirm your first solution worked, however when I tried the second option I could not get that working.

@dano-o

This comment has been minimized.

Copy link

dano-o commented Sep 27, 2018

@therealgambo I just tried Basic base64(:apikey) and it worked. Note, that the ":" is added by alertmanager, but honestly not sure - I'm more on the OpsGenie side of things. The api certainly accepts that header. Maybe try to decode the base64 and see, if it's the right format?

@VR6Pete

This comment has been minimized.

Copy link

VR6Pete commented Oct 8, 2018

Hi @dano-o - Are you setting this up as a Prometheus job in Prometheus.yml? How have you implemented this server side?

@lock lock bot locked and limited conversation to collaborators Apr 6, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.