alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

amtool does not have a way to specify a time to test with.

Open adyanth opened this issue 1 year ago • 5 comments

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

adyanth avatar Jun 21 '24 15:06 adyanth

Seems like a great improvement to me! Do you think you could submit a PR for this?

grobinson-grafana avatar Jun 21 '24 22:06 grobinson-grafana

Hello, do you have submitting a PR? I can work on this issue. :)

ShyunnY avatar Jun 22 '24 08:06 ShyunnY

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 avatar Jun 26 '24 21:06 adyanth

@adyanth thanks, I will try this

ShyunnY avatar Jun 27 '24 03:06 ShyunnY

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?

obitech avatar Sep 16 '24 10:09 obitech