Introduction
Introduction in Pyroscope Guide.
Introduction#
Pyroscope is a profiling platform that captures, stores, and queries runtime profiles to deliver code-level performance insights with minimal overhead in the target environments. It integrates with Grafana to correlate profiling data with metrics, logs, and traces, enabling end-to-end visibility and faster root-cause analysis across services. The graph-based visualizations and comparison workflows help teams proactively optimize resource usage and reactively identify bottlenecks, improving reliability and latency.
Currently, this document outlines the architecture and prerequisites for enabling application performance profiling with Pyroscope, alongside Grafana Tempo for distributed tracing and MinIO for compatible storage, and specifies required container images and versions, network ports, and server-to-server connectivity.
WARNING: Pyroscope must not be installed/configured in any production environment; restrict usage strictly to non‑production tiers.
Required Components#
The following components are required for the Pyroscope profiling setup:
- MinIO: compatible object storage.
- Pyroscope: continuous profiling service on the app/observability tier.
- Grafana Tempo: tracing backend service running on the app/observability tier
- Grafana: The visualization layer that provides dashboards for viewing the Pyroscope profile data.
- NGINX: To mirror the JIM data to the OTEL collector and Tempo service.
Note: Ensure the existing JIM data flow is present via OTEL collector LB.
Prerequisites#
Ensure the following prerequisites are met:
1. Download the below version of Docker images:
a. DB server images.
-
- MinIO: RELEASE.2025-06-13T11-33-47Z
b. App server images.
-
- grafana/pyroscope:1.14.0
- grafana/tempo:2.8.1
- grafana/grafana:12.0.2
c. Web server image
-
- nginx:1.22.1
2. Required network ports are:
- 9000: MinIO.
- 4040: Pyroscope.
- 4321, 14255, 3200: Tempo.
3. Server-wise connectivity
- From target to Web HAProxy: 9998.
- From Web to Web Server: 9995
- From Web to App Server: 3003, 4040, 4321, 14250, 14255, 3200.
- From App to App Server: 3003.
- From App to DB Server: 9000.
CPU Profiling Setup#
Follow these steps to configure CPU profiling using Pyroscope and Tempo with MinIO storage:
MinIO server#
Ensure the following MinIO conditions are met:
1. Use MinIO in a single-node, single-disk arrangement for deployments.
2. Plan S3-compatible buckets for Pyroscope profiles and Tempo traces.
3. Set root credentials, volume path, and console address through environment variables, and mount a dedicated host directory into the container.
4. Start MinIO as a container with environment configuration and verify the console on the specified console address and the S3 API on port 9000.
Configuration#
Configure the MinIO by following these steps:
1. Navigate to the directory below:
<HEAL directory>/Appsone_Service
2. Create a "minio" directory.
a. Create a "minio" file and insert the following content in the file:
# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.
# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.
# Omit to use the default values 'minioadmin:minioadmin'.
# MinIO recommends setting non-default values as a best practice, regardless of environment
MINIO_ROOT_USER=<provide any username>
MINIO_ROOT_PASSWORD=<provide any password>
#For example:
#MINIO_ROOT_USER=healadmin
#MINIO_ROOT_PASSWORD=<password>
# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.
MINIO_VOLUMES="/mnt/data"
# MINIO_OPTS sets any additional command-line options to pass to the MinIO server.
# For example, `--console-address :9001` sets the MinIO Console listen port
MINIO_OPTS="--console-address :9001"
b. Create a "data" directory to store the data.
Docker#
Run the MinIO server container with host networking and the environment file mounted.
docker run -dt --network=host -v <HEAL directory>/Appsone_Service/minio/data:/mnt/data -v <HEAL directory>/Appsone_Service/minio/minio:/etc/config.env -e "MINIO_CONFIG_ENV_FILE=/etc/config.env" --cpus="4.0" --memory="4g" --name="minio" minio/minio:RELEASE.2025-06-13T11-33-47Z server --console-address ":9001"
Post Setup#
Create two buckets (for profiles and traces), a non-root access key/secret, and a bucket policy that allows list/get/put/delete on both buckets for that user.
1. Navigate to the Docker container by executing the following command:
docker exec -it minio bash
2. Create a server alias for MinIO CLI commands:
mc alias set 'heal-minio-server' 'http://localhost:9000' '<mention the username from minio file>' '<mention the password from minio file>'
For example:
mc alias set 'heal-minio-server' 'http://localhost:9000' 'healadmin' '<password>'
Expected output:
mc: Configuration written to '/tmp/.mc/config.json'. Please update your access credentials.
mc: Successfully created '/tmp/.mc/share'.
mc: Initialized share uploads '/tmp/.mc/share/uploads.json' file.
mc: Initialized share downloads '/tmp/.mc/share/downloads.json' file.
Added 'heal-minio-server' successfully.
3. Create buckets
a. Grafana Pyroscope data
mc mb heal-minio-server/grafana-pyroscope-data
Expected output:
Bucket created successfully 'heal-minio-server/grafana-pyroscope-data'.
b. Grafana trace data
mc mb heal-minio-server/grafana-traces-data
Expected output:
bucket created successfully 'heal-minio-server/grafana-traces-data'.
c. Create non-root user:
mc admin user add heal-minio-server <any user for profile> <any password>
For example:
mc admin user add heal-minio-server <username> puser@123
Expected output:
Added user '<username>' successfully.
4. Create a bucket access policy file
a. Navigate to the directory below:
cd /tmp/
b. Execute the below command to insert the heal-bucket-policy.json content:
cat > heal-bucket-policy.json << EOF
Expected output:
>
c. Paste the heal-bucket-policy.json content:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::grafana-pyroscope-data/*",
"arn:aws:s3:::grafana-pyroscope-data",
"arn:aws:s3:::grafana-traces-data/*",
"arn:aws:s3:::grafana-traces-data"
]
}
]
}
>EOF
d. Check the inserted content is available in the file by executing the command below:
ls
Expected output:
heal-bucket-policy.json
5. Assign the bucket access policy to the non-root user.
a. Create the heal-bucket-policy using the heal-bucket-policy. json.
mc admin policy create heal-minio-server heal-bucket-policy heal-bucket-policy.json
Expected output:
Created policy 'heal-bucket-policy' successfully.
b. Attach the policy to the non-root user.
mc admin policy attach heal-minio-server heal-bucket-policy --user <username>
Expected Output:
Attached Policies: [heal-bucket-policy]
Ports#
9000 – S3 API for Pyroscope and Tempo storage access.
Note: Ensure port 9001 is available to run the minio.