Skip to main content

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


Download files

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

Source Distribution

prometheus_paster-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

prometheus_paster-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file prometheus_paster-0.1.1.tar.gz.

File metadata

  • Download URL: prometheus_paster-0.1.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

File hashes

Hashes for prometheus_paster-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fae4ce282582240259e28b8855636165b4bd121274995b457d3eea4fdde266b5
MD5 71dbc61100e7afcf2b475a4bd65b84e9
BLAKE2b-256 16b5a12c178e562162a7623204655734b5f6643e3dd8596a9d1cf5d6d141fc10

See more details on using hashes here.

File details

Details for the file prometheus_paster-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: prometheus_paster-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

File hashes

Hashes for prometheus_paster-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 765d1ef3bf37350786d99039a8436813ea72aed70fab0ae96cb780982e60e836
MD5 5cd31e6aed30925285721f49a3f3d5cf
BLAKE2b-256 28d5e9fddc2ca929d4262182c8d6729f22963ea12bb44d0255b65d6cf99ba2af

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