-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 health endpoint #752
Add health endpoint #752
Conversation
We should add this to the exporter toolkit as part of the landing page boilerplate functions. |
Yes, it would go to exporter-toolkit. Also note that Prometheus exposes /-/healthy. |
Hey folks, thanks for your quick reply. Unfortunately, I don't fully understand what you mean. Would you like to move the endpoint definition to the exporter-toolkit? And how would you like to combine it with the landing page boilerplate? The boiler plate exposes potentially sensitive data because it lists all probes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move forward here for now :)
we were refering to the exporter-toolkit repository but it is unclear when we will have the landing page here.
main.go
Outdated
@@ -309,6 +309,10 @@ func run() int { | |||
} | |||
}) | |||
http.Handle(path.Join(*routePrefix, "/metrics"), promhttp.Handler()) | |||
http.HandleFunc(path.Join(*routePrefix, "/health"), func(w http.ResponseWriter, r *http.Request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use /-/healthy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
main.go
Outdated
@@ -309,6 +309,10 @@ func run() int { | |||
} | |||
}) | |||
http.Handle(path.Join(*routePrefix, "/metrics"), promhttp.Handler()) | |||
http.HandleFunc(path.Join(*routePrefix, "/health"), func(w http.ResponseWriter, r *http.Request) { | |||
w.WriteHeader(http.StatusOK) | |||
w.Write([]byte("OK")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use "Healthy" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
The root endpoint exposes too much data. So it cannot be used as public health check endpoint. Signed-off-by: Mitja Adebahr <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
@SuperQ or @roidelapluie, can you please merge the PR? |
The existing endpoints expose potentially sensitive data. So they cannot be used without authentication to check from the internet if the services is running.