Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port collision with primary webserver process #7

Open
brian-lc opened this issue Nov 1, 2023 · 1 comment
Open

Port collision with primary webserver process #7

brian-lc opened this issue Nov 1, 2023 · 1 comment

Comments

@brian-lc
Copy link

brian-lc commented Nov 1, 2023

Hello, I was wondering about the decision to include PORT as the default here. My understanding might be wrong but if I have a webserver like Unicorn or Puma I probably have 'PORT' defined in my environment already. When starting the metrics server from my Unicorn process (for example) the metrics server would fail to start due to port collision with the already running unicorn. So I pretty much have to define 'PROMETHEUS_EXPORTER_PORT=9394' even if I'm okay with the default port number.

I'm happy to write up a PR for this change but thought I'd ask about the usage or thoughts behind this line of code first.

Thanks much! Really appreciate this project and your work!

default_port = ENV.fetch('PORT', 9394)

@Envek
Copy link
Member

Envek commented Dec 11, 2023

Hey and sorry for the late response.

In case of web servers, you can use web server itself to expose metrics on different port. For Puma there is built-in support in yabeda-puma-plugin, see Exposing metrics on a different port section in its README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants