prometheus / prometheus/exporter-toolkit
Automatically enable `--web.systemd-socket` when `$LISTEN_FDS` is set
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 311
- Forks
- 109
- Avg merge
- 3d 59m
- Merged PRs (30d)
- 6
Description
Almost two years ago (#95) exporter-toolkit added the --web.systemd-socket flag to listen on a pre-opened socket passed as a file descriptor. We have used this feature with success since then. However, having to manually set the flag when using a socket is quite cumbersome and error prone. Additionally, when the flag is set, exporters fail to start unless a socket is passed. This is a reasonable behavior as one explicitly told the exporter to use an existing socket.
However, it would be better to check the $LISTEN_FDS environment variable and automatically use a socket if that variable is set. If that variable is not set, the exporter would fall back to opening a port on its own.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the existing --web.systemd-socket handling and the exporter startup path, then inspect how $LISTEN_FDS is currently treated. Done means a set $LISTEN_FDS value selects the pre-opened socket automatically, while its absence preserves normal port opening, with coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100