Component(s)
config/confignet
Is your feature request related to a problem? Please describe.
When using Unix domain sockets with the Collector (via confignet.AddrConfig.Listen()), operators face three recurring pain points:
- Stale socket files block restarts. If a Collector process is killed ungracefully (OOM, SIGKILL, node eviction), the socket file remains on the filesystem. The next process fails to bind with "address already in use." This is especially common in Kubernetes DaemonSet deployments with host-mounted volumes (see #14274, which was filed against contrib but describes the same root cause).
- Socket file permissions are not configurable. Socket files inherit the process umask, which is often too restrictive for multi-service setups. Operators must use external tooling (systemd ExecStartPost, init scripts) to chmod the socket after the Collector starts.
- Socket files are not cleaned up on close. When Listen() returns a net.Listener for a Unix socket, calling Close() does not remove the socket file, leaving stale files behind for the next restart.
Describe the solution you'd like
Add two new fields to confignet.AddrConfig and enhance Listen():
- socket_permissions (os.FileMode) — File mode applied to the socket file after binding. Only valid for Unix transports. When zero (default), inherits the process umask.
- socket_clean_on_start (bool) — Remove a pre-existing socket file before binding. Only applies to filesystem-based Unix sockets (not abstract sockets with @ prefix). Default: false.
Listen() would also wrap the returned listener so that Close() removes the socket file automatically.
Describe alternatives you've considered
- External wrapper scripts (e.g., ExecStartPre=rm -f /path/to/socket) — Works but pushes responsibility outside the Collector and is error-prone.
- Handling this in confighttp/configgrpc — These layers now delegate to confignet.AddrConfig.Listen() (since #14248), so solving it in confignet benefits all consumers automatically.
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Component(s)
config/confignet
Is your feature request related to a problem? Please describe.
When using Unix domain sockets with the Collector (via confignet.AddrConfig.Listen()), operators face three recurring pain points:
Describe the solution you'd like
Add two new fields to confignet.AddrConfig and enhance Listen():
Listen() would also wrap the returned listener so that Close() removes the socket file automatically.
Describe alternatives you've considered
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.