HTTP metrics for a aiohttp application
Project description
HTTP metrics for a AIOHTTP application
Installing
pip install aiohttp-prometheus
Usage
from aiohttp import web
from aiohttp_prometheus import MetricsMiddleware, MetricsView
app = web.Application()
app.middlewares.append(MetricsMiddleware())
app.router.add_route('GET', '/metrics', MetricsView),
web.run_app(app)
Example output for metric route
# HELP aiohttp_http_requests_total Asyncio total Request Count
# TYPE aiohttp_http_requests_total counter
aiohttp_http_requests_total{handler="MetricsView",method="GET",status="2xx"} 7.0
# HELP aiohttp_http_request_duration_seconds Request latency
# TYPE aiohttp_http_request_duration_seconds histogram
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="0.01",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="0.05",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="0.1",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="0.5",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="0.75",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="1.0",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="2.5",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="5.0",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="7.5",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="10.0",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="15.0",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="20.0",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="30.0",method="GET"} 7.0
aiohttp_http_request_duration_seconds_bucket{handler="MetricsView",le="+Inf",method="GET"} 7.0
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
File details
Details for the file aiohttp-prometheus-0.1.0.tar.gz
.
File metadata
- Download URL: aiohttp-prometheus-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a18b587148ff42d02044d99a17d64a5dbeb55748d67cd833c962eb37f98fe862 |
|
MD5 | 1a8874a52c0124d909030c88c8587acb |
|
BLAKE2b-256 | bd232b9ee1564ee8614d6640db65fe8a9634549ff3d61febee1d1a8d74dd9a73 |
Provenance
File details
Details for the file aiohttp_prometheus-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: aiohttp_prometheus-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a887d5a748262df8cc34d24dbfb4542e312e5d1c4a3ea2d4c8dfbc2ffd11eaaf |
|
MD5 | 426c3ff2bf6e42d62af616509a776640 |
|
BLAKE2b-256 | 8c1fe2c5af3b856a895ff250b93b07b152b5c5096fb6acbb54c80c2b6a9beb28 |