-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Reactor alert on highstate fail #28569
Comments
Got it to work with the following hack, but my question remains, is there no cleaner way?
|
this is interesting idea, i could replace hipchat with slack and get something cool... +1 |
@DanyC97, enjoy! Say if you create something cool. But this seems like a working concept for having alerting applied to you environment in a global fashion. I do not know how performant it is though. |
Are we defining "failure" as "any state returned I think "failed highstate" is probably a very common use-case for the reactor. And I don't think there's an easy way to see whether a highstate failed or not. I think currently Any thoughts on better ways to implement this @thatch45 or @cachedout? |
Also, could you please cross-post this issue using your Zendesk login if you haven't already @andrejohansson? You should have one since you're using an enterprise version. |
Hmm, I thought I put somethign into the master already which fired events for failed states (result: False). but similarly we could add a hook in the reactor or even in the natural event processing to add some stte failure event |
Yeah, I think it would be useful to have a general-case failure event as well, so you don't have to be worried about emitting multiple pages, or multiple messages in hipchat or whatever. Thoughts, @andrejohansson? |
@basepi if I will send a mail to my contact regarding your Zendesk proposal, I don't think I've gotten a login yet, I have to double check. A general failure event feels like the natural way, and maybe a possibility to extend the targeting mechanism for events? Today I can react on event names and use wildcards (eg
|
Yeah, it would be an additional event (we don't want to change the existing tags). Or it would be another field inside of the existing event. In at least 2015.8, I'm pretty sure the retcode does change on failures, so we might actually be able to just cue off of that instead. I'll have to do some testing. |
@basepi do you have a full example on how it works in the new implementation/ version (2015.8)? |
@DanyC97 this has not yet been implemented. |
@DmitryKuzmenko The reactor shouldn't need any modifications here. What we want to look at are the events which accompany a state run in salt. We want to put an indication in the return event for a state run to show that the run had failures in it. If we can make sure the "success" piece of the event data for the state run correctly shows True or False based on whether there were failures, then users will be able to write reactors which can detect failures. Ping me on Slack if you have more questions. |
As I understood job ret data contains a 'retcode' field that must be non-zero if there are errors in state execution. So the following could be used for your case:
If the retcode is non-zero it's a bug and we have to fix it. Now I'm trying to figure out when the retcode could possibly get the false-zero result. |
@andrejohansson I've just fixed an issue with the If you'll find any problem with getting the execution results with the |
Just as in this post and in this example i am trying to make a reactor state that triggers on failed highstate runs so that I can send various alerts.
I have the following files:
master config
_hipchat-highstate-fail.sls_
Things works well until you want to filter out just the failing runs. Is there really no simpler way than residing to custom jinjia templating or custom runners? I would expect something like listening on failed jobs only
salt/job/*/failure/*
So the question I'm asking is: How can I make a reactor state that runs only on failed highstates runs?
* Versions report*
(I'm in the early access enterprise program, don't remember how the versions are mapped)
The text was updated successfully, but these errors were encountered: