django-prometheus icon indicating copy to clipboard operation
django-prometheus copied to clipboard

Exclude metrics by view (or other criteria)

Open nathanieltalbot opened this issue 2 years ago • 2 comments

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.

nathanieltalbot avatar Jun 08 '23 15:06 nathanieltalbot

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

raayu83 avatar Nov 30 '23 13:11 raayu83

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

janw avatar Jan 10 '24 15:01 janw