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

Move the healthcheck handler to the root and include about info. #395

Closed
wants to merge 1 commit into from

Conversation

jalvz
Copy link
Contributor

@jalvz jalvz commented Dec 12, 2017

About info contains the version, git ref and build date(*), and is returned only if a request is authenticated.

About is also printed on startup.
The git ref and the updated timestamp are generated with make update.

Closes #375

(*) @beniwohli asked for the build date. This is not exactly the build date, but the timestamp of when you run make update. Im not sure how I would get the build date...

…d the git ref in the response if a request is authenticated.

That info is also printed on startup.
The git ref and the updated timestamp is generated with `make update`

Closes elastic#375
} else if isAuthorized(r, config.SecretToken) {
sendStatus(w, r, http.StatusOK, about.About())
} else {
sendStatus(w, r, http.StatusOK, nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also forbid completely non authenticated health-check requests...

@beniwohli
Copy link
Contributor

@jalvz I looked into this a while ago, and most solutions recommend using ldflags, e.g. https://www.atatus.com/blog/golang-auto-build-versioning/

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.

2 participants