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

Commit

Permalink
Merge pull request #6 from mou55/patch-1
Browse files Browse the repository at this point in the history
patch process_template_response
  • Loading branch information
mou55 committed Jan 15, 2018
2 parents f9c1884 + 8831408 commit 8b1693d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django_prometheus/middleware.py
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 8b1693d

Please sign in to comment.