From 5b863848ddc48b413c8b1d44c2d43f5d87940ded Mon Sep 17 00:00:00 2001 From: glightfoot Date: Fri, 19 Jun 2020 09:10:19 -0400 Subject: [PATCH] adding more tests for malformed signalfx tags Signed-off-by: glightfoot --- bridge_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bridge_test.go b/bridge_test.go index 6b4dff6..cb4b7af 100644 --- a/bridge_test.go +++ b/bridge_test.go @@ -200,6 +200,26 @@ func TestHandlePacket(t *testing.T) { CLabels: map[string]string{"tag1": "bar", "tag2": "baz"}, }, }, + }, { + name: "SignalFx tag extension, no tags", + in: "foo.[]test:100|c", + out: event.Events{ + &event.CounterEvent{ + CMetricName: "foo.test", + CValue: 100, + CLabels: map[string]string{}, + }, + }, + }, { + name: "SignalFx tag extension, non-kv tags", + in: "foo.[tag1,tag2]test:100|c", + out: event.Events{ + &event.CounterEvent{ + CMetricName: "foo.test", + CValue: 100, + CLabels: map[string]string{}, + }, + }, }, { name: "influxdb tag extension with tag keys unsupported by prometheus", in: "foo,09digits=0,tag.with.dots=1:100|c",