Skip to content

Add responseTimeMetricsMiddleware and expose raw Prometheus Metric

TChin requested to merge add-express-middleware-and-raw-metrics into main

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.

cc: @gmodena @otto @santhosh

Bug: T360924

Edited by TChin

Merge request reports

Loading