amtool does not have a way to specify a time to test with.
amtool config routes test does not have a way to specify a time to test with.
What did you do? Try to use amtool to validate alerting configuration based on time_intervals
What did you expect to see? Be able to do it
What did you see instead? Under which circumstances? No option to specify a time for validation
Environment N/A
-
System information: N/A
-
Alertmanager version: N/A
-
Prometheus version: N/A
-
Alertmanager configuration file: N/A
-
Prometheus configuration file: N/A
-
Logs: N/A
Seems like a great improvement to me! Do you think you could submit a PR for this?
Hello, do you have submitting a PR? I can work on this issue. :)
The way it is structured right now, the alerting intervals are handled through context, which needs an active alert object to test on, which is not done in test_routing.go.
Please feel free to take a stab at it @ShyunnY
@adyanth thanks, I will try this
I'm in the same position where I would like t test if a an active_time_interval or mute_time_interval is working correctly (does it send/mute an alert at specific time?)
I'm not familiar at all with the alertmanager code but looking at it, it seems that amtool config routes test will test for the provided labels with a Route object. But doesn't the mute/active decision happen in a stage in the dispatcher? So the decision is made before notifying the receiver, not at the config level. I'm not sure how amtool can even test this behaviour here?