How to use fgtrace

Tutorial on how to get started with fgtrace

Instructions

  1. Enable fgtrace

    Untitled

  2. Forward the new fgtrace port

    Untitled

  3. Visit the /debug/fgtrace trace path using Insomnia or similar. (It will take about half minute for a trace to complete

    Untitled

  4. Export the returned JSON

    Untitled

  5. Open the Perfetto UI

  6. Click on “Open trace file” and select the exported JSON

    Untitled

  7. Wait for it to load

  8. You are now seeing a chrome like waterfall graph, showing the wallclock time used by each goroutine

    Untitled

  9. If you expand a goroutine, you can view what function calls it made

    Untitled

  10. Due to our sampling frequency, function calls under 0.01 seconds will not be captured

Tip:

You can use the query parameters “seconds” and “hz” to control the trace length and frequency

Untitled

Last modified February 17, 2023: update (#208) (ea731fc)