From 65b9d2fcc9749c7bef98a0e6478036b0c193999e Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Thu, 10 Dec 2015 16:25:17 -0800 Subject: [PATCH] Rename `influxdbjson_url` tag to `url` --- plugins/influxdbjson/README.md | 6 +++--- plugins/influxdbjson/influxdb_json.go | 6 +++--- plugins/influxdbjson/influxdb_json_test.go | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/plugins/influxdbjson/README.md b/plugins/influxdbjson/README.md index e4c4bf118..f26c937f2 100644 --- a/plugins/influxdbjson/README.md +++ b/plugins/influxdbjson/README.md @@ -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: diff --git a/plugins/influxdbjson/influxdb_json.go b/plugins/influxdbjson/influxdb_json.go index f0066ab78..61d966e47 100644 --- a/plugins/influxdbjson/influxdb_json.go +++ b/plugins/influxdbjson/influxdb_json.go @@ -40,14 +40,14 @@ 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" # Multiple URLs from which to read InfluxDB-formatted JSON 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. - p.Tags["influxdbjson_url"] = url + p.Tags["url"] = url acc.AddFields( i.Name+"_"+p.Name, diff --git a/plugins/influxdbjson/influxdb_json_test.go b/plugins/influxdbjson/influxdb_json_test.go index ed75f4fb8..1f3663e20 100644 --- a/plugins/influxdbjson/influxdb_json_test.go +++ b/plugins/influxdbjson/influxdb_json_test.go @@ -26,11 +26,11 @@ func TestBasic(t *testing.T) { } }, "ignored": { - "willBeRecorded": false + "willBeRecorded": false }, "ignoredAndNested": { "hash": { - "is": "nested" + "is": "nested" } }, "array": [ @@ -40,11 +40,11 @@ func TestBasic(t *testing.T) { "_2": { "name": "bar", "tags": { - "id": "ex2" - }, - "values": { - "x": "x" - } + "id": "ex2" + }, + "values": { + "x": "x" + } }, "pointWithoutFields_willNotBeIncluded": { "name": "asdf", @@ -84,8 +84,8 @@ func TestBasic(t *testing.T) { "s": "string", }, map[string]string{ - "id": "ex1", - "influxdbjson_url": fakeServer.URL + "/endpoint", + "id": "ex1", + "url": fakeServer.URL + "/endpoint", }, )) require.NoError(t, acc.ValidateTaggedFieldsValue( @@ -94,8 +94,8 @@ func TestBasic(t *testing.T) { "x": "x", }, map[string]string{ - "id": "ex2", - "influxdbjson_url": fakeServer.URL + "/endpoint", + "id": "ex2", + "url": fakeServer.URL + "/endpoint", }, )) }