From 2bf3cea182d61b4cfdda947059d3ebeb343017d4 Mon Sep 17 00:00:00 2001 From: Curtis Robert Date: Mon, 7 Oct 2024 07:18:57 -0700 Subject: [PATCH] Update processor/metricsgenerationprocessor/utils.go Co-authored-by: Dmitrii Anoshin --- processor/metricsgenerationprocessor/utils.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/processor/metricsgenerationprocessor/utils.go b/processor/metricsgenerationprocessor/utils.go index 7ea851071f78..72fab9ca7f6e 100644 --- a/processor/metricsgenerationprocessor/utils.go +++ b/processor/metricsgenerationprocessor/utils.go @@ -120,17 +120,7 @@ func generateMetricFromMatchingAttributes(metric1 pmetric.Metric, metric2 pmetri newDP.SetDoubleValue(val) metric2DP.Attributes().Range(func(k string, v pcommon.Value) bool { - switch v.Type() { - case pcommon.ValueTypeDouble: - newDP.Attributes().PutDouble(k, v.Double()) - - case pcommon.ValueTypeInt: - newDP.Attributes().PutInt(k, v.Int()) - case pcommon.ValueTypeBool: - newDP.Attributes().PutBool(k, v.Bool()) - default: - newDP.Attributes().PutStr(k, v.Str()) - } + v.CopyTo(newDP.Attributes().PutEmpty(k)) // Always return true to ensure iteration over all attributes return true })