A library for easy and fast configuration of logging, tracing and metrics for ASGI applications.
Features:
- Prometheus metrics
- OpenTelemetry traces
- Structlog logging with native logging module support
- Integrations with Litestar, FastAPI, Starlette and Aiohttp
- Logging support for Uvicorn and Gunicorn with custom UvicornWorker
[!IMPORTANT] At this stage, the library is being tested and be careful in using it, your participation in the development will be appreciated!
Installation
pip install asgi-monitor
Quickstart
from asgi_monitor.integrations.fastapi import setup_metrics, MetricsConfig
from fastapi import FastAPI
from uvicorn import run
def run_app() -> None:
app = FastAPI()
setup_metrics(app, MetricsConfig(app_name="fastapi"))
run(app, host="127.0.0.1", port=8000)
if __name__ == "__main__":
run_app()
After setting up, you can see visualization of default metrics in Grafana
The library originates from structlog-asgi
Metadata
Release files for asgi-monitor 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| asgi_monitor-0.6.1.tar.gz | 19.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asgi_monitor-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.3 kB
Release files / asgi_monitor-0.6.1.tar.gz
| Download URL | asgi_monitor-0.6.1.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25582f704dd93ca0f6932d52278e4a503304a6e96cba00978d066bbb0b09dddb
|
|
BLAKE2b-256 checksum How to use checksums |
547d5927310c3f980425a8c67e65ebe60fa497509624568e683920d9add2c9cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.22.2 CPython/3.13.5 Darwin/24.6.0
|
Release files / asgi_monitor-0.6.1-py3-none-any.whl
| Download URL | asgi_monitor-0.6.1-py3-none-any.whl |
|---|---|
| Size | 28.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1922032005d2ac4cbadead7c5bb63515a9a54e4dff5cb606fa189ac243b7e0e
|
|
BLAKE2b-256 checksum How to use checksums |
ea90de5f0de4703a7521d8c240892cea8fce41e43a9c1b8f7d53fb2331c20f85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.22.2 CPython/3.13.5 Darwin/24.6.0
|