prometheus_client and pastedeploy glue
Project description
This is a glue between prometheus_client and pastedeploy.
Quick start
configuration example
[composite:main]
use = egg:Paste#urlmap
/metrics = prom
/ = papp
[pipeline:papp]
pipeline = perf app
[app:app]
use = egg:someapp
[filter:perf]
use = egg:prometheus_paster#filter
name = someapp_call
[app:prom]
use = egg:prometheus_paster
Prometheus exporter endpoint Configuration
You can expose the endpoint with egg:prometheus_paster
wsgi application.
[app:main]
use = egg:prometheus_paster
Collector filter Configuration
- latency : metric name for wsgi processing time (default
response_latency_seconds
) - length : metric name for wsgi response length (default
response_length_bytes
) - path_regex : if request path does not match this regex, then it will be ignored. (default
.*
) - disable_latency: if set to true, then latency metrics will not be collected.
- disable_length: if set to true, then length metrics will not be collected.
Multiple metrics (1)
If you want to collect two different application on the same wsgi container, then you can put different filters.
[composite:main]
use = egg:Paste#urlmap
/metrics = prom
/app1 = app1
/app2 = app2
[app:app1]
use = egg:app1
filter-with = app1_perf
[filter:app1_perf]
use = egg:prometheus_paster#filter
latency = app1_latency
length = app1_length
[app:app2]
use = egg:app2
filter-with = app2_perf
[filter:app2_perf]
use = egg:prometheus_paster#filter
latency = app2_latency
length = app2_length
[app:prom]
use = egg:prometheus_paster
Multiple metrics (2)
Another option is stacking filters.
[composite:main]
use = egg:Paste#urlmap
/metrics = prom
/app = app1_pipe
[pipeline:app1_pipe]
pipeline = path1_perf path2_perf app1
[app:app1]
use = egg:app1
[filter:path1_perf]
use = egg:prometheus_paster#filter
latency = path1_latency
length = path1_length
path_regex = /path1/.*
[filter:path2_perf]
use = egg:prometheus_paster#filter
latency = path2_latency
length = path2_length
path_regex = /path2/.*
[app:prom]
use = egg:prometheus_paster
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
Close
Hashes for prometheus_paster-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 765d1ef3bf37350786d99039a8436813ea72aed70fab0ae96cb780982e60e836 |
|
MD5 | 5cd31e6aed30925285721f49a3f3d5cf |
|
BLAKE2b-256 | 28d5e9fddc2ca929d4262182c8d6729f22963ea12bb44d0255b65d6cf99ba2af |