Page MenuHomePhabricator

Investigate how to send request metrics
Closed, ResolvedPublic

Description

Investigate whether it makes sense to use / build on top of the service runner template, or whether we should roll our own.

Event Timeline

The only type of metrics emitted via the service runner template are response times. The place of the metrics call is linked in the task description and "proof" that it's the only one can be seen here: https://github.com/wikimedia/service-template-node/search?utf8=%E2%9C%93&q=metrics&type=

It does not look like the service-runner-template code is going to be easily reusable (without copy&pasting it), as it is indeed meant as a template for new services. The function wrapping routes to emit response times looks almost exactly like the [[ https://github.com/expressjs/response-time#response-time-metrics | example for the express/response-time middleware ]]. The endTiming statsd method used in service-runner-template is only a [[ https://github.com/wikimedia/service-runner/blob/master/lib/statsd.js#L58 | facade to the timing method ]] seen in the example. This tempts me to try and implement this using the response-time middleware.