Rename `influxdbjson_url` tag to `url`
This commit is contained in:
parent
78e73ed78c
commit
65b9d2fcc9
|
@ -58,10 +58,10 @@ And if 192.168.2.1 responds like so:
|
|||
Then the collected metrics will be:
|
||||
|
||||
```
|
||||
influxdbjson_produce_fruit,influxdbjson_url='http://127.0.0.1:8086/debug/vars',kind='apple' inventory=371.0,sold=112.0
|
||||
influxdbjson_produce_fruit,influxdbjson_url='http://127.0.0.1:8086/debug/vars',kind='banana' inventory=1000.0,sold=403.0
|
||||
influxdbjson_produce_fruit,url='http://127.0.0.1:8086/debug/vars',kind='apple' inventory=371.0,sold=112.0
|
||||
influxdbjson_produce_fruit,url='http://127.0.0.1:8086/debug/vars',kind='banana' inventory=1000.0,sold=403.0
|
||||
|
||||
influxdbjson_produce_transactions,influxdbjson_url='http://192.168.2.1:8086/debug/vars' total=100.0,balance=184.75
|
||||
influxdbjson_produce_transactions,url='http://192.168.2.1:8086/debug/vars' total=100.0,balance=184.75
|
||||
```
|
||||
|
||||
There are two important details to note about the collected metrics:
|
||||
|
|
|
@ -40,7 +40,7 @@ func (*InfluxDBJSON) SampleConfig() string {
|
|||
#
|
||||
# Would result in this recorded metric:
|
||||
#
|
||||
# influxdbjson_server_connections,influxdbjson_url='http://127.0.0.1:8086/x',host='foo' avg_ms=1.234
|
||||
# influxdbjson_server_connections,url='http://127.0.0.1:8086/x',host='foo' avg_ms=1.234
|
||||
[[plugins.influxdbjson]]
|
||||
# Name to use for measurement
|
||||
name = "influxdb"
|
||||
|
@ -142,7 +142,7 @@ func (i *InfluxDBJSON) gatherURL(
|
|||
}
|
||||
|
||||
// Add a tag to indicate the source of the data.
|
||||
p.Tags["influxdbjson_url"] = url
|
||||
p.Tags["url"] = url
|
||||
|
||||
acc.AddFields(
|
||||
i.Name+"_"+p.Name,
|
||||
|
|
|
@ -85,7 +85,7 @@ func TestBasic(t *testing.T) {
|
|||
},
|
||||
map[string]string{
|
||||
"id": "ex1",
|
||||
"influxdbjson_url": fakeServer.URL + "/endpoint",
|
||||
"url": fakeServer.URL + "/endpoint",
|
||||
},
|
||||
))
|
||||
require.NoError(t, acc.ValidateTaggedFieldsValue(
|
||||
|
@ -95,7 +95,7 @@ func TestBasic(t *testing.T) {
|
|||
},
|
||||
map[string]string{
|
||||
"id": "ex2",
|
||||
"influxdbjson_url": fakeServer.URL + "/endpoint",
|
||||
"url": fakeServer.URL + "/endpoint",
|
||||
},
|
||||
))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue