Page MenuHomePhabricator

Log API path for RESTBAse errors
Closed, ResolvedPublic

Description

A typical RESTBase error log entry does not contain the request path (e.g. in this case the request URI is /en.wikipedia.org/v1/data/lists/changes/since/2018-03-08T23:53:54Z and the path would be something like /en.wikipedia.org/v1/data/lists/changes/since/{timestamp} or maybe /{domain}/v1/data/lists/changes/since/{timestamp}) which makes it hard to create trending error views from which one could quickly tell which endpoints are broken. It would be nice to add that information to the error logs.

Event Timeline

This is totally possible as after the path was matched we do know the original API path spec for the endpoint, so we can create a new child logger that would include this info before passing it downwards to the actual handlers. Will require a bit of refactoring of how the loggers are passed around.

Finally after a bunch of logging enhancements, it's now possible to do this with the following PR: https://github.com/wikimedia/hyperswitch/pull/90

Finally deployed. We have api_path keys in the logs now: https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2018.06.05/restbase?id=AWPQI2RmIqXYUKtvo07U&_g=h@b74aee6

Feel free to reopen if it's missing from some of the logs.

Pchelolo claimed this task.
Pchelolo edited projects, added: Services (done); removed: Services (doing).