Exemplo n.º 1
0
 def after_request(response):
     try:
         request_duration.labels(request.endpoint, request.method).observe(
             time.time() - request._start_time)
     except AttributeError:
         logging.exception("Request without _start_time - check app.before_request ordering")
     request_total.labels(request.endpoint, request.method, response.status_code).inc()
     return response
Exemplo n.º 2
0
 def after_request(response):
     try:
         request_duration.labels(request.endpoint, request.method).observe(
             time.time() - request._start_time)
     except AttributeError:
         # In some cases this isn't present?
         logging.exception("Request without _start_time")
     request_total.labels(request.endpoint, request.method, response.status_code).inc()
     return response
Exemplo n.º 3
0
 def after_request(response):
     try:
         request_duration.labels(request.endpoint, request.method).observe(
             time.time() - request._start_time)
     except AttributeError:
         # In some cases this isn't present?
         logging.exception("Request without _start_time")
     request_total.labels(request.endpoint, request.method, response.status_code).inc()
     return response
Exemplo n.º 4
0
 def after_request(response):
     try:
         request_duration.labels(
             request.endpoint,
             request.method).observe(time.time() - request._start_time)
     except AttributeError:
         logging.exception(
             "Request without _start_time - check app.before_request ordering"
         )
     request_total.labels(request.endpoint, request.method,
                          response.status_code).inc()
     return response