import * as express from 'express' ; import { NextFunction , Request , Response } from 'express' ; import errorHandler from '../middlewares/errorHandler' ; import metrics from '../services/metrics' ; const metricsRouter = express . Router ( ) ; /**
 * Routes for the metrics report generated by Prometheus.
 */ metricsRouter . get ( '/' , ( _req , res , next ) : void => { res . set ( 'Content-Type' , 'text/plain' ) ; res . send ( metrics . getMetrics ( ) ) ; return next ( ) ; } ) . use ( errorHandler ) ; export default metricsRouter ;