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

Http404 exceptions makes django_http_exceptions_total_by_view a bit useless

Open thomasf opened this issue 6 years ago • 2 comments

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.

thomasf avatar Nov 07 '17 11:11 thomasf

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.

thomasf avatar Nov 10 '17 10:11 thomasf

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.

korfuri avatar Dec 09 '17 14:12 korfuri