update influxdb v2 port

This commit is contained in:
Samantha Wang 2020-09-09 10:55:20 -07:00
parent f0c2c38931
commit 8c3ba65e77
5 changed files with 12 additions and 12 deletions

View File

@ -12,7 +12,7 @@ The InfluxDB output plugin writes metrics to the [InfluxDB v2.x] HTTP service.
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
urls = ["http://127.0.0.1:9999"]
urls = ["http://127.0.0.1:8086"]
## Token for authentication.
token = ""

View File

@ -19,8 +19,8 @@ func TestMakeWriteURL(t *testing.T) {
act string
}{
{
url: genURL("http://localhost:9999"),
act: "http://localhost:9999/api/v2/write?bucket=telegraf&org=influx",
url: genURL("http://localhost:8086"),
act: "http://localhost:8086/api/v2/write?bucket=telegraf&org=influx",
},
{
url: genURL("unix://var/run/influxd.sock"),
@ -28,7 +28,7 @@ func TestMakeWriteURL(t *testing.T) {
},
{
err: true,
url: genURL("udp://localhost:9999"),
url: genURL("udp://localhost:8086"),
},
}

View File

@ -31,7 +31,7 @@ func TestNewHTTPClient(t *testing.T) {
{
err: true,
cfg: &influxdb.HTTPConfig{
URL: genURL("udp://localhost:9999"),
URL: genURL("udp://localhost:8086"),
},
},
{

View File

@ -17,7 +17,7 @@ import (
)
var (
defaultURL = "http://localhost:9999"
defaultURL = "http://localhost:8086"
ErrMissingURL = errors.New("missing URL")
)
@ -28,7 +28,7 @@ var sampleConfig = `
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
urls = ["http://127.0.0.1:9999"]
urls = ["http://127.0.0.1:8086"]
## Token for authentication.
token = ""

View File

@ -16,7 +16,7 @@ func TestDefaultURL(t *testing.T) {
if len(output.URLs) < 1 {
t.Fatal("Default URL failed to get set")
}
require.Equal(t, "http://localhost:9999", output.URLs[0])
require.Equal(t, "http://localhost:8086", output.URLs[0])
}
func TestConnect(t *testing.T) {
tests := []struct {
@ -26,7 +26,7 @@ func TestConnect(t *testing.T) {
{
out: influxdb.InfluxDB{
URLs: []string{"http://localhost:1234"},
HTTPProxy: "http://localhost:9999",
HTTPProxy: "http://localhost:8086",
HTTPHeaders: map[string]string{
"x": "y",
},
@ -36,7 +36,7 @@ func TestConnect(t *testing.T) {
err: true,
out: influxdb.InfluxDB{
URLs: []string{"!@#$qwert"},
HTTPProxy: "http://localhost:9999",
HTTPProxy: "http://localhost:8086",
HTTPHeaders: map[string]string{
"x": "y",
},
@ -56,7 +56,7 @@ func TestConnect(t *testing.T) {
err: true,
out: influxdb.InfluxDB{
URLs: []string{"!@#$%^&*()_+"},
HTTPProxy: "http://localhost:9999",
HTTPProxy: "http://localhost:8086",
HTTPHeaders: map[string]string{
"x": "y",
},
@ -66,7 +66,7 @@ func TestConnect(t *testing.T) {
err: true,
out: influxdb.InfluxDB{
URLs: []string{":::@#$qwert"},
HTTPProxy: "http://localhost:9999",
HTTPProxy: "http://localhost:8086",
HTTPHeaders: map[string]string{
"x": "y",
},