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
Close
Hashes for aiohttp_prometheus-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a887d5a748262df8cc34d24dbfb4542e312e5d1c4a3ea2d4c8dfbc2ffd11eaaf |
|
MD5 | 426c3ff2bf6e42d62af616509a776640 |
|
BLAKE2b-256 | 8c1fe2c5af3b856a895ff250b93b07b152b5c5096fb6acbb54c80c2b6a9beb28 |