import { Request , Response , NextFunction } from 'express' ; import config from '../config' ; import metrics from '../services/metrics' ; param req param _res param next export default function initializeMetrics ( req , _res , next ) { if ( config . metrics . domain === 'missing_domain' || ! metrics . areMetricsRunning ( ) ) { config . metrics . domain = req . hostname ; metrics . scheduleRecurringMetricsPush ( ) ; metrics . scheduleRecurringMetricsGeneration ( ) ; } next ( ) ; }