Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyroscope-io-0.4.4.tar.gz (8.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyroscope_io-0.4.4-cp39-cp39-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyroscope_io-0.4.4-cp38-cp38-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyroscope_io-0.4.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyroscope_io-0.4.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file pyroscope-io-0.4.4.tar.gz.

File metadata

  • Download URL: pyroscope-io-0.4.4.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.7 Linux/4.14.186-146.268.amzn2.x86_64

File hashes

Hashes for pyroscope-io-0.4.4.tar.gz
Algorithm Hash digest
SHA256 7fb14af329182c0c906c7f523b8fcde014f20bc1e0eb559259ba42e10af7f602
MD5 7a16c89f0246add1e8a7eb1274477f9f
BLAKE2b-256 147ad3a22cdee21ac0f48e75d989436433a66995fe2756cbe8cfa74f2367c88c

See more details on using hashes here.

File details

Details for the file pyroscope_io-0.4.4-cp39-cp39-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyroscope_io-0.4.4-cp39-cp39-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b13c6c591ab9c81dedf126dab13d1278121d42b7bed202cd48dcbe4aabbc1e07
MD5 f007591734122255cd2e1bd266bfe1e9
BLAKE2b-256 8cdc2465f9b6590cd8f23013e5b343f2b5f46988a610459d2800db36ab265554

See more details on using hashes here.

File details

Details for the file pyroscope_io-0.4.4-cp38-cp38-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyroscope_io-0.4.4-cp38-cp38-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4472cd5ce2fe9084fedac98922a4930ea8939b438bf5c0968c80a6fa98fd0b54
MD5 f8fcc4fd3ce20b797fc8d2c04f7ae691
BLAKE2b-256 d0f53e6c7bb3e531fa73d403a91872431453e49f9503ff4d940fb76d3e3796fa

See more details on using hashes here.

File details

Details for the file pyroscope_io-0.4.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyroscope_io-0.4.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6987eac1548b644187dd7516f43d623bcf418f5c63f0887d2a14eebeb696fa3a
MD5 6d3120c9ecdc7f21dd47badc04cfa643
BLAKE2b-256 c085c7304acafa957962f88b869a899f77637d9ad0252a07ea2e56469ae7c353

See more details on using hashes here.

File details

Details for the file pyroscope_io-0.4.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyroscope_io-0.4.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e2f6439234b6ec0b095e9790d1b37ba485194f8e678885b89dda9244f4590224
MD5 694eb6982139baa67b71183b6b2b9796
BLAKE2b-256 cf559b62baf13a30e9d395d1b89f6c7f43dc63a63d1f0f5ce77fe301a1c3377d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page