From 44090fc8f2374aae467d984d18a370c5ba0b3abf Mon Sep 17 00:00:00 2001 From: dirceumaranhaopn Date: Wed, 6 Jul 2022 11:56:17 -0400 Subject: [PATCH 1/3] Commiting changes for adjust the tag value --- receiver/statsdreceiver/protocol/statsd_parser.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/receiver/statsdreceiver/protocol/statsd_parser.go b/receiver/statsdreceiver/protocol/statsd_parser.go index 5923b50ea03a..acf580acb73d 100644 --- a/receiver/statsdreceiver/protocol/statsd_parser.go +++ b/receiver/statsdreceiver/protocol/statsd_parser.go @@ -295,11 +295,13 @@ func parseMessageToMetric(line string, enableMetricType bool) (statsDMetric, err tagSets := strings.Split(tagsStr, ",") for _, tagSet := range tagSets { - tagParts := strings.Split(tagSet, ":") + tagParts := strings.SplitN(tagSet, ":", 2) if len(tagParts) != 2 { return result, fmt.Errorf("invalid tag format: %s", tagParts) } - kvs = append(kvs, attribute.String(tagParts[0], tagParts[1])) + k := tagParts[0] + v := tagParts[1] + kvs = append(kvs, attribute.String(k, v)) } } else { From b68d5df16d93063fd683b54a5c33fb9dfd12b1b6 Mon Sep 17 00:00:00 2001 From: dirceumaranhaopn Date: Wed, 6 Jul 2022 11:57:26 -0400 Subject: [PATCH 2/3] Update statsd_parser.go Fixing formating error --- receiver/statsdreceiver/protocol/statsd_parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/statsdreceiver/protocol/statsd_parser.go b/receiver/statsdreceiver/protocol/statsd_parser.go index acf580acb73d..672500671611 100644 --- a/receiver/statsdreceiver/protocol/statsd_parser.go +++ b/receiver/statsdreceiver/protocol/statsd_parser.go @@ -300,7 +300,7 @@ func parseMessageToMetric(line string, enableMetricType bool) (statsDMetric, err return result, fmt.Errorf("invalid tag format: %s", tagParts) } k := tagParts[0] - v := tagParts[1] + v := tagParts[1] kvs = append(kvs, attribute.String(k, v)) } From 45a9bac01fe19fbcfba7256c3079308f0ece0882 Mon Sep 17 00:00:00 2001 From: dirceumaranhaopn Date: Wed, 6 Jul 2022 14:34:03 -0400 Subject: [PATCH 3/3] Adding info the unrelease file --- .../statsd-accept-colon-on-values-of-dimensions.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 unreleased/statsd-accept-colon-on-values-of-dimensions.yaml diff --git a/unreleased/statsd-accept-colon-on-values-of-dimensions.yaml b/unreleased/statsd-accept-colon-on-values-of-dimensions.yaml new file mode 100644 index 000000000000..9c69074a1e84 --- /dev/null +++ b/unreleased/statsd-accept-colon-on-values-of-dimensions.yaml @@ -0,0 +1,11 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: statsdreceiver + +# A brief description of the change +note: Fixing parsing issue for values on statsd receiver + +# One or more tracking issues related to the change +issues: [12120]