m-lab / alertmanager-github-receiver

Prometheus Alertmanager webhook receiver that creates GitHub issues from alerts
Apache License 2.0
48 stars 23 forks source link

Different org/repo per alert #23

Open Daniel15 opened 5 years ago

Daniel15 commented 5 years ago

The readme says:

To start the github receiver locally:

docker run -it measurementlab/alertmanager-github-receiver:latest
        -authtoken=$(GITHUB_AUTH_TOKEN) -org=<org> -repo=<repo>

Is it possible to configure the org and repo per alert, or would I need to run multiple instances of the receiver? I want to configure several alerts across several different Github org and repositories, using a single Prometheus instance.

Daniel15 commented 5 years ago

I see that different repos are supported (as per #4) but it looks like the org is still static. Would be good to be able to customize the org too.

stephen-soltesz commented 5 years ago

Hi, @Daniel15, can you say more about the specific use case where this would be helpful? This makes authorization more difficult. While the current version supports personal auth tokens, I would like to move to the Github App auth model which would make arbitrary org routing impossible.

If you're willing to run multiple alertmanager-github-receiver instances, then alertmanager routes could address your use-case today.

Daniel15 commented 5 years ago

can you say more about the specific use case where this would be helpful

@stephen-soltesz - I'm a member of a few Github orgs. I have one Prometheus instance that collects metrics relating to a few of them. It would be nice to have some way to use one Prometheus + one alertmanager + one alertrmanager-github-receiver to handle alerts for all of them.

If you're willing to run multiple alertmanager-github-receiver instances, then alertmanager routes could address your use-case today.

That's probably a reasonable idea... I assume the github-receiver doesn't take much RAM or CPU so running a few instances would be fine. I haven't actually tried it out yet.

While the current version supports personal auth tokens, I would like to move to the Github App auth model which would make arbitrary org routing impossible.

Would that actually make it more difficult? I think you could just authorize the Github App for multiple orgs?