OpenCensus FastAPI Integration
Project description
Installation
pip install opencensus-ext-fastapi
Usage
from fastapi import FastAPI
from opencensus.ext.fastapi.fastapi_middleware import FastAPIMiddleware
app = FastAPI(__name__)
app.add_middleware(FastAPIMiddleware)
@app.get('/')
def hello():
return 'Hello World!'
Additional configuration can be provided, please read Customization for a complete reference.
app.add_middleware(
FastAPIMiddleware,
excludelist_paths=["paths"],
excludelist_hostnames=["hostnames"],
sampler=sampler,
exporter=exporter,
propagator=propagator,
)
References
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
Close
Hashes for opencensus-ext-fastapi-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b63b51b2233a8afc7820ab1f4b13b0c5e63aa86c12c0035f4679709dd1afa0fb |
|
MD5 | 1d95a05d490c09260e7d1ae30ee695b7 |
|
BLAKE2b-256 | 39fa7be884791975481c1e3a891a2ded94c4f684fb1ecbca9d49162a1ca074a4 |
Close
Hashes for opencensus_ext_fastapi-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed524cdc8c8d479b3b15d155c0b0afbb54ade8c98ae6a179e74b7c8bcd8d8977 |
|
MD5 | fbba6d40650bb3b8e1b17311b3195289 |
|
BLAKE2b-256 | 2c1b3424a575187e67a9acff7c9b638da3c6907d9821cfb3151861723b3ce397 |