uWSGI stats exporter for Prometheus
Project description
uWSGI Prometheus
A uWSGI stats exporter for Prometheus that integrates directly into an existing uWSGI app
Installation
Install using pip
:
pip install uwsgi-prometheus
Enable the http stats endpoint in your uWSGI config:
https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html
Add the following in your uwsgi.py
:
from prometheus_client.core import REGISTRY
from uwsgi_prometheus.collectors import UWSGIStatsCollector
REGISTRY.register(UWSGIStatsCollector())
The following stats will then be added to your existing metrics endpoint:
- uwsgi_listen_queue_requests - Number of requests in the uWSGI listen queue
- uwsgi_request_total - Total number of uWSGI requests across all workers
- uwsgi_harakiris_total - Total number of harakiris across all workers
Configuration
A few configuration options are available on the collector:
- stats_url - The URL that uWSGI is exposing stats on
Default: http://127.0.0.1:1717
- timeout - The timeout for fetching stats
Default: 2
- prefix - A prefix for the exported metrics (An underscore is automatically added if specified)
Default: ''
REGISTRY.register(UWSGIStatsCollector(
stats_url='http://127.0.0.1:1717',
timeout=2,
prefix=''
))
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
uwsgi-prometheus-0.0.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for uwsgi_prometheus-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8015531866379a7870b42a89283aa85e541b86705ef6226e446af1dbfd08b2c |
|
MD5 | 449004fe273ce1a0a1d3dea1ff275bb6 |
|
BLAKE2b-256 | 40de4ef401178e97698232c5178cfc68400f64ffabb7aaf4c970981b940b3d79 |