#profiling #data #command-line #observability #send #python #datakit

bin+lib py-spy-for-datakit

py-spy fork for sending data to datakit

2 releases

0.3.16 May 5, 2023
0.3.15 Nov 25, 2022
0.3.14 Nov 24, 2022

#160 in Caching

39 downloads per month

MIT license

1MB
26K SLoC

Rust 21K SLoC // 0.0% comments C 5K SLoC // 0.0% comments Python 141 SLoC // 0.4% comments Shell 34 SLoC // 0.1% comments Forge Config 21 SLoC Cython 6 SLoC // 0.4% comments

py-spy-for-datakit: Send profiling data to datakit instead of writing to a file

Installation

Prebuilt binary wheels can be installed from PyPI with:

pip install py-spy-for-datakit

If you have rust and cargo installed, py-spy-for-datakit can also be installed with: cargo install py-spy-for-datakit.

In addition to above, you can also download prebuilt binaries for most platforms from the GitHub Releases Page directly.

Usage

py-spy-for-datakit works from the command line and takes either the PID of the program you want to sample from or the command line of the python program you want to run.

# Use process PID
sudo py-spy-for-datakit datakit --host 127.0.0.1 --port 9295 --service py-spy-demo --env dev --version v0.1 --pid 12345
# OR use your app starting command line
sudo py-spy-for-datakit datakit --host 127.0.0.1 --port 9295 --service py-spy-demo --env dev --version v0.1 -- python myapp.py

For more usage help, use py-spy-for-datakit help datakit command or refer to py-spy manual

Dependencies

~19–36MB
~616K SLoC