pyroscope agent

The command continuously tracks configured targets and attaches profilers to them. This command is primarily supposed to be run in the context of a service manager such as systemd or Windows Service Control Manager, or when the target application is not known in advance.

note

pyroscope agent command is only supported on Windows.

Command line arguments

NameDefault ValueUsage
log-file-pathLog file path.
log-levelinfoLog level: debug|info|warn|error.
no-loggingfalseDisables logging from pyroscope.
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.

Configuration file options

---
# Log file path.
log-file-path: ""
# Log level: debug|info|warn|error.
log-level: "info"
# Disables logging from pyroscope.
no-logging: "false"
# 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"
# List of targets to be profiled.
targets: []

Targets

Targets describe applications to be profiled. At this moment the only supported type is system service.

Note that targets can not be specified with command line arguments or environment variables.

---
# Name of the system service to be profiled.
service-name: ""
# Name of the profiler you want to use. Supported ones are: pyspy, rbspy, phpspy, dotnetspy, ebpfspy.
spy-name: ""
# 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"
# Enables blocking mode for pyspy.
pyspy-blocking: "false"

Example

This example shows how a system service with name MyService may be profiled:

---
log-level: "debug"
server-address: http://pyroscope-server:4040
targets:
- application-name: my.dotnet.svc
spy-name: dotnetspy
service-name: MyService