[](https://pypi.python.org/pypi/aiohttp-prometheus-monitoring)
[](https://pypi.python.org/pypi/aiohttp-prometheus-monitoring)
This package allows to monitor availability of your aiohttp-application components and exports the metrics for prometheus scraper.
It can monitor:
- external host HTTP status
- postgres database status
- mysql database status
- redis availability
- rabbit AMQP availability
- whatever else, as can be extended easily
It periodically calls services, stores boolean result in Gauge metrics and exports the metrics via the /metrics endpoint.
No additional workers required, everything is built-in into your app.
Then you can build graphs based on this data:

## Install:
pip install aiohttp_prometheus_monitoring[amqp,redis,postgres,mysql]
## Sample config:
MONITORING = {
'route_ping': '/ping',
'route_metrics': '/metrics',
'metrics': [
{
'name': 'monitoring_http',
'description': 'Check HTTP status',
'module': 'aiohttp_prometheus_monitoring.metrics.http.HttpMetric',
'sleep_time': 300,
'params': {
'url': 'http://localhost/my_ping/',
'timeout': 1,
'verify_ssl': True,
}
},
{
'name': 'monitoring_redis',
'description': 'Check redis connection',
'module': 'aiohttp_prometheus_monitoring.metrics.redis.RedisMetric',
'sleep_time': 60,
'params': {
'host': 'localhost',
'port': '6379',
}
},
{
'name': 'monitoring_mq',
'description': 'Check MQ connection',
'module': 'aiohttp_prometheus_monitoring.metrics.amqp.AmqpMetric',
'sleep_time': 60,
'params': {
'host': 'localhost',
'port': '5672',
'user': 'root',
'password': '123',
'vhost': 'myvhost',
}
},
{
'name': 'monitoring_postgres',
'description': 'Check postgres connection',
'module': 'aiohttp_prometheus_monitoring.metrics.postgres.PostgresMetric',
'sleep_time': 60,
'params': {
'database': 'core',
'user': 'core',
'password': 'core',
'host': 'localhost',
'port': 5433,
}
},
{
'name': 'monitoring_mysql',
'description': 'Check mysql connection',
'module': 'aiohttp_prometheus_monitoring.metrics.mysql.MySQLMetric',
'sleep_time': 60,
'params': {
'database': 'core',
'user': 'core',
'password': 'core',
'host': 'localhost',
'port': 3007,
}
},
]
}
## Usage:
from aiohttp import web
from aiohttp_prometheus_monitoring import setup_monitoring
def create_app(loop=None):
app = web.Application()
loop.run_until_complete(setup_monitoring(settings.MONITORING, app))
return app
Check http://YOURAPP/ping and http://YOURAPP/metrics - /ping endpoint will respond "pong", /metrics endpoint will have metrics in prometheus format.
Metadata
Release files for aiohttp-prometheus-monitoring 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiohttp_prometheus_monitoring-0.1.5.tar.gz | 5.8 kB | Without provenance | Details for aiohttp_prometheus_monitoring-0.1.5.tar.gz |
Release files / aiohttp_prometheus_monitoring-0.1.5.tar.gz
| Download URL | aiohttp_prometheus_monitoring-0.1.5.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd9b2d5830fc2ae70ca15d94bae65fd95cbe5ff83462c649076533f592b90405
|
|
BLAKE2b-256 checksum How to use checksums |
26bf7efac157c4524b74fbaab1f0149446506fdabab04dc3ab580133a6b74db7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.9.1 pkginfo/1.4.2 requests/2.18.4 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.0
|
Security for aiohttp-prometheus-monitoring 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.