bareasgi-prometheus

Prometheus metrics for bareASGI


License
Apache-2.0
Install
pip install bareasgi-prometheus==4.2.0

Documentation

bareASGI-prometheus

Prometheus metrics for bareASGI (read the docs).

Installation

Install from the pie store

$ pip install bareASGI-prometheus

Usage

The middleware can either be configured manually or with a helper.

Manual Configuration

from bareasgi import Application
from bareasgi_prometheus import PrometheusMiddleware, prometheus_view

...

prometheus_middleware = PrometheusMiddleware()
app = Application(middlewares=[prometheus_middleware])
app.http_router.add({'GET'}, '/metrics', prometheus_view)

Helper Configuration

from bareasgi import Application
from bareasgi_prometheus import add_prometheus_middleware

...

app = Application()
add_prometheus_middleware(app)