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

Add hc_check_started prometheus metrics #630

Merged
merged 1 commit into from
Apr 8, 2022
Merged

Add hc_check_started prometheus metrics #630

merged 1 commit into from
Apr 8, 2022

Conversation

ajgon
Copy link
Contributor

@ajgon ajgon commented Apr 1, 2022

This is simple fix adds another metric to prometheus endpoint - hc_check_in_progress. Its purpose is to return 1 for checks which are currently in progress (marked as started, 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 :)

@cuu508
Copy link
Member

cuu508 commented Apr 4, 2022

Thanks for the PR!

How about calling this metric hc_check_started instead of hc_check_in_progress?

It's shorter, and "started" is already used elsewhere in the codebase, "in_progress" isn't. Also I think it would describe the check's state better: the check was started, but no idea if it is still running or AWOL.

@ajgon ajgon changed the title Add hc_check_in_progress prometheus metrics Add hc_check_started prometheus metrics Apr 4, 2022
@ajgon
Copy link
Contributor Author

ajgon commented Apr 4, 2022

Hah! The funny thing is, I originally thought about naming it hc_check_started, but eventually settled on _in_progress for some reason 😄

I fixed the PR 👍

@cuu508 cuu508 merged commit e7333d6 into healthchecks:master Apr 8, 2022
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.

None yet

2 participants