A library to metric your FastAPI app using Satella
Project description
fastapi-satella-metrics
fastapi-satella-metrics is an application to seamlessly measure your FastAPI application using Satella's metrics.
Example use:
import fastapi
from fastapi_satella_metrics import SatellaMetricsMiddleware
app = fastapi.FastAPI()
SatellaMetricsMiddleware(app)
And to launch a Prometheus exporter use the following snippet:
from satella.instrumentation.metrics.exporters import PrometheusHTTPExporterThread
phet = PrometheusHTTPExporterThread('0.0.0.0', 8080, {'service_name': 'my_service'})
phet.start()
Or, if you desire to export your metrics within Flask, just use:
import fastapi
from fastapi_satella_metrics import PrometheusExporter
app = fastapi.FastAPI()
PrometheusExporter(app, {'service_name': 'my_service'})
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file fastapi_satella_metrics-1.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: fastapi_satella_metrics-1.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7308a83a612d226ed4865ab6c2a93a166b11fbe11aa10d397c141d5decfc7f5c |
|
MD5 | fed6a36ad1252b89f595be0fcaa5e543 |
|
BLAKE2b-256 | 15664de5f7311a247e06ddfbf8497d0d6cbc4f5354a1fa0c3e2e688ef220e2b0 |