django-prometheus
django-prometheus copied to clipboard
Http404 exceptions makes django_http_exceptions_total_by_view a bit useless
I would like to not have Http404
registered by the exception counters because it's not a "hard" kind of error and django_http_exceptions_total_by_view
becomes a bit useless to use properly beacuse of it.
django_http_exceptions_total_by_type{type="Http404"} 10.0
django_http_exceptions_total_by_view{view_name="wagtail_serve"} 10.0
The two metrics could also be merged into a new one instead even though It might add a lot of combinations in some cases.
the more I try to make use of these metrics I'm leaning towards merging these to only export a single django_http_exceptions_total
which includes both type
and view_name
.
IIRC, there are cases where exceptions can be thrown without a view_name existing, and that was why the two metrics are separate. It would make sense to merge them and just use view_name="<unknown_view>"
or something if the view can't be determined. I don't have time to work on this these days but I would welcome a PR for this.