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

FR: Allow embedding static flamegraphs in an HTML page. Output HTML Flamegraph. #670

Open
mhansen opened this issue Nov 10, 2021 · 2 comments
Labels
Priority: p3 Buganizer priority - P3 type: feat Buganizer type - Feature Request

Comments

@mhansen
Copy link
Contributor

mhansen commented Nov 10, 2021

This probably isn't a high priority item, but it might be easy. Filing a Feature Request to track, and to hear if other people think it's a good idea or not.

Recently I published a blogpost about a pprof feature: https://www.markhansen.co.nz/pprof-tagroot/. I wanted to build in an interactive flamegraph that people can hover and see in their browser.

Ideally I'd want to get the d3-flame-graph JSON format output from the pprof tool, and embed that into my page with my own skinning.

Or, alternatively, have pprof output a single HTML page with the flamegraph in it. Like https://github.com/brendangregg/FlameGraph does, or like how we can output other file formats. Then embed that page in my page as an iframe.

pprof already has an exporter to d3-flame-graph format built-in, as part of the Flamegraph view in pprof web. But it's not easy to embed a web server in a blog. I ended up saving the HTML from pprof web using the browser's "Save As" function, then hacking the CSS to hide the top-nav-bar (which would be full of broken links if I tried to embed them in a website) with display: none;.

Given pprof already has the exporter to d3-flame-graph format, and it seems like a stable format, which is already output by some other profiling tools, I propose adding a -d3-flame-graph output option? It could output HTML (containing JSON), or just JSON. Or we could add both options.

The JSON format would be easier to start with (we already have it). The HTML format would be more useful to more people (easily attach it to bugs, for example).

@aalexand
Copy link
Collaborator

I think it's a dupe of #401. I'm not sure on the priority and how enthusiastic I'm about it. On one hand it's useful, on the other hand requests for this are fairly rare and I'd rather keep the pprof surface minimal because deprecating features is hard.

@mhansen
Copy link
Contributor Author

mhansen commented Nov 10, 2021 via email

@mhansen mhansen changed the title FR: Allow embedding static flamegraphs in an HTML page. Output d3-flame-graph JSON format, or HTML Flamegraph. FR: Allow embedding static flamegraphs in an HTML page. Output HTML Flamegraph. Nov 23, 2021
@Louis-Ye Louis-Ye added type: feat Buganizer type - Feature Request Priority: p3 Buganizer priority - P3 labels Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: p3 Buganizer priority - P3 type: feat Buganizer type - Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants