Collecting debugging information from Teleport Server

Teleport provides diagnostic endpoint

When teleport is started in debug mode (with teleport start -d flag) Golang’s CPU, memory and go routines dumps could be collected on the host.

Assuming debugging endpoint address is set to127.0.0.1:3434, the following key profiles
can be collected:

CPU profile (it will observe the system for 30 seconds and collect metrics) about CPU usage
per function:

curl -o cpu.profile http://127.0.0.1:3434/debug/pprof/profile

Note: This curl command will hang for 30 seconds collecting the CPU profile

Goroutine profile shows how many concurrent Golang “lightweight threads” are used in the system:

curl -o goroutine.profile http://127.0.0.1:3434/debug/pprof/goroutine

Heap profile shows allocated objects in the system:

curl -o heap.profile http://127.0.0.1:3434/debug/pprof/heap

The resulting profiles go tool pprof tool:

go tool pprof cpu.profile
go tool pprof heap.profile
go tool pprof goroutine.profile