-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Manual alert for routes and receivers test #437
Comments
If you scroll to the bottom of the configuration in the web UI you should see a visualizer where you can enter label set, resembling alerts, and see where they end up. The same editor is also available here: https://prometheus.io/webtools/alerting/routing-tree-editor/ So much for the routing aspect. Actually sending something to configured receivers is not part of that. But you can always send some alerts directly to the Alertmanager API via |
@fabxc Re: “But you can always send some alerts directly to the Alertmanager API via curl.” – what's the best way to get the right format payload for testing? I was trying to adjust the formatting for email notifications and it would have been really helpful if alertmanager either had a web UI to resend an active alert or simply to copy the last n alert payloads as JSON so you could tweak & replay. |
I also wanted to test alert message formatting. Here's a sample curl command to trigger an alert. You can see the full tags of a message from prometheus by stopping the alertmanager and running "nc -k -l 9093" in it's place to grab incoming messages.
|
To add to @davidwebber 's curl example here's a Gist I found that describes some other fields, namely 'status: firing/resolved' that may enrich other's testing efforts. Also shout out to the wonderful netcat approach of grabbing messages! Just figured this may save some people some effort. https://gist.github.com/cherti/61ec48deaaab7d288c9fcf17e700853a |
for my using alertmanager version:0.8.0, the resolved alert is not tagged by status:resolved but endsAt. just like: #!/bin/bash name=$RANDOM echo "firing up alert $name" curl -XPOST $url -d '[{ echo "" echo "press enter to resolve alert" echo "sending resolve" echo "" |
I have a similar shell script:
In general however it would be nice if we shipped a nice CLI tool to trigger alerts more easily. Other use-case might actually be via shell scripts or other processes. |
This should be relatively simple to add to |
@stuartnelson3 |
It does. Perhaps this issue can be closed then? |
As creator of this issue I will close it. Thanks, guys! |
Now I must wait for real alert to test if I configured routes or receivers correctly.
It would be great to add possibility of manual alert trigger to debug/test routes and receivers. It may be added on "Status" page as a form with fields for Status, Labels and Annotations (and maybe other fields from model.Alert). It may work via API method addAlerts.
The text was updated successfully, but these errors were encountered: