Debugging and Troubleshooting¶
When tsuru API is running slow or hanging, we may want troubleshoot it to discover what is the source of the problem.
One of the ways to debug/troubleshoot the tsuru API is by analyzing the running goroutines.
We may do it by cURL or by sending a USR1 signal.
Tsuru has a path that can be used by cURL to return all the goroutines in execution. This path is : /debug/goroutines
$ curl -X GET -H "Authorization: bearer <API key>" <tsuru-host>:<port>/debug/goroutines
If for some reason the process is no longer accepting connections, the solution using cURL will not work.
Alternatively, tsuru API is able to handle the USR1 signal to dump goroutines in the tsurud execution screen:
$ kill -s USR1 <tsurud-PID>