Force_resolve query

Wanted to know if there is any way to resolve a sensu alert automatically after it is triggered.
Background:
Just want an alert to trigger and then resolve immediately (even if the check is not resolved).
I tried to add force_resolve as true. But the check is still in alarm state.

Is there any way to resolve the alert automatically once it is triggered?

Hmm it’s probably possible but I am compelled to ask what the use case is. I feel like there is probably a better path forward.

Hi Ben,

Thank you for your response.
Use case:
When an alert triggers for a non-critical service(not in production yet), it should trigger the alarm to the respective team for them to look into the issue later. But the check should auto-resolve, without manual intervention.

I see, I would probably do something like this: https://github.com/sensu-plugins/sensu-plugins-pagerduty/issues/30#issuecomment-289813445 but instead of a mutator create a handler that silences the alert. It does not resolve it because its truly broken but you can at least prevent it from alerting people.

Hey Ben,

Thank you so much for helping me out. This would work for pagerduty alert resolution. But I would need to resolve the sensu check itself until the next interval. Can this be done in any way.

Regards,
Saumya

Hey sorry I never saw this and am sure you already solved this but for someone elses benefit looking for the same. I have a couple of thoughts and I am not sure I understand the objectives well enough to know what is desired here. One thought I have is to leverage the silence api in sensu to basically have no further handle events. It’s not the same as resolved but it might be close enough to what you are looking for.