From e2854232d0d6b517cde8a1bf13628ae4b3bf8506 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Tue, 3 Nov 2015 11:04:52 -0700 Subject: [PATCH] Change HAProxy plugin tag from host to server fixes #342 --- CHANGELOG.md | 1 + plugins/haproxy/haproxy.go | 6 +++--- plugins/haproxy/haproxy_test.go | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e10bd93d..eee4a9ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ changed to just run docker commands in the Makefile. See `make docker-run` and `make docker-kill`. `make test` will still run all unit tests with docker. - Long unit tests are now run in CircleCI, with docker & race detector - Redis plugin tag has changed from `host` to `server` +- HAProxy plugin tag has changed from `host` to `server` ### Features - [#325](https://github.com/influxdb/telegraf/pull/325): NSQ output. Thanks @jrxFive! diff --git a/plugins/haproxy/haproxy.go b/plugins/haproxy/haproxy.go index a1d14a32a..e28baf1e8 100644 --- a/plugins/haproxy/haproxy.go +++ b/plugins/haproxy/haproxy.go @@ -165,9 +165,9 @@ func importCsvResult(r io.Reader, acc plugins.Accumulator, host string) ([][]str for field, v := range row { tags := map[string]string{ - "host": host, - "proxy": row[HF_PXNAME], - "sv": row[HF_SVNAME], + "server": host, + "proxy": row[HF_PXNAME], + "sv": row[HF_SVNAME], } switch field { case HF_QCUR: diff --git a/plugins/haproxy/haproxy_test.go b/plugins/haproxy/haproxy_test.go index 0d63985d4..b87618700 100644 --- a/plugins/haproxy/haproxy_test.go +++ b/plugins/haproxy/haproxy_test.go @@ -42,9 +42,9 @@ func TestHaproxyGeneratesMetricsWithAuthentication(t *testing.T) { require.NoError(t, err) tags := map[string]string{ - "host": ts.Listener.Addr().String(), - "proxy": "be_app", - "sv": "host0", + "server": ts.Listener.Addr().String(), + "proxy": "be_app", + "sv": "host0", } assert.NoError(t, acc.ValidateTaggedValue("stot", uint64(171014), tags)) @@ -109,9 +109,9 @@ func TestHaproxyGeneratesMetricsWithoutAuthentication(t *testing.T) { require.NoError(t, err) tags := map[string]string{ - "proxy": "be_app", - "host": ts.Listener.Addr().String(), - "sv": "host0", + "proxy": "be_app", + "server": ts.Listener.Addr().String(), + "sv": "host0", } assert.NoError(t, acc.ValidateTaggedValue("stot", uint64(171014), tags))