Skip to content
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

fix: otlp pprof fixes #3741

Merged
merged 5 commits into from
Dec 6, 2024
Merged

fix: otlp pprof fixes #3741

merged 5 commits into from
Dec 6, 2024

Conversation

korniltsev
Copy link
Collaborator

  • Do not append sample labels to series labels (imagine two samples with process=firefox and process=chrome, these attributes should not be appended to Push request series labels. Instead add them as sample labels.
  • Fix function name for unsymbolized functions, previously it was incorrectly using only one function per mapping. Now we create multiple (a lot of them actually) functions with format libfoo.so 0x...
  • Remove debugging pprof dump to fs

@korniltsev korniltsev requested a review from a team as a code owner December 5, 2024 08:06
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

dst.Location = []*googleProfile.Location{}
locationMappingIndexAddressMap := make(map[uint64]uint64)
// Convert locations and mappings
for i, loc := range src.Location {
gl := convertLocationBack(loc)
gl.Id = uint64(i + 1)
if len(gl.Line) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my understanding is that we only create those "placeholder" functions currently, as our query path relies on them to deduplicate.

I think a comment would be nice explaining that.

Maybe something worth considering doing later in the write path. Because if I sent currently Google pprofs without symbols I have the exact same problem. Or am I missing something 😂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I didn't test it, but it should be the same if we happen to receive pprof without symbols (lines) 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think frontend or read path just skips these locations.

image

vs

image

I think it is mostly needed to show the correct shape of the flamegraph - display that there were some frames we just could not name them

Copy link
Contributor

@marcsanmi marcsanmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

}
return int64(stringmap[s])
}
addstr("")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dst.Location = []*googleProfile.Location{}
locationMappingIndexAddressMap := make(map[uint64]uint64)
// Convert locations and mappings
for i, loc := range src.Location {
gl := convertLocationBack(loc)
gl.Id = uint64(i + 1)
if len(gl.Line) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I didn't test it, but it should be the same if we happen to receive pprof without symbols (lines) 😅

Copy link
Member

@petethepig petethepig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for doing this!

@korniltsev korniltsev merged commit 1886f2c into main Dec 6, 2024
18 checks passed
@korniltsev korniltsev deleted the korniltsev/otlp-pprof-fixes-tests branch December 6, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants