Add responseTimeMetricsMiddleware and expose raw Prometheus Metric
A lot of service-utils
was built with the same API and behavior as service-runner
for easy migration. A lot of this legacy code doesn't really make sense anymore in the context of service-utils
.
This patch inspired by cxserver introduces a more idiomatic replacement for wrapRouteHandles
(which was ported from service-template-node
) and introduces a new Metrics API that circumvents the legacy service-runner
code (which supported multiple metric reporters while service-utils
standardizes on Prometheus). It also exposes the underlying prometheus library directly for low level manipulation.
Bug: T360924