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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asgi_monitor-0.6.0.tar.gz
(19.5 kB
view details)
Built Distribution
File details
Details for the file asgi_monitor-0.6.0.tar.gz
.
File metadata
- Download URL: asgi_monitor-0.6.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.16.1 CPython/3.12.4 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f9fcf67a9634a22e37064d8548a19968a384eb07b2b5e5f4931d4c254079026 |
|
MD5 | 6e620b322aec9ff8db6510d6b2457a3e |
|
BLAKE2b-256 | a39574dea10a574d8070b7bb13aa9f32248a64c53dce1e9aeb8c4f6f5e0e7ee6 |
File details
Details for the file asgi_monitor-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: asgi_monitor-0.6.0-py3-none-any.whl
- Upload date:
- Size: 27.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.16.1 CPython/3.12.4 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8804ce0ce2b69dafb6dfaf91b5e8bc6633d7b85b6c719077337328138f446d3 |
|
MD5 | 6d9040d30491ae4427e659f5120abc89 |
|
BLAKE2b-256 | a64d53333242d9bec8b24137c0392131b6de049188259f9268846774b4079901 |