import { Application } from 'express' ; const Prometheus = require ( 'prom-client' ) ; param app export const configMetrics = ( app ) => { const prometheusMetrics = Prometheus . collectDefaultMetrics ; prometheusMetrics ( { timeout : 5000 } ) ; app . get ( '/metrics' , ( req , res ) => { res . set ( 'Content-Type' , Prometheus . register . contentType ) ; res . end ( Prometheus . register . metrics ( ) ) ; } ) ; } ; export default configMetrics ;