parent
8c3ba65e77
commit
8cd0fe5e7b
|
|
@ -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
|
## Multiple URLs can be specified for a single cluster, only ONE of the
|
||||||
## urls will be written to each interval.
|
## urls will be written to each interval.
|
||||||
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
|
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
|
||||||
urls = ["http://127.0.0.1:8086"]
|
urls = ["http://127.0.0.1:9999"]
|
||||||
|
|
||||||
## Token for authentication.
|
## Token for authentication.
|
||||||
token = ""
|
token = ""
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ func TestMakeWriteURL(t *testing.T) {
|
||||||
act string
|
act string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
url: genURL("http://localhost:8086"),
|
url: genURL("http://localhost:9999"),
|
||||||
act: "http://localhost:8086/api/v2/write?bucket=telegraf&org=influx",
|
act: "http://localhost:9999/api/v2/write?bucket=telegraf&org=influx",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: genURL("unix://var/run/influxd.sock"),
|
url: genURL("unix://var/run/influxd.sock"),
|
||||||
|
|
@ -28,7 +28,7 @@ func TestMakeWriteURL(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
err: true,
|
err: true,
|
||||||
url: genURL("udp://localhost:8086"),
|
url: genURL("udp://localhost:9999"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ func TestNewHTTPClient(t *testing.T) {
|
||||||
{
|
{
|
||||||
err: true,
|
err: true,
|
||||||
cfg: &influxdb.HTTPConfig{
|
cfg: &influxdb.HTTPConfig{
|
||||||
URL: genURL("udp://localhost:8086"),
|
URL: genURL("udp://localhost:9999"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
defaultURL = "http://localhost:8086"
|
defaultURL = "http://localhost:9999"
|
||||||
|
|
||||||
ErrMissingURL = errors.New("missing URL")
|
ErrMissingURL = errors.New("missing URL")
|
||||||
)
|
)
|
||||||
|
|
@ -28,7 +28,7 @@ var sampleConfig = `
|
||||||
## Multiple URLs can be specified for a single cluster, only ONE of the
|
## Multiple URLs can be specified for a single cluster, only ONE of the
|
||||||
## urls will be written to each interval.
|
## urls will be written to each interval.
|
||||||
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
|
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
|
||||||
urls = ["http://127.0.0.1:8086"]
|
urls = ["http://127.0.0.1:9999"]
|
||||||
|
|
||||||
## Token for authentication.
|
## Token for authentication.
|
||||||
token = ""
|
token = ""
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ func TestDefaultURL(t *testing.T) {
|
||||||
if len(output.URLs) < 1 {
|
if len(output.URLs) < 1 {
|
||||||
t.Fatal("Default URL failed to get set")
|
t.Fatal("Default URL failed to get set")
|
||||||
}
|
}
|
||||||
require.Equal(t, "http://localhost:8086", output.URLs[0])
|
require.Equal(t, "http://localhost:9999", output.URLs[0])
|
||||||
}
|
}
|
||||||
func TestConnect(t *testing.T) {
|
func TestConnect(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
|
|
@ -26,7 +26,7 @@ func TestConnect(t *testing.T) {
|
||||||
{
|
{
|
||||||
out: influxdb.InfluxDB{
|
out: influxdb.InfluxDB{
|
||||||
URLs: []string{"http://localhost:1234"},
|
URLs: []string{"http://localhost:1234"},
|
||||||
HTTPProxy: "http://localhost:8086",
|
HTTPProxy: "http://localhost:9999",
|
||||||
HTTPHeaders: map[string]string{
|
HTTPHeaders: map[string]string{
|
||||||
"x": "y",
|
"x": "y",
|
||||||
},
|
},
|
||||||
|
|
@ -36,7 +36,7 @@ func TestConnect(t *testing.T) {
|
||||||
err: true,
|
err: true,
|
||||||
out: influxdb.InfluxDB{
|
out: influxdb.InfluxDB{
|
||||||
URLs: []string{"!@#$qwert"},
|
URLs: []string{"!@#$qwert"},
|
||||||
HTTPProxy: "http://localhost:8086",
|
HTTPProxy: "http://localhost:9999",
|
||||||
HTTPHeaders: map[string]string{
|
HTTPHeaders: map[string]string{
|
||||||
"x": "y",
|
"x": "y",
|
||||||
},
|
},
|
||||||
|
|
@ -56,7 +56,7 @@ func TestConnect(t *testing.T) {
|
||||||
err: true,
|
err: true,
|
||||||
out: influxdb.InfluxDB{
|
out: influxdb.InfluxDB{
|
||||||
URLs: []string{"!@#$%^&*()_+"},
|
URLs: []string{"!@#$%^&*()_+"},
|
||||||
HTTPProxy: "http://localhost:8086",
|
HTTPProxy: "http://localhost:9999",
|
||||||
HTTPHeaders: map[string]string{
|
HTTPHeaders: map[string]string{
|
||||||
"x": "y",
|
"x": "y",
|
||||||
},
|
},
|
||||||
|
|
@ -66,7 +66,7 @@ func TestConnect(t *testing.T) {
|
||||||
err: true,
|
err: true,
|
||||||
out: influxdb.InfluxDB{
|
out: influxdb.InfluxDB{
|
||||||
URLs: []string{":::@#$qwert"},
|
URLs: []string{":::@#$qwert"},
|
||||||
HTTPProxy: "http://localhost:8086",
|
HTTPProxy: "http://localhost:9999",
|
||||||
HTTPHeaders: map[string]string{
|
HTTPHeaders: map[string]string{
|
||||||
"x": "y",
|
"x": "y",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue