korfuri / django-prometheus

Export Django monitoring metrics for Prometheus.io
Apache License 2.0
1.44k stars 244 forks source link

Exclude metrics by view (or other criteria) #408

Open nathanieltalbot opened 1 year ago

nathanieltalbot commented 1 year ago

Hi all, is there any way to exclude request/response metrics by a certain view or by a certain criteria? The use case is that I'm seeing a lot of the django_http_responses_total_by_status_view_method_total metric with prometheus-django-metrics as the view (so, any queries to the metrics endpoint). Is there a clean way to exclude metrics about this route? Just looking to reduce the amount of metrics we expose by default.

raayu83 commented 9 months ago

Would also be interested in this to do the same and also exclude liveness and readiness probes.

janw commented 8 months ago

Same here, and I'd be happy to contribute this feature if it's considered a valid addition.