How to run nest-prom on different port?

Viewed 434

I am using @digikare/nestjs-prom to collect metrics in my service. I would like to expose the /metrics endpoint only on port 9090 and not on the main port.

How could I achieve this?

2 Answers

Looks like this package just adds an endpoint, so if you want /metrics to be on port 9090 you'd either need to run the app on that port, or make a reverse proxy run on port 9090 and forward on /metrics to your main application.

Related