You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! In #101 there were additional options added, but they're missing examples. I am unsure how I should use combination of autoregister and metricsApp. I could use the suggestions in #25 , but I'd rather use the options presented in the #101 PR.
The text was updated successfully, but these errors were encountered:
Looks like an app instance. My solution that worked:
exportfunctionmetrics(): express.Express{constmetricsAppInstance=express();// do stuff if you likereturnmetricsAppInstance}// The Express app is exported so that it can be used by serverless Functions.exportfunctionapp(metricsAppInstance: express.Express): express.Express{constserver=express();
...
// Prometheus Setupserver.use('*',promBundle({buckets: [0.10,5,15,50,100,200,300,400,500],includeMethod: true,includePath: true,customLabels: {app: 'angular-express-ssr'},autoregister: false,metricsPath: '/metrics',metricsApp: metricsAppInstance,promClient: {collectDefaultMetrics: {}},}));
...
returnserver;}functionrun(): void{constport=config.get('server.port')||4000;constmetricsPort=config.get('metrics.port')||4001;constmetricsServer=metrics();// Start up the Node serverconstserver=app(metricsServer);metricsServer.listen(metricsPort,()=>{console.log(`Node Express Prometheus Exporter listening on http://localhost:${metricsPort}`);})server.listen(port,()=>{console.log(`Node Express server listening on http://localhost:${port}`);});}
Hey! In #101 there were additional options added, but they're missing examples. I am unsure how I should use combination of
autoregister
andmetricsApp
. I could use the suggestions in #25 , but I'd rather use the options presented in the #101 PR.The text was updated successfully, but these errors were encountered: