Quick and easy monitoring setup for ASGI application
Project description
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asgi_monitor-0.6.1.tar.gz.
File metadata
- Download URL: asgi_monitor-0.6.1.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.2 CPython/3.13.5 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25582f704dd93ca0f6932d52278e4a503304a6e96cba00978d066bbb0b09dddb
|
|
| MD5 |
3f6a5438f75997ec8b83437980ea84d6
|
|
| BLAKE2b-256 |
547d5927310c3f980425a8c67e65ebe60fa497509624568e683920d9add2c9cb
|
File details
Details for the file asgi_monitor-0.6.1-py3-none-any.whl.
File metadata
- Download URL: asgi_monitor-0.6.1-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.2 CPython/3.13.5 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1922032005d2ac4cbadead7c5bb63515a9a54e4dff5cb606fa189ac243b7e0e
|
|
| MD5 |
5098ce8fd915fd879d1ad6abf1239492
|
|
| BLAKE2b-256 |
ea90de5f0de4703a7521d8c240892cea8fce41e43a9c1b8f7d53fb2331c20f85
|