pyroscope exec

The command spawns a new process and attaches configured profiler. Once pyroscope exec exits, the child process exits as well and vice-versa. This command may be used for testing, as a docker entrypoint, or as a systemd service unit command.

Command line arguments

The arguments are the same as for pyroscope exec except that pyroscope connect requires -pid to be specified:

NameDefault ValueUsage
spy-nameautoName of the profiler you want to use. Supported ones are: pyspy, rbspy, phpspy, dotnetspy, ebpfspy.
application-nameApplication name used when uploading profiling data.
sample-rate100Sample rate for the profiler in Hz. 100 means reading 100 times per second.
detect-subprocessestrueMakes pyroscope keep track of and profile subprocesses of the main process.
log-levelinfoLog level: debug|info|warn|error.
server-addresshttp://localhost:4040Address of the pyroscope server.
auth-tokenAuthorization token used to upload profiling data.
upstream-threads4Number of upload threads.
upstream-request-timeout10sProfile upload timeout.
no-loggingfalseDisables logging from pyroscope.
no-root-dropfalseDisables permissions drop when ran under root. use this one if you want to run your command as root.
user-nameStarts process under specified user name.
group-nameStarts process under specified group name.
pyspy-blockingfalseEnables blocking mode for pyspy.

Configuration file options

---
# Name of the profiler you want to use. Supported ones are: pyspy, rbspy, phpspy, dotnetspy, ebpfspy.
spy-name: "auto"
# Application name used when uploading profiling data.
application-name: ""
# Sample rate for the profiler in Hz. 100 means reading 100 times per second.
sample-rate: "100"
# Makes pyroscope keep track of and profile subprocesses of the main process.
detect-subprocesses: "true"
# Log level: debug|info|warn|error.
log-level: "info"
# Address of the pyroscope server.
server-address: "http://localhost:4040"
# Authorization token used to upload profiling data.
auth-token: ""
# Number of upload threads.
upstream-threads: "4"
# Profile upload timeout.
upstream-request-timeout: "10s"
# Disables logging from pyroscope.
no-logging: "false"
# Disables permissions drop when ran under root. use this one if you want to run your command as root.
no-root-drop: "false"
# Starts process under specified user name.
user-name: ""
# Starts process under specified group name.
group-name: ""
# Enables blocking mode for pyspy.
pyspy-blocking: "false"