How to analyze the performance of your go application in production

You should definitely use chi’s middleware for running pprof and stuff in your admin panel.
That’s the repo —

That’s the profiler —

After that you can run something like this in shell:

If you run into problems with graphviz like this Failed to execute dot. Is Graphviz installed? Error: exec: "dot": executable file not found in $PATH, just install it with brew install graphviz.

Also you can just start watching it interactively with

Inside pprof you can run commands like top -cum or list (like list main.main).

Trace profiles can be watched by

There is a nice video on that: