Skip to content

Add samples as a profile type for otlp cpu profiles - #6118

Open
elizaveta-andreeva wants to merge 2 commits into
grafana:mainfrom
elizaveta-andreeva:feat/add_samples_as_profile_type_otlp
Open

elizaveta-andreeva wants to merge 2 commits into
grafana:mainfrom
elizaveta-andreeva:feat/add_samples_as_profile_type_otlp

Conversation

@elizaveta-andreeva

Copy link
Copy Markdown

Summary

For OTLP CPU profiles that go through the samples-to-nanos conversion, keep the raw sample count as a second sample type (samples:count) next to cpu:nanoseconds.

Changes in pkg/ingester/otlp/convert.go:

  • When the converted profile has a single sample type and it goes through sampleConversionTypeSamplesToNanos (meaning that we had samples:count:cpu:nanoseconds profile type), append samples:count with no conversion applied
  • Pad sample values up to the number of sample types, so the new type gets the original value before it is multiplied into nanoseconds
  • Copy os.Values before modifying it, since the *= in the conversion would otherwise change the source values

TestDifferentServiceNames now expects two sample types

Why

Pyroscope stores CPU profiles as cpu:nanoseconds, but the UI labels them as "Samples". That reads like a number of hits at a code location, while the value is time. With the raw count kept as its own profile type, it can be selected separately and the nanoseconds type keeps its meaning.

Related to #3340

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.

1 participant