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
2 people authored and atoulme committed Oct 11, 2024
1 parent 5087319 commit 2bf3cea
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 2bf3cea

Please sign in to comment.