Pyroscope Python integration
Project description
Pyroscope Python Package
Pyroscope integration for Python
What is Pyroscope
Pyroscope is a tool that lets you continuously profile your applications to prevent and debug performance issues in your code. It consists of a low-overhead agent which sends data to the Pyroscope server which includes a custom-built storage engine. This allows for you to store and query any applications profiling data in an extremely efficient and cost effective way.
How to install Pyroscope for Python Applications
pip install pyroscope-io
Minimal Configuration
Add the following code to your application. This code will initialize pyroscope profiler and start profiling:
import pyroscope
pyroscope.configure(
application_name = "my.python.app", # replace this with some name for your application
server_address = "http://my-pyroscope-server:4040", # replace this with the address of your pyroscope server
)
Full Configuration
Optionally, you can configure several parameters:
import pyroscope
pyroscope.configure(
application_name = "my.python.app", # replace this with some name for your application
server_address = "http://my-pyroscope-server:4040", # replace this with the address of your pyroscope server
auth_token = "{YOUR_API_KEY}", # optional, if authentication is enabled, specify the API key
sample_rate = 100, # default is 100
detect_subprocesses = False, # detect subprocesses started by the main process; default is False
oncpu = True # report cpu time only; default is True
gil_only = True # only include traces for threads that are holding on to the Global Interpreter Lock; default is True
log_level = "info" # default is info, possible values: trace, debug, info, warn, error and critical
tags = {
"region": '{os.getenv("REGION")}',
}
)
Tags
You can add tags to certain parts of your code:
# You can use a wrapper:
with pyroscope.tag_wrapper({ "controller": "slow_controller_i_want_to_profile" }):
slow_code()
Example
Check out this example python project in our repository for examples of how you can use these features.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyroscope_io-0.8.16-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: pyroscope_io-0.8.16-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: Python 2, Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b91ce5b240f8de756c16a17022ca8e25ef8a4eed461c7d074b8a0841cf7b445
|
|
| MD5 |
9882f7954b1d280d4eafab18830e2cc6
|
|
| BLAKE2b-256 |
eb8f88d792e9cacd6ff3bd9a50100586ddc665e02a917662c17d30931f778542
|
Provenance
The following attestation bundles were made for pyroscope_io-0.8.16-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:
Publisher:
publish.yml on grafana/pyroscope-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyroscope_io-0.8.16-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
6b91ce5b240f8de756c16a17022ca8e25ef8a4eed461c7d074b8a0841cf7b445 - Sigstore transparency entry: 844573279
- Sigstore integration time:
-
Permalink:
grafana/pyroscope-rs@faee655224ea6401f18844235f2846cb4db49720 -
Branch / Tag:
refs/tags/python-0.8.16 - Owner: https://github.com/grafana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@faee655224ea6401f18844235f2846cb4db49720 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyroscope_io-0.8.16-py2.py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.
File metadata
- Download URL: pyroscope_io-0.8.16-py2.py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
- Upload date:
- Size: 3.2 MB
- Tags: Python 2, Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86f0f047554ff62bd92c3e5a26bc2809ccd467d11fbacb9fef898ba299dbda59
|
|
| MD5 |
c2848f271674c799d9535db2a67c8f34
|
|
| BLAKE2b-256 |
397a261f53ede16b7db19984ec80480572b8e9aa3be0ffc82f62650c4b9ca7d6
|
Provenance
The following attestation bundles were made for pyroscope_io-0.8.16-py2.py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl:
Publisher:
publish.yml on grafana/pyroscope-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyroscope_io-0.8.16-py2.py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl -
Subject digest:
86f0f047554ff62bd92c3e5a26bc2809ccd467d11fbacb9fef898ba299dbda59 - Sigstore transparency entry: 844573280
- Sigstore integration time:
-
Permalink:
grafana/pyroscope-rs@faee655224ea6401f18844235f2846cb4db49720 -
Branch / Tag:
refs/tags/python-0.8.16 - Owner: https://github.com/grafana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@faee655224ea6401f18844235f2846cb4db49720 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyroscope_io-0.8.16-py2.py3-none-macosx_11_0_x86_64.whl.
File metadata
- Download URL: pyroscope_io-0.8.16-py2.py3-none-macosx_11_0_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: Python 2, Python 3, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc98355e27c0b7b61f27066500fe1045b70e9459bb8b9a3082bc4755cb6392b6
|
|
| MD5 |
866b3d9956b3e128445788287643379e
|
|
| BLAKE2b-256 |
5ec190fc335f2224da86d49016ebe15fb4f709c7b8853d4b5beced5a052d9ea3
|
Provenance
The following attestation bundles were made for pyroscope_io-0.8.16-py2.py3-none-macosx_11_0_x86_64.whl:
Publisher:
publish.yml on grafana/pyroscope-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyroscope_io-0.8.16-py2.py3-none-macosx_11_0_x86_64.whl -
Subject digest:
dc98355e27c0b7b61f27066500fe1045b70e9459bb8b9a3082bc4755cb6392b6 - Sigstore transparency entry: 844573286
- Sigstore integration time:
-
Permalink:
grafana/pyroscope-rs@faee655224ea6401f18844235f2846cb4db49720 -
Branch / Tag:
refs/tags/python-0.8.16 - Owner: https://github.com/grafana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@faee655224ea6401f18844235f2846cb4db49720 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyroscope_io-0.8.16-py2.py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyroscope_io-0.8.16-py2.py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 2, Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e07edcfd59f5bdce42948b92c9b118c824edbd551730305f095a6b9af401a9e8
|
|
| MD5 |
d6e8d4ba4ecc3a708f4a1b851d4cb286
|
|
| BLAKE2b-256 |
a850607b38b120ba8adad954119ba512c53590c793f0cf7f009ba6549e4e1d77
|
Provenance
The following attestation bundles were made for pyroscope_io-0.8.16-py2.py3-none-macosx_11_0_arm64.whl:
Publisher:
publish.yml on grafana/pyroscope-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyroscope_io-0.8.16-py2.py3-none-macosx_11_0_arm64.whl -
Subject digest:
e07edcfd59f5bdce42948b92c9b118c824edbd551730305f095a6b9af401a9e8 - Sigstore transparency entry: 844573278
- Sigstore integration time:
-
Permalink:
grafana/pyroscope-rs@faee655224ea6401f18844235f2846cb4db49720 -
Branch / Tag:
refs/tags/python-0.8.16 - Owner: https://github.com/grafana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@faee655224ea6401f18844235f2846cb4db49720 -
Trigger Event:
release
-
Statement type: