The `pyroscope-io` library provides seamless integration for Python applications with the Pyroscope continuous profiling platform. It collects CPU and memory profiling data from your application and sends it to a Pyroscope server for visualization and analysis. Currently at version 1.0.4, it follows a feature-driven release cadence.
pip install pyroscope-ioVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to configure `pyroscope-io` and profile specific functions using the `@pyroscope.profile` decorator. Ensure a Pyroscope server is running and accessible at the configured `server_address`. The `application_name` is crucial for identifying your data in the Pyroscope UI.
Always explicitly set `application_name` in `pyroscope.configure()`. Ensure `server_address` points to a running Pyroscope server (e.g., via environment variable `PYROSCOPE_SERVER_ADDRESS` or directly in `configure`).
For continuous profiling, rely primarily on `pyroscope.configure()` to initialize the profiler. Only use `pyroscope.start()` and `pyroscope.stop()` for specific, short-lived profiling sessions where you need fine-grained control over the profiling lifecycle.
Before running your Python application with Pyroscope integration, ensure that a Pyroscope server instance is running and reachable from your application's host and port. You can verify network connectivity using `ping` or `curl` to the `server_address`.
Install the library using the command: `pip install pyroscope-io`
Ensure `pyroscope.configure(application_name='your_app', server_address='http://localhost:4040')` is called with the necessary parameters before attempting to start or stop profiling.
Verify that the Pyroscope server is running, that the `server_address` (e.g., `http://localhost:4040`) in `pyroscope.configure()` is correct and accessible, and check for any network or firewall restrictions.
No dependency data recorded yet.