Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubicweb_prometheus-0.7.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cubicweb_prometheus-0.7.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file cubicweb_prometheus-0.7.0.tar.gz.

File metadata

  • Download URL: cubicweb_prometheus-0.7.0.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

Hashes for cubicweb_prometheus-0.7.0.tar.gz
Algorithm Hash digest
SHA256 bc288762e8b8c5290c29a99e4b4a0a0e5806c9e484c33a9eb6f4ac8caee63d9f
MD5 cf154d4837d1eaf49a24e918c79a8ca4
BLAKE2b-256 dd75efe6c54952d61e44a4563e544d085fc4ece5db949f6806fc1c951378ff56

See more details on using hashes here.

File details

Details for the file cubicweb_prometheus-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cubicweb_prometheus-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd90c5fa73ec4ece1c81436ef362e6b48957f719c81eae6eea03d1155ab38a82
MD5 49b4c0c6c4b2bbe4c15073b73152ab27
BLAKE2b-256 4c6b30d6cec6adce2e7a45442056e247c9bbf92256c1a719e40386a19fbe0021

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page