Skip to content

Low-overhead streaming OpenTracing-compatible Python profiler.

License

Notifications You must be signed in to change notification settings

AndreiPashkin/gauge

Repository files navigation

Gauge

GitHub Documentation Status SonarCloud

Low-overhead streaming (or continuous) OpenTracing-compatible Python profiler.

Quick links

Documentation https://gauge.readthedocs.io/en/stable/
Issue tracker https://github.com/AndreiPashkin/gauge/issues/
Repository https://github.com/AndreiPashkin/gauge/

Why another profiler?

The idea is to make a profiler which would be able to continuously stream the profile data to monitoring software (like Jaeger or Elastic APM) and also, have low-performance overhead so that it would be possible to deploy it on production. So it would be possible to monitor the performance of a microservice or some other long-running application in real-time over a long period and explore historical performance data.

Currently, no open-source alternatives exist that are able to do that.

Features

  • OpenTracing compatibility. Specifically with the following APMs:
  • Very low overhead with 100 / samples per second sampling frequency.
  • Supports generators/coroutines.

Compatibility

Currently, the project targets only CPython 3.5+. It is intended to be compatible with all major operating systems, but currently only tested on Ubuntu Linux.

Project status

Project in alpha stage of development and is actively worked on. It just passed the state where the main functionality is working more or less correctly and it is possible to actually install it and use.

How does it work?

The profiler exploits _PyThread_CurrentFrames() function of CPython's C-API which provides reasonable performance. This function is called with defined frequency in a background thread which collects raw data which is in turn aggregated and exported to somewhere in another background thread which is activated with a much lower frequency.

Alternatives

Profiler Is low-overhead? Is streaming? Is commercial? Is Open-Source? Has permissive license?
DataDog profiler Yes Yes Yes No  
Py-Spy Yes No No Yes Yes
Austin Yes No No Yes No