Skip to content

Commit

Permalink
Update processor/metricsgenerationprocessor/utils.go
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitrii Anoshin <[email protected]>
  • Loading branch information
crobert-1 and dmitryax authored Oct 7, 2024
1 parent c4deffc commit 6fea4bc
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions processor/metricsgenerationprocessor/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit 6fea4bc

Please sign in to comment.