You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you reach a 404, it looks like the before_request_handler is not called and thus triggers the following error in the after_request_handler:
[2020-06-10 15:13:42 +0200] [17655] [ERROR] Exception occurred in one of response middleware handlers
Traceback (most recent call last):
File "/Users/optroodt/venvs/<snip>/lib/python3.7/site-packages/sanic/app.py", line 1017, in handle_request
request, response, request_name=name
File "/Users/optroodt/venvs/<snip>/lib/python3.7/site-packages/sanic/app.py", line 1315, in _run_response_middleware
_response = await _response
File "/Users/optroodt/venvs/<snip>/lib/python3.7/site-packages/sanic_prometheus/__init__.py", line 125, in before_response
metrics.after_request_handler(request, response, get_endpoint)
File "/Users/optroodt/venvs/<snip>/lib/python3.7/site-packages/sanic_prometheus/metrics.py", line 56, in after_request_handler
lat = time.time() - request['__START_TIME__']
File "/Users/optroodt/venvs/<snip>/lib/python3.7/site-packages/sanic/request.py", line 143, in __getitem__
return self.ctx.__dict__[key]
KeyError: '__START_TIME__'
Running:
MacOS 10.14.6 (Yes, I should upgrade :D)
Python 3.7.7,
sanic 19.12.2
sanic-prometheus 0.2.0
The text was updated successfully, but these errors were encountered:
When you reach a 404, it looks like the
before_request_handler
is not called and thus triggers the following error in theafter_request_handler
:Running:
The text was updated successfully, but these errors were encountered: