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

Prometheus Metrics View implementation #312

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sh0ked
Copy link

@sh0ked sh0ked commented Nov 16, 2021

This PR adds support for getting health check results in Prometheus format. See https://prometheus.io/.
You can also add new metrics to basic health checks or to your own.
For the implementation of prometheus metrics, we use the official package https://github.com/prometheus/client_python.

@nniehoff
Copy link

@KristianOellegaard any chance we could get this implemented?

@MartinSchmidt123
Copy link

I would also support adding prometheus metric exports.

@KristianOellegaard
Copy link
Collaborator

I think its a great idea, but it shouldn't be a requirement to install django-health-check, but rather be an optional requirement for the ones who want to use it. As I read the current code, everyone needs to install it.

@denisSurkov
Copy link

Hi!

I thinks this is really greate feature for django-healthchecks.

Any chance someone can continue this PR?

@KristianOellegaard, can you help to make this optional (share idea how to do it).
@frankwiles, can you check it or share idea how to make it optional? (Sorry, I mentioned you because you are the one who made the last commit)

@frankwiles
Copy link
Member

Oh wow I hadn't seen this PR yet @denisSurkov I think it's a great idea, but agree it needs to be optional. The metrics client needs Twisted which is a fairly heavy dependency to require.

I think we'd want to adjust this to conditionally import the client, warn if USE_PROMETHEUS is set but client isn't installed, etc.

But overall I think a decent idea. We typically have a separate Prometheus endpoint, but I don't see any real reason it couldn't be the same endpoint.

We just took over this module. I'm currently reworking the docs and getting familiar with the code base, GH Actions, etc. but I think this might be the next most important thing on the list.

@denisSurkov
Copy link

@sh0ked , can you continue your pull request?

@frankwiles , sounds cool. If the PR author would not respond, I would like to help to implement this feature.

@sh0ked
Copy link
Author

sh0ked commented Dec 7, 2022

Hi guys! Unfortunately, I don't have time to continue this PR. But I will be glad if someone can improve it.

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.

6 participants