prometheus icon indicating copy to clipboard operation
prometheus copied to clipboard

Add option to allow specifying address to bind to

Open rbjorklin opened this issue 3 years ago • 2 comments

I have attempted to maintain full backwards compatibility while also allowing one to specify the bind address with --listen-prometheus-addr which otherwise just defaults to 0.0.0.0.

Unfortunately something in conduit_lwt_server throws Uncaught exception accepting connection: Unix.Unix_error(Unix.EINVAL, "accept", "") when trying to use this no matter what address is being used.

I'm hoping the maintainers of this repo can shed some light on what might be going on otherwise I will open an issue against conduit as I think the implementation in this PR should work.

EDIT: I just came across this bit regarding the use of cloexec, thoughts?

rbjorklin avatar Oct 12 '22 06:10 rbjorklin

Well, you're creating sockaddr but then throwing the address away and just keeping the domain. You probably want to bind somewhere.

talex5 avatar Oct 14 '22 14:10 talex5

Beej's Guide to the rescue. The PR works now :smiley:

rbjorklin avatar Oct 15 '22 04:10 rbjorklin