Skip to content
This repository was archived by the owner on Jun 17, 2026. It is now read-only.

Add function to pass libmicrohttpd options when starting Prometheus listener#68

Open
sysvinit wants to merge 1 commit into
digitalocean:masterfrom
wireapp:feature/mhd-start-daemon-flags
Open

Add function to pass libmicrohttpd options when starting Prometheus listener#68
sysvinit wants to merge 1 commit into
digitalocean:masterfrom
wireapp:feature/mhd-start-daemon-flags

Conversation

@sysvinit

Copy link
Copy Markdown

This commit adds a new function, promhttp_start_daemon_with_options(), which exposes the variadic options interface of MHD_start_daemon() to applications using prometheus-client-c. This would allow applications to e.g. bind to a specific IP address instead of the wildcard address, which is the libmicrohttpd default.

This is the same as promhttp_start_daemon(), except that it exposes
MHD_start_daemon()'s variadic options, to allow applications to pass flags
directly into libmicrohttpd. The use case for this functionality is to allow
the metrics listener to be bound to a specific socket address (instead of
binding to a given port on the wildcard address) using MHD_OPTION_SOCK_ADDR,
etc.
@sysvinit
sysvinit requested a review from a team as a code owner March 16, 2022 13:08
@ggarber

ggarber commented Aug 30, 2022

Copy link
Copy Markdown

I think this is a great addition. I also need it!

@wferi

wferi commented Apr 3, 2023

Copy link
Copy Markdown

#79 enables a different approach: calling libmicrohttpd directly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants