endlessh-go icon indicating copy to clipboard operation
endlessh-go copied to clipboard

add unix socket support for prometheus

Open master-hax opened this issue 5 months ago • 6 comments

this PR allows for listening on a Unix domain socket for prometheus metrics by prefixing the path with unix:

also open to alternative prefixes like unix/ (which is what caddy uses)

some of this approach can probably be reused for https://github.com/shizunge/endlessh-go/issues/112

example usage:

starting endlessh-go

./endlessh-go -alsologtostderr -enable_prometheus -prometheus_host unix:./coolmetricsocket.socket

getting metrics

curl -v --unix-socket ./coolmetricsocket.socket whateverhostnameyouwant/metrics

master-hax avatar Sep 04 '24 05:09 master-hax