Skip to content

Commit b075686

Browse files
glintondanielnelson
authored andcommitted
Update write path to match updated InfluxDB v2 API (#4844)
1 parent 7bb2192 commit b075686

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/outputs/influxdb_v2/http.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ func makeWriteURL(loc url.URL, org, bucket string) (string, error) {
267267
case "unix":
268268
loc.Scheme = "http"
269269
loc.Host = "127.0.0.1"
270-
loc.Path = "v2/write"
270+
loc.Path = "/api/v2/write"
271271
case "http", "https":
272-
loc.Path = path.Join(loc.Path, "v2/write")
272+
loc.Path = path.Join(loc.Path, "/api/v2/write")
273273
default:
274274
return "", fmt.Errorf("unsupported scheme: %q", loc.Scheme)
275275
}

plugins/outputs/influxdb_v2/http_internal_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ func TestMakeWriteURL(t *testing.T) {
2121
}{
2222
{
2323
url: genURL("http://localhost:9999"),
24-
act: "http://localhost:9999/v2/write?bucket=telegraf&org=influx",
24+
act: "http://localhost:9999/api/v2/write?bucket=telegraf&org=influx",
2525
},
2626
{
2727
url: genURL("unix://var/run/influxd.sock"),
28-
act: "http://127.0.0.1/v2/write?bucket=telegraf&org=influx",
28+
act: "http://127.0.0.1/api/v2/write?bucket=telegraf&org=influx",
2929
},
3030
{
3131
err: true,

0 commit comments

Comments
 (0)