Add hc_check_started
prometheus metrics
#630
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is simple fix adds another metric to prometheus endpoint -
hc_check_in_progress
. Its purpose is to return1
for checks which are currently in progress (marked asstarted
, and not finished or failed).The main purpose are prometheus alerts. For example, in my case some of the cron tasks use 100% CPU, and it's normal - which means, I don't want to receive alerts from prometheus/alertmanager about CPU usage during this time. Thanks to this simple metric, I can add simple rule like
node_load5 > 8 and on() hc_check_in_progress{name="my-heavy-cron-job"} == 0
and never be bothered unnecessarily again :)