moleculerjs / moleculer-metrics

:chart_with_upwards_trend: Official monitoring & metrics addons for Moleculer framework
MIT License
48 stars 23 forks source link

Allow configuration of Prometheus hostname #47

Closed NickClark closed 1 year ago

NickClark commented 3 years ago

In some cases it is necessary to expose the server on more than just localhost. This adds a configuration for exactly that.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 143


Totals Coverage Status
Change from base Build 120: 0.0%
Covered Lines: 299
Relevant Lines: 308

💛 - Coveralls
NickClark commented 3 years ago

@icebob I think this should be ready to go

NickClark commented 3 years ago

I can certainly do that... the reason I had localhost default was because that's what it was before. In fact the motivation for this commit was so that I could use 0.0.0.0. It appeared that Polka used localhost by default? Am I wrong?

icebob commented 3 years ago

If you see the default host setting in the Node HTTP server, the host is 0.0.0.0 and polka use it, as well. So if you change it to localhost as default, it can cause breaking change.

https://nodejs.org/dist/latest-v14.x/docs/api/net.html#net_server_listen_port_host_backlog_callback