spotlight icon indicating copy to clipboard operation
spotlight copied to clipboard

Add flamegraphs for profiles

Open BYK opened this issue 11 months ago • 2 comments

We now have support for profiles (#565) and will have support for continuous profiling (#567) so we'd better have an aggregate profile view, where a flamegraph is the industry standard. These will ideally have their dedicated tab.

This component may help: getsentry/sentry@master/static/app/components/profiling/flamegraph/flamegraphPreview.tsx

BYK avatar Feb 05 '25 22:02 BYK

We should also try a sunburst chart: https://github.com/vasturiano/react-sunburst-chart

BYK avatar Mar 20 '25 22:03 BYK

@tylersayshi shared this library: https://github.com/antfu/nanovis and it looks awesome.

Image

It even supports on-the-fly switching between sunburst, flamegraph, and a tree map!

BYK avatar Apr 04 '25 08:04 BYK

hey @BYK ,

I think nanovis is a great option.

I did a quick PoC that parses the profile and maps it to a Flamegraph and other visualisations:

https://github.com/user-attachments/assets/95ad4cd0-2fe2-4557-8f6d-4b7f67afb3b5

The data shown here is from a single profile, it's not an aggregated Flamegraph. this is the direction I was thinking of for integrating profile visualisation. the UI is still a rough draft and will be improved in the final version.

cc @betegon

Shubhdeep12 avatar Jul 09 '25 07:07 Shubhdeep12

oh, this looks great @Shubhdeep12 ! Do you have this in a branch to try it out and gather some thoughts?

betegon avatar Jul 09 '25 08:07 betegon

Wow, this looks very nice @Shubhdeep12 - would love to play with it as @betegon suggested. I'd also love to see a sunburst chart there along with option for an inverted flamegraph (you just invert the stack traces before building the graph, which gives you a different view as the spans are merged differently)

BYK avatar Jul 09 '25 09:07 BYK

Sure here is the branch - feat/profile-tree

Shubhdeep12 avatar Jul 09 '25 11:07 Shubhdeep12

you just invert the stack traces before building the graph, which gives you a different view as the spans are merged differently

yeah we can add invert tree checkbox

Shubhdeep12 avatar Jul 09 '25 11:07 Shubhdeep12

hey @BYK @betegon did you get a chance to check this?

Shubhdeep12 avatar Jul 14 '25 06:07 Shubhdeep12

hHey @Shubhdeep12 ! Burak is OOO this week, i'll try to check this during the week. thanks for pushing ;)

betegon avatar Jul 14 '25 16:07 betegon

@Shubhdeep12 had a busy week, let's see how this looks like ;)

betegon avatar Jul 21 '25 09:07 betegon

I gave it a try and I liked it @Shubhdeep12 . It's useful and gets the job done. Maybe we can ship this, so we add this feature and improve it later.

betegon avatar Jul 21 '25 10:07 betegon

That's great! I'll improve it a little and raise a PR then

thanks for the review.

Shubhdeep12 avatar Jul 21 '25 10:07 Shubhdeep12