-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add FromAttributeIndices helper to pprofile #12176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FromAttributeIndices helper to pprofile #12176
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12176 +/- ##
=======================================
Coverage 91.84% 91.85%
=======================================
Files 465 466 +1
Lines 25325 25334 +9
=======================================
+ Hits 23261 23270 +9
Misses 1675 1675
Partials 389 389 ☔ View full report in Codecov by Sentry. |
4dc8a4a
to
e0a0548
Compare
The blocking request part is resolved.
c8f7bfa
to
35f5bfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me in general, would like other to specify where this function should live.
Couple things:
- Did you update benchmarks after latest changes?
- We should document that changes to the return map are not reflected to the profile. Would like to understand how you think we should design the API that can do changes.
6a872fd
to
eef33eb
Compare
Sorry, they're updated now.
I've added a mention that updates on the map will not change the record. We could have something like: ToAttributeIndices(data pcommon.Map, table AttributeTable, record attributable) That would properly update the AttributeTable with new entries, as well as the attributable indices. Addattribute(key, value string, table AttributeTable, record attributable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good. But I want you to add an issue and mark it as blocker for stabilizing profiles to find a solution for updates and try it before stabilizing this package.
Numbers look much better than at the beginning 👯 |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Profiles attributes are stored in a single `AttributeTable` attribute, and then referenced in each substruct as `AttributeIndices`. This means to read them as a `pcommon.Map`, a bit of pre-processing is required. This adds an helper method so each component manipulating profiles doesn't have to reimplement it. Benchmark: ``` go test -bench=BenchmarkFromAttributeIndices ./... goos: darwin goarch: arm64 pkg: go.opentelemetry.io/collector/pdata/pprofile cpu: Apple M1 Max BenchmarkFromAttributeIndices-10 9789714 123.2 ns/op 140 B/op 4 allocs/op PASS ok go.opentelemetry.io/collector/pdata/pprofile 1.952s PASS ok go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp 0.407s ```
Description
Profiles attributes are stored in a single
AttributeTable
attribute, and then referenced in each substruct asAttributeIndices
.This means to read them as a
pcommon.Map
, a bit of pre-processing is required.This adds an helper method so each component manipulating profiles doesn't have to reimplement it.
Benchmark: