Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rob-blackbourn/bareasgi-prometheus
Prometheus metrics for bareASGI
https://github.com/rob-blackbourn/bareasgi-prometheus
Last synced: about 1 month ago
JSON representation
Prometheus metrics for bareASGI
- Host: GitHub
- URL: https://github.com/rob-blackbourn/bareasgi-prometheus
- Owner: rob-blackbourn
- License: apache-2.0
- Created: 2019-10-16T14:21:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T14:00:24.000Z (almost 2 years ago)
- Last Synced: 2024-09-23T09:10:41.912Z (about 2 months ago)
- Language: Python
- Homepage: https://rob-blackbourn.github.io/bareASGI-prometheus/
- Size: 1.15 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bareASGI-prometheus
[Prometheus](https://prometheus.io/) metrics for bareASGI (read the [docs](https://rob-blackbourn.github.io/bareASGI-prometheus/)).
## Installation
Install from the pie store
```bash
$ pip install bareASGI-prometheus
```## Usage
The middleware can either be configured manually or with a helper.
### Manual Configuration
```python
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
```python
from bareasgi import Application
from bareasgi_prometheus import add_prometheus_middleware...
app = Application()
add_prometheus_middleware(app)
```