Debugging using fgtrace
Forward the new fgtrace port
/debug/fgtracetrace path using Insomnia or a similar tool. Please note that it will take about half a minute for a trace to complete.
Export the returned JSON
Open the Perfetto UI
Click on “Open trace file” and select the exported JSON
Wait for it to load
You are now viewing a Chrome-like waterfall graph that shows the wallclock time used by each goroutine.
Expanding a goroutine will allow you to view the function calls it made.
Please note that due to our sampling frequency, function calls that take less than 0.01 seconds will not be captured.
Changing the trace length and frequency
To control the trace length and frequency, you can use the query parameters “seconds” and “hz”.