- Available for:
Teleport leverages Go's diagnostic capabilities to collect and export profiling data. Profiles can help identify the cause of spikes in CPU, the source of memory leaks, or the reason for a deadlock.
The profiling endpoint is only enabled if the
--debug flag is supplied.
Teleport's diagnostic HTTP endpoints are disabled by default. You can enable them via:
Verify that Teleport is now serving the diagnostics endpoint:
Go's standard profiling endpoints are served at
Retrieving a profile requires sending a request to the endpoint corresponding
to the desired profile type. When debugging an issue it is helpful to collect
a series of profiles over a period of time.
CPU profile shows execution statistics gathered over a user specified period:
Download the profile into a file:curl -o cpu.profile http://127.0.0.1:3000/debug/pprof/profile?seconds=30
Visualize the profilego tool pprof -http : cpu.profile
Goroutine profiles show the stack traces for all running goroutines in the system:
Download the profile into a file:curl -o goroutine.profile http://127.0.0.1:3000/debug/pprof/goroutine
Visualize the profilego tool pprof -http : goroutine.profile
Heap profiles show allocated objects in the system:
Download the profile into a file:curl -o heap.profile http://127.0.0.1:3000/debug/pprof/heap
Visualize the profilego tool pprof -http : heap.profile
Trace profiles capture scheduling, system calls, garbage collections, heap size, and other events that are collected by the Go runtime over a user specified period of time:
Download the profile into a file:curl -o trace.out http://127.0.0.1:3000/debug/pprof/trace?seconds=5
Visualize the profilego tool trace trace.out