```
> require('http').globalAgent.sockets
{ 'HOST:PORT:': [{ ... }, { ... }] }
```
- `new URL('http://HOST:PORT:')` throws
-> test suite `open_sockets`
- gauges were not cleaned up after no agents were present for a given
key. This lead to continuous emission of the previous connection
count for a given hostname, following the completion of all requests.
-> test suite `when all requests complete`
Metrics.initialize() and Metrics.configure() will configure the default
Prometheus registry with default "app" and "host" labels. The configured
prom-client module is available as Metrics.prom.
Version 3.2.0 crashes on startup because it calls buildPromKey() without
arguments. To avoid this kind of obvious bug to happen again, I added
some basic acceptance tests.
The v1 history service has its routes set up via swagger-tools, which
doesn't write a route property on the request. This prevents us to send
request metrics based on the route, but we can still log the request.
Commit 9056143fe36f1347a1ff985ef8592a1de7d798dd added logic to log
requests with different error levels depending on the status code. The
intention was to make the 5xx and 4xx requests stand out in Stackdriver.
Unfortunately, this also creates a lot of noise in Sentry since we log
the errors separately from the requests.
This commit brings back the former behaviour of logging all requests at
the INFO level. We can revisit this if we integrate the strategy
implemented in filestore of logging once per request.
When the environment variable STACKDRIVER_LOGGING is set to true, send
request logs in a format that Stackdriver knows how to interpret. Also,
set the log level accordint to the status code. 4xx responses are logged
as warnings and 5xx responses are logged as errors.