diff --git a/internal/flamegraph/flamegraph.go b/internal/flamegraph/flamegraph.go index 317a346..dc81228 100644 --- a/internal/flamegraph/flamegraph.go +++ b/internal/flamegraph/flamegraph.go @@ -572,7 +572,8 @@ func GetFlamegraphFromCandidates( for tid, callTree := range result.CallTrees { if intervals, ok := result.Intervals[tid]; ok { - for _, interval := range intervals { + sortedAndMergedIntervals := mergeIntervals(&intervals) + for _, interval := range sortedAndMergedIntervals { intervalExample := utils.NewExampleFromProfilerChunk( result.Chunk.ProjectID, result.Chunk.ProfilerID,