Investigate whether it makes sense to use / build on top of the service runner template, or whether we should roll our own.
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Jakob_WMDE | T223202 emit statsd metrics for requests | |||
Resolved | Jakob_WMDE | T226627 Investigate how to send request metrics |
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.