This gets us closer to logging parts of the request
as separate json fields but not all the way there.
For example:
```json
{"written_at": "2020-10-07T21:52:16.975Z", "written_ts": 1602107536975497000, "msg": "{'status': 404, 'method': 'GET', 'ip': '127.0.0.1', 'uri': '/nbextensions/widgets/notebook/js/extension.js', 'request_time': 1.9807815551757812, 'referer': 'http://localhost:8888/notebooks/test.ipynb'}", "type": "log", "logger": "NotebookApp", "thread": "MainThread", "level": "WARNING", "module": "log", "line_no": 54}
```
Then split the file into two files, one containing the metrics themselves, the other containing any function that have something to do with prometheus.
Finally, Added new metrics into the prometheus.metrics file that represent the number of running terminals and added the functionality for that metric to be recorded in the terminal.api_handlers file.
In log.py, we're attempting to log the request headers when a
500-series error occurs, but tornado.httputil.HTTPHeaders isn't a dict -
it inherits from collections.MutableMapping. So it fails during
JSON serialization. The fix is to convert it to a dict first.
Unfortunately, the HTTPHeaders class doesn't expose any methods
to access the underlying dictionary (`request.headers._dict`) directly,
so we recreate it using the public API.