Skip to content

Commit

Permalink
profile deprecated attributes logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed Dec 17, 2024
1 parent f0910f4 commit 2a2feff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pdata/pprofile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ import "go.opentelemetry.io/collector/pdata/pcommon"
//
// Deprecated: [v0.117.0] This field has been removed, and replaced with AttributeIndices
func (ms Profile) Attributes() pcommon.Map {
return pcommon.NewMap()
m := pcommon.NewMap()
for _, i := range ms.AttributeIndices().AsRaw() {
a := ms.AttributeTable().At(int(i))
m.PutStr(a.Key(), a.Value().AsString())
}

Check warning on line 16 in pdata/pprofile/profile.go

View check run for this annotation

Codecov / codecov/patch

pdata/pprofile/profile.go#L11-L16

Added lines #L11 - L16 were not covered by tests

return m

Check warning on line 18 in pdata/pprofile/profile.go

View check run for this annotation

Codecov / codecov/patch

pdata/pprofile/profile.go#L18

Added line #L18 was not covered by tests
}

0 comments on commit 2a2feff

Please sign in to comment.