Skip to content

fix: change mapping of /health and /ready to /api/v2/health and /api/v2/ready #19578

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ need to update any InfluxDB CLI config profiles with the new port number.
1. [19446](https://github.com/influxdata/influxdb/pull/19446): Port TSM1 storage engine
1. [19494](https://github.com/influxdata/influxdb/pull/19494): Changing the default port from 9999 to 8086
1. [19636](https://github.com/influxdata/influxdb/pull/19636): Disable unimplemented delete with predicate API
1. [19578](https://github.com/influxdata/influxdb/pull/19578): Change mapping of /health and /ready to /api/v2/health and /api/v2/ready

### Features

Expand Down
6 changes: 3 additions & 3 deletions cmd/influx/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func cmdPing(f *globalFlags, opts genericCLIOpts) *cobra.Command {
TLSClientConfig: &tls.Config{InsecureSkipVerify: flags.skipVerify},
},
}
url := flags.config().Host + "/health"
url := flags.config().Host + "/api/v2/health"
resp, err := c.Get(url)
if err != nil {
return err
Expand All @@ -44,8 +44,8 @@ func cmdPing(f *globalFlags, opts genericCLIOpts) *cobra.Command {
}

cmd := opts.newCmd("ping", runE, true)
cmd.Short = "Check the InfluxDB /health endpoint"
cmd.Long = `Checks the health of a running InfluxDB instance by querying /health. Does not require valid token.`
cmd.Short = "Check the InfluxDB /api/v2/health endpoint"
cmd.Long = `Checks the health of a running InfluxDB instance by querying /api/v2/health. Does not require valid token.`
f.registerFlags(cmd, "token")

return cmd
Expand Down
2 changes: 1 addition & 1 deletion http/api_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ var apiLinks = map[string]interface{}{
"system": map[string]string{
"metrics": "/metrics",
"debug": "/debug/pprof",
"health": "/health",
"health": "/api/v2/health",
},
"tasks": "/api/v2/tasks",
"checks": "/api/v2/checks",
Expand Down
8 changes: 4 additions & 4 deletions http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
const (
// MetricsPath exposes the prometheus metrics over /metrics.
MetricsPath = "/metrics"
// ReadyPath exposes the readiness of the service over /ready.
ReadyPath = "/ready"
// HealthPath exposes the health of the service over /health.
HealthPath = "/health"
// ReadyPath exposes the readiness of the service over /api/v2/ready.
ReadyPath = "/api/v2/ready"
// HealthPath exposes the health of the service over /api/v2/health.
HealthPath = "/api/v2/health"
// DebugPath exposes /debug/pprof for go debugging.
DebugPath = "/debug"
)
Expand Down
2 changes: 1 addition & 1 deletion http/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestHealthHandler(t *testing.T) {
{
name: "health endpoint returns pass",
w: httptest.NewRecorder(),
r: httptest.NewRequest(http.MethodGet, "/health", nil),
r: httptest.NewRequest(http.MethodGet, "/api/v2/health", nil),
wants: wants{
statusCode: http.StatusOK,
contentType: "application/json; charset=utf-8",
Expand Down
4 changes: 0 additions & 4 deletions http/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1934,8 +1934,6 @@ paths:
schema:
$ref: "#/components/schemas/Error"
/ready:
servers:
- url: /
get:
operationId: GetReady
tags:
Expand All @@ -1957,8 +1955,6 @@ paths:
schema:
$ref: "#/components/schemas/Error"
/health:
servers:
- url: /
get:
operationId: GetHealth
tags:
Expand Down