Skip to content
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

feat: add salt_state_health gaugeVec #7

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

arsiesys
Copy link

Add a new metric salt_state_health that will return 0 or 1 depending of the last time a state was run on the node.
This will allow to easily create alerting rules based on this metric.

For example, in a classic monitoring system, if the last state.highstate failed, it will generate an alert. Once it is back to success, it's going to automatically stop the alarm.

@kpetremann
Copy link
Owner

kpetremann commented Apr 14, 2023

hi @arsiesys,

Thanks for the PR.

I had similar metric in the past, but I had to remove it because metrics cardinality was exploding.
I was thinking about adding a similar feature, but with an option to filter on the state/function to watch.

If you are willing to adapt your PR, I would suggest to add a filter in the settings.
Something like: watchedFunctionsPerMinion, watchedStatePerMinion. (there might be a better name)
Values would be a slice of string.

What do you think?

@arsiesys
Copy link
Author

I updated my branch to add some configurations options.

The best would be to make it possible to configure a set of association of "functions" with "states". I just did a basic filter for both of them. So this could be improved.

Loïc Yavercovski added 3 commits April 14, 2023 17:28
Will create a metric that will return 0 or 1 depending of the last event concerning a function failed or succeeded.
This will make the alerting/alarm creation easier.
@arsiesys arsiesys force-pushed the feat/last_highstate_state branch from e9e7f22 to 4b481db Compare April 14, 2023 21:30
@kpetremann kpetremann merged commit d47fae7 into kpetremann:main Apr 17, 2023
@kpetremann
Copy link
Owner

Thanks for the PR @arsiesys !!! 🎉 🚀

@kpetremann
Copy link
Owner

released in v0.1.5

@kpetremann
Copy link
Owner

kpetremann commented Apr 17, 2023

I missed one detail, the name of the metric is too precise and does not cover everything.
The metric concerns states, but also functions. I'll update the metric name from salt_state_health to salt_function_status in the next release. (as there is always a function)

note: the prefix status must be used for boolean metrics according Prometheus best practices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants