jochen-schweizer / express-prom-bundle

express middleware with standard prometheus metrics in one bundle
MIT License
303 stars 67 forks source link

Add metricsapp option #101

Closed ath88 closed 2 years ago

ath88 commented 2 years ago

Fixes #25

Exposing Node.js internals on a public facing API is potentially a security issue. This lets you expose the metrics endpoint on a different node app listening on a different port.

disjunction commented 2 years ago

Thanks for the contribution! Yet I find the suggested solution outside of the library better: https://github.com/jochen-schweizer/express-prom-bundle/issues/25#issuecomment-830426374

The pull request is lacking 2 items:

ath88 commented 2 years ago

Thanks for the contribution! Yet I find the suggested solution outside of the library better: #25 (comment)

The pull request is lacking 2 items:

  • types/index.d.ts needs to be extended to include the new option
  • the code should be covered in unit tests

I see your point. It's cleaner and doesn't pollute the code base and is fully supported by autoregister. But - I see a two benefits over the solution mentioned in the comments:

I added the requested changes. :)

disjunction commented 2 years ago

@ath88 thanks again! This has been published to npm as version 6.5.0