Pyroscope integration for Python
Project description
Pyroscope Python Integration
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
Basic Usage of Pyroscope
import pyroscope_io as pyroscope
pyroscope.configure(
app_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
)
Adding Tags
Tags allow for users to view their data at different levels of granularity depending on what "slices" make sense for their application. This can be anything from region or microservice to more dynamic tags like controller or api route.
import os
import pyroscope_io as pyroscope
pyroscope.configure(
app_name = "simple.python.app",
server_address = "http://my-pyroscope-server:4040",
tags = {
"hostname": os.getenv("HOSTNAME"),
}
)
# You can use a wrapper:
with pyroscope.tag_wrapper({ "controller": "slow_controller_i_want_to_profile" }):
slow_code()
Examples
For more examples see examples/python in the main repo.
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 Distribution
Built Distributions
Hashes for pyroscope_io-0.4.6-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f07d6bb3c5a08176b1770a526c2d37dd8ce437e32376e97d863cb4eeda059fd |
|
MD5 | b88a4d91161fc6221c4f295842ab857d |
|
BLAKE2b-256 | fe93c40d233a414e96da345764947290c3a603a514cd6f0f6da913eb3d97e0be |
Hashes for pyroscope_io-0.4.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c98b27d43e0207e36ad2970ad96839ecddd0d5f6debc50f54e00c955c5d1c066 |
|
MD5 | 67672bf20451f022cef54f9e7dcc2020 |
|
BLAKE2b-256 | 9a2cf553a53f00b7cf8932523386fde0d734920090236c48f7e602cae738cfe4 |
Hashes for pyroscope_io-0.4.6-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 707d44f3e8ec6029e509e4200dd20d724b518338337175439e174c80029a0014 |
|
MD5 | 7320639e23ddb6b9b2717af145943b43 |
|
BLAKE2b-256 | be4786d7c81fce82f81d5d30e74ebd522b0060c6ded3c542e4cb91a04da45fe8 |
Hashes for pyroscope_io-0.4.6-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d759493ff8addcb125af67d8037fde70697251639b8f2889daf23c292772ee3 |
|
MD5 | fd1a422f1569dcd779b25b009a27fbef |
|
BLAKE2b-256 | 8ddfd3fc3dff50739e04d3c98993004ef1cf7c04ecf84a11e2a8080aa32c5fd3 |
Hashes for pyroscope_io-0.4.6-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbf3be5c487afbae31d032a11281fc3cc1c0a3447681cc198ec4dae9c41ab19d |
|
MD5 | 60d05625c1aa3abcfb550f87c10613e4 |
|
BLAKE2b-256 | 6e29e962ade1e82700090d9520f9bbf9f677880d5f08dc4bb37bb393dc56ecbe |
Hashes for pyroscope_io-0.4.6-cp36-cp36m-manylinux_2_17_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dbd8559b40b268bffb7e6e832b857698f02b3c9159d3c1731a0c082f66955a6 |
|
MD5 | ee1b8d7a27f0f1592a07f047df96d353 |
|
BLAKE2b-256 | c655c3b56f04a6ba8d7f19c6d0a0366f25f4caefe34bbf160a95418577b6a7f8 |