Exporting prometheus metrics
Project description
Summary
Exporting prometheus metrics.
This cube provides a pyramid tween that will, when active, collect the metrics
configured in the settings pyramid.ini and expose them on route /metrics.
Configuration
Include the metrics you want in pyramid.ini:
prometheus.pyramid.http_requests = True
prometheus.pyramid.current_requests = True
prometheus.pyramid.slow_routes = True
prometheus.pyramid.time_routes = True
prometheus.pyramid.count_routes = True
prometheus.cubicweb.sql.time = Histogram
prometheus.cubicweb.rql.time = Histogram
prometheus.uwsgi = True
prometheus.uwsgi.stats_url = http://127.0.0.1:1717
...
Using labels from CubicWeb debug channels
The RQL debug channel publish the data defined in querier.py.
Keys from the dict query_debug_information can be used as Prometheus labels
using the following syntax:
prometheus.cubicweb.rql.time.rql = Histogram
This will generate the following prometheus metrics with RQL query in labels rql.
rql_time_bucket{le="0.005",rql="Any X …"} 0.0
UWSGI metrics
Add stats (and stats-http if needed) on uwsgi.ini file to enable UWSGI
metrics (https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html).
[uwsgi]
…
stats-http = true
stats = 127.0.0.1:1717
UWSGI will serve metrics on json format to 127.0.0.1:1717. Pyramid will read
this metrics and serve them along the rest of its data.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cubicweb_prometheus-0.7.1.tar.gz.
File metadata
- Download URL: cubicweb_prometheus-0.7.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab61e1cd926333c3652ebcb2c05c9dff066d820436028a0b709aef04212ae1cc
|
|
| MD5 |
37ee76f6479c9a66480c4366d317cdb2
|
|
| BLAKE2b-256 |
14b7d08653dcfb53f80d84d67d4b8d3c785f6b84cd138e3db613c9694bc6be7a
|
File details
Details for the file cubicweb_prometheus-0.7.1-py3-none-any.whl.
File metadata
- Download URL: cubicweb_prometheus-0.7.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
563f6e80292e3b1df000d52b6c01f44caad606d9006ecb450d9bcbdcf6e8142a
|
|
| MD5 |
efb7bb53909983e89c6681bf5293ab31
|
|
| BLAKE2b-256 |
2456aa33284df77013d3acced07eba3a7681f71ba4bca0901ba3fe611577855a
|