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

fix(api/health): report version #18173

Merged
merged 3 commits into from
May 26, 2020
Merged

fix(api/health): report version #18173

merged 3 commits into from
May 26, 2020

Conversation

sranka
Copy link
Contributor

@sranka sranka commented May 20, 2020

Closes #13907

InfluxDB 1.8 "/health" endpoint already returns version,

{
"checks": [],
"message": "ready for queries and writes",
"name": "influxdb",
"status": "pass",
"version": "1.8.0"
}

This PR also adds version to 2.0 "/health" endpoint

@sranka sranka requested a review from a team as a code owner May 20, 2020 07:12
@sranka sranka requested review from ebb-tide and removed request for a team May 20, 2020 07:12
Copy link
Contributor

@glinton glinton left a comment

Choose a reason for hiding this comment

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

Awesome!

http/health_test.go Show resolved Hide resolved
@glinton
Copy link
Contributor

glinton commented May 20, 2020

Personally, I wouldn't mind seeing the commit in there too.

@sranka sranka force-pushed the 13907/addVersionToHealth branch 2 times, most recently from d60b86a to 2e4b537 Compare May 20, 2020 20:33
http/health.go Outdated
)

// HealthHandler returns the status of the process.
func HealthHandler(w http.ResponseWriter, r *http.Request) {
msg := `{"name":"influxdb", "message":"ready for queries and writes", "status":"pass", "checks":[]}`
msg := fmt.Sprintf(`{"name":"influxdb", "message":"ready for queries and writes", "status":"pass", "checks":[], "version": %q}`, platform.GetBuildInfo().Version)
Copy link
Contributor

Choose a reason for hiding this comment

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

The more i think about it, the more valuable i feel like commit would be in here. (platform.GetBuildInfo().Commit) 🤷‍♂️

Copy link
Contributor Author

@sranka sranka May 20, 2020

Choose a reason for hiding this comment

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

A new "commit" field? I can add it as well herein.

@sranka sranka force-pushed the 13907/addVersionToHealth branch from 85912c0 to c35c90a Compare May 26, 2020 12:04
@sranka sranka merged commit d5846be into master May 26, 2020
@jacobmarble jacobmarble deleted the 13907/addVersionToHealth branch January 2, 2024 22:50
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.

InfluxDB 2.0: There is now way how to get version of InfluxDB from API [area/api]
2 participants