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 option to disable /debug/vars endpoint #65

Closed
dee-see opened this issue Oct 23, 2023 · 5 comments
Closed

Add option to disable /debug/vars endpoint #65

dee-see opened this issue Oct 23, 2023 · 5 comments
Labels

Comments

@dee-see
Copy link
Contributor

dee-see commented Oct 23, 2023

Specifications

There's a /debug/vars which dumps a bunch of information about the running process. It would be great if we could disable this with a command-line option. I had a quick look to open a PR but it wasn't obvious to me how this is done. If you have any pointers I'm happy to open the PR myself.

Expected Behavior

A new command-line option to disable /debug/vars. I think it should be disabled by default but I understand it would be a breaking change.

Actual Behavior

/debug/vars cannot be disabled

Steps to reproduce

Start camo and visit /debug/vars

@dropwhile
Copy link
Member

It looks like the prometheus library is importing the go stdlib expvar, which in turn is auto-registering /debug/vars on the default servemux. Oof!
This is certain not intented, and I will add a change to stop this from happening (it should only be available if the --metrics flag is supplied to go-cam).

Thank you for catching this!

@dropwhile
Copy link
Member

@dee-see I just released a fixed version. Let me know if it doesn't resolve the issue.

@dropwhile dropwhile added the bug label Oct 23, 2023
@dee-see
Copy link
Contributor Author

dee-see commented Oct 24, 2023

Thank you very much for the very quick fix!!

@dee-see
Copy link
Contributor Author

dee-see commented Oct 24, 2023

@dropwhile would you be open to some sort of --metrics-without-debug switch (name needs some work 😅) that enables the /metrics endpoint without /debug/vars? We see no use for the /debug/vars/ endpoint and would like to hide it in any case. Happy to contribute this feature if you think it can be useful.

@dropwhile
Copy link
Member

dropwhile commented Oct 24, 2023

@dee-see I have no problem adding something like that. 👍
Can you open a new issue for that feature request?

EDIT: Maybe something like --metrics --no-debug-vars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants