Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Commit

Permalink
patch process_template_response
Browse files Browse the repository at this point in the history
  • Loading branch information
mou55 committed Jan 15, 2018
1 parent f9c1884 commit 8831408
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django_prometheus/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def process_view(self, request, view_func, *view_args, **view_kwargs):
name, transport, method).inc()

def process_template_response(self, request, response):
responses_by_templatename.labels(str(
response.template_name)).inc()
if hasattr(response, 'template_name'):
responses_by_templatename.labels(str(
response.template_name)).inc()
return response

def process_response(self, request, response):
Expand Down

0 comments on commit 8831408

Please sign in to comment.