Rename `influxdbjson_url` tag to `url`

This commit is contained in:
Mark Rushakoff 2015-12-10 16:25:17 -08:00
parent 78e73ed78c
commit 65b9d2fcc9
3 changed files with 17 additions and 17 deletions

View File

@ -58,10 +58,10 @@ And if 192.168.2.1 responds like so:
Then the collected metrics will be: 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,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='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: There are two important details to note about the collected metrics:

View File

@ -40,14 +40,14 @@ func (*InfluxDBJSON) SampleConfig() string {
# #
# Would result in this recorded metric: # 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]] [[plugins.influxdbjson]]
# Name to use for measurement # Name to use for measurement
name = "influxdb" name = "influxdb"
# Multiple URLs from which to read InfluxDB-formatted JSON # Multiple URLs from which to read InfluxDB-formatted JSON
urls = [ urls = [
"http://localhost:8086/debug/vars" "http://localhost:8086/debug/vars"
] ]
` `
} }
@ -142,7 +142,7 @@ func (i *InfluxDBJSON) gatherURL(
} }
// Add a tag to indicate the source of the data. // Add a tag to indicate the source of the data.
p.Tags["influxdbjson_url"] = url p.Tags["url"] = url
acc.AddFields( acc.AddFields(
i.Name+"_"+p.Name, i.Name+"_"+p.Name,

View File

@ -26,11 +26,11 @@ func TestBasic(t *testing.T) {
} }
}, },
"ignored": { "ignored": {
"willBeRecorded": false "willBeRecorded": false
}, },
"ignoredAndNested": { "ignoredAndNested": {
"hash": { "hash": {
"is": "nested" "is": "nested"
} }
}, },
"array": [ "array": [
@ -40,11 +40,11 @@ func TestBasic(t *testing.T) {
"_2": { "_2": {
"name": "bar", "name": "bar",
"tags": { "tags": {
"id": "ex2" "id": "ex2"
}, },
"values": { "values": {
"x": "x" "x": "x"
} }
}, },
"pointWithoutFields_willNotBeIncluded": { "pointWithoutFields_willNotBeIncluded": {
"name": "asdf", "name": "asdf",
@ -84,8 +84,8 @@ func TestBasic(t *testing.T) {
"s": "string", "s": "string",
}, },
map[string]string{ map[string]string{
"id": "ex1", "id": "ex1",
"influxdbjson_url": fakeServer.URL + "/endpoint", "url": fakeServer.URL + "/endpoint",
}, },
)) ))
require.NoError(t, acc.ValidateTaggedFieldsValue( require.NoError(t, acc.ValidateTaggedFieldsValue(
@ -94,8 +94,8 @@ func TestBasic(t *testing.T) {
"x": "x", "x": "x",
}, },
map[string]string{ map[string]string{
"id": "ex2", "id": "ex2",
"influxdbjson_url": fakeServer.URL + "/endpoint", "url": fakeServer.URL + "/endpoint",
}, },
)) ))
} }