Skip to content

Commit

Permalink
Fix build from ForEach -> Range (#3174)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcamp authored Apr 19, 2021
1 parent 765429a commit ed6facc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions exporter/newrelicexporter/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,19 +416,21 @@ func (t *transformer) MetricAttributes(baseAttributes map[string]interface{}, at
for k, v := range baseAttributes {
rawMap[k] = v
}
attrMap.ForEach(func(k string, v string) {
attrMap.Range(func(k string, v string) bool {
// Only include attribute if not an override attribute
if _, isOverrideKey := t.OverrideAttributes[k]; !isOverrideKey {
rawMap[k] = v
}
return true
})

return rawMap
}

func (t *transformer) TrackAttributes(location attributeLocation, attributeMap pdata.AttributeMap) {
attributeMap.ForEach(func(k string, v pdata.AttributeValue) {
attributeMap.Range(func(k string, v pdata.AttributeValue) bool {
statsKey := attributeStatsKey{location: location, attributeType: v.Type()}
t.details.attributeMetadataCount[statsKey]++
return true
})
}

0 comments on commit ed6facc

Please sign in to comment.