Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unix socket support for prometheus #128

Merged
merged 5 commits into from
Nov 4, 2024

Conversation

master-hax
Copy link
Contributor

@master-hax master-hax commented Sep 4, 2024

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 #112

example usage:

starting endlessh-go

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

try connecting to generate some metrics

ssh -v localhost -o Port=2222

get the metrics

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

@master-hax
Copy link
Contributor Author

cc @shizunge do you mind taking a look?

@master-hax
Copy link
Contributor Author

cc @Bananz0 @JeDaYoshi do you mind taking a look?

@JeDaYoshi
Copy link

I'm not part of the project, so I can't act on it.

@master-hax
Copy link
Contributor Author

gotcha! appreciate the fast response.

i see you have contributed here before though - do you have any suggestions or criticisms for this change?

@master-hax
Copy link
Contributor Author

cc @olofvndrhr do you mind taking a look?

@shizunge
Copy link
Owner

I will take a look at this at Sept 19 or 20.

metrics/metrics.go Show resolved Hide resolved
metrics/metrics.go Outdated Show resolved Hide resolved
@Z0pyrus
Copy link

Z0pyrus commented Oct 30, 2024

any updates on this?

@Z0pyrus Z0pyrus mentioned this pull request Oct 30, 2024
@master-hax
Copy link
Contributor Author

any updates on this?

addressed the comments from my side

metrics/metrics.go Outdated Show resolved Hide resolved
@shizunge shizunge merged commit 258491b into shizunge:main Nov 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants