-
Notifications
You must be signed in to change notification settings - Fork 23
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
Include documentation on how to run the alertmanager with Prometheus #49
Comments
Hello, @hemajv I can provide some hints based on our use-case. The basic flow of alerts is: prometheus (generates alerts) -> alertmanager (routes alerts) -> github-receiver (receives alert) This is our deployment of the github-receiver in k8s: https://github.com/m-lab/prometheus-support/blob/master/k8s/prometheus-federation/deployments/github-receiver.yml The main setup is to create a personal github auth token with permission to create issues in your target repo(s). Otherwise the reciever just waits to get alert events from the alertmanager. The k8s config also includes a service definition: https://github.com/m-lab/prometheus-support/blob/master/k8s/prometheus-federation/services/github-receiver-service.yml which produces a name usable in-cluster like:
That URL should be added to the alertmanager config, such as in: We have similar configs to point prometheus at the alertmanager: https://github.com/m-lab/prometheus-support/blob/master/config/federation/prometheus/prometheus.yml.template#L30 Please let us know if you have additional questions or suggestions for what kind of documentation would be most helpful. I imagine that everyone's deployment environment will be a little different. But there are a lot of pieces, so I understand the need to have better breadcrumbs. |
@stephen-soltesz thank you so much for providing the additional documentation/guides! We were able to deploy and test our Prometheus alerts with the GitHub alertmanager receiver 😃 Another question I had was, how do I modify the alert message in the issue created in the repo? For eg, in this issue, how do I modify the URLs being displayed and also is it possible to tag someone to the issue? |
Hello, @hemajv -- Great, I'm glad to hear you've got things running! Right now the issue template is static, and defined here: We would be happy to review/accept changes that make the template an input parameter while preserving default behavior. For automated assignment, I recommend searching for github automation solutions. For example, https://github.com/apps/auto-assign-issues or https://github.com/marketplace/actions/auto-assign-issue (note the very subtle name difference). I've not used these personally, and there are many other options than just these. These are just examples of what is a common use-case that I'm sure you can find to meet your needs better than a feature in the github-receiver could. |
Hi @stephen-soltesz, another question I had was how do we remove the |
And the links in the issues are not clickable, is there a way we can modify/define the appropriate URLs in the issues? |
@hemajv additional labels may be specified as flags in the github-reciever configuration -- see: https://github.com/operate-first/apps/blob/master/odh/base/monitoring/github-receiver.yaml#L32 This adds the label automatically when the issue is created, but they are never removed by the github-receiver. The idea was that these labels would be part of an interface to down stream automation (like the label automation links above), or simply handled manually by a person. The links in https://github.com/operate-first/SRE/issues/119 look like they're k8s service addresses. These allow services to talk to one another within the k8s cluster, but as you've found do not work outside the cluster. These are the service names configured in prometheus and known to the alertmanager. See for example the
|
@stephen-soltesz I see, so I want to update the |
Using the existing version of the github-reciever, it would be necessary to use the --web.external-url flags to make sure clickable links are plumbed through. I would be open to PRs that make the currently static issue template configurable, e.g. read from a file. https://github.com/m-lab/alertmanager-github-receiver/blob/master/alerts/template.go#L54 However, I won't be able to do this myself anytime soon. But, reviews are no problem. |
@stephen-soltesz thank you for the clarification! So as I understand it, we will need to add the |
I have the Github alertmanager receiver running locally, and I have a prometheus instance deployed. How do I route my alerts from prometheus to my locally running github receiver? I couldn't find a good documentation on how I can do this.
Additional documentation on the various arguments supported for the github receiver along with examples on how to configure them would be useful!
(This is related to our work in operate-first/sre#19)
The text was updated successfully, but these errors were encountered: