pyroscope icon indicating copy to clipboard operation
pyroscope copied to clipboard

Calculate sample rate correctly

Open simonswine opened this issue 3 months ago • 0 comments

The flamebearer metadata passes the sample rate to the frontend: https://github.com/grafana/pyroscope/blob/9bc2847e6b2e24a09f85b3511023fc1e90269385/pkg/og/structs/flamebearer/flamebearer.go#L85, we currently hard code the value:

https://github.com/grafana/pyroscope/blob/9bc2847e6b2e24a09f85b3511023fc1e90269385/pkg/model/flamegraph.go#L128

While the older version of flamebearer calculated it from PeriodDuration:

https://github.com/grafana/pyroscope/blob/9bc2847e6b2e24a09f85b3511023fc1e90269385/pkg/og/structs/flamebearer/convert/convert.go#L199-L204

In reality the data in Duration is not propagated correctly in our query path as those values remain unpopulated.

https://github.com/grafana/pyroscope/issues/4192

Related #3342

simonswine avatar Sep 17 '25 08:09 simonswine