0

I am using kubectl-flame to run async-profiler on k8s pods.

When profiling a microservice that runs multiple replicas - I have a separate *.svg flamegraph for each pod.

QUESTION: Is there a way to merge those *.svg files into one graph?

ludenus
  • 1,161
  • 17
  • 30

1 Answers1

0

Since version 2.0, released more than a year ago, async-profiler no longer generates svg output. It now creates Flame Graphs on HTML 5 Canvas. Such graphs are smaller in size and a way more responsive comparing to svg.

As to merging, it is much easier with another format supported by async profiler - collapsed stacks. Use -o collapsed profiler option to dump output in that format. Then, to merge profiles in collapsed format, just concatenate the corresponding output files.

A flame graph can be constructed from collapsed output with a converter included in async-profiler package. Here is how to do it:

java -cp converter.jar FlameGraph input.collapsed output.html
apangin
  • 92,924
  • 10
  • 193
  • 247
  • yes, but when you run async profiler with kubectl flame plugin - there is no option to choose html output format – ludenus Apr 08 '22 at 08:21
  • @ludenus Well, you can modify kubectl-flame to add this option, or just use async-profiler alone, it [supports containers](https://github.com/jvm-profiling-tools/async-profiler/#profiling-java-in-a-container) out of the box. – apangin Apr 08 '22 at 12:50