A dubugging & profiling toolkit for production Python microservices
Project description
Hawk: Debug & Profile
A lightweight debugging & profiling toolkit
for production 🐍 Python microservices
🦅 Hawk gives you more control over how your Python microservices run in production with little overhead by bringing a set of internal API to help you to profile and debug your services.
Hawk is inspired by Go's net/http/pprof
& expvars
packages and
OpenTelemetry Collector's ZPages which are in turn stemmed from Google's internal practices around
debugging production services.
Features
- ⏱️Memory Profiling via the
tracemalloc
stdlib - ⏱️CPU Profiling (incl. Asyncio services) via
pyinstrument
&cProfile
(soon) - 🙋♀️Activate profiling on demand in real environments
- 🔒Control who can turn on profiling and access debug pages via a simple session API (soon)
- 🎨Render your profiles right from your browser
- ⬇️Download your profiles for the further investigation
- 🔭Expose internal state of your service via debug vars (soon)
- 🔧Create custom debug pages (a.k.a.
ZPages
) in a simplified way (soon) - 🔧Controlled via environment variables, no codebase modifications needed to enable/disable functionality completely
- 🔓No elevated permissions needed (
CAP_PTRACE
, etc.) - 🔭OpenTelemetry-aware (soon)
Integrated With:
References
- https://pkg.go.dev/net/http/pprof
- https://pypi.org/project/fastapi-cprofile/
- https://www.reddit.com/r/Python/comments/15jj010/how_to_profile_an_asynchronous_fastapi_server/
- https://blog.balthazar-rouberol.com/how-to-profile-a-fastapi-asynchronous-request
- https://pyinstrument.readthedocs.io/en/latest/how-it-works.html
- https://www.roguelynn.com/words/asyncio-profiling/
- https://vince.id/posts/finding-memory-leaks-in-python/
- https://medium.com/@narenandu/profiling-and-visualization-tools-in-python-89a46f578989
- https://github.com/Chia-Network/chia-blockchain/blob/18438883f18d345b777d4e726c02d56c23008584/chia/util/profiler.py#L175
- https://github.com/DataDog/dd-trace-py/blob/main/ddtrace/profiling/collector/threading.py
- https://github.com/dpsoft/flask-pypprof/tree/main
- https://gitlab.com/prologin/tech/packages/django-pypprof/-/tree/main
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
hawk_debug-0.0.0.dev0.tar.gz
(16.2 kB
view hashes)
Built Distribution
Close
Hashes for hawk_debug-0.0.0.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7397bc4ab7410b9017dd517e4bac113768a5c0378168dfd935612ed421044a97 |
|
MD5 | 9cc4a61f11d9eda78258d95c3164595f |
|
BLAKE2b-256 | 13bed31da10283f5571efd9a210872d4f126df6e6d886c5dff87d83f998150e5 |