fastapi opentracing middleware works with istio
Project description
fastapi-opentracing
fastapi opentracing middleware works with istio
install:
pip install fastapi-opentracing
example:
from fastapi import FastAPI
import uvicorn
from fastapi_opentracing import get_opentracing_span_headers
from fastapi_opentracing.middleware import OpenTracingMiddleware
app = FastAPI()
app.add_middleware(OpenTracingMiddleware)
@app.get("/")
async def root():
carrier = await get_opentracing_span_headers()
return {'span': carrier}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
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
Close
Hashes for fastapi_opentracing-0.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 345d4e7d80058def27bc76b6b1f1b2af9526b80a85d13894f528b0a5bae76a2d |
|
MD5 | d9f7bf3d0d526553e653aee136f985c8 |
|
BLAKE2b-256 | 86c0a64fdf99fd6c336bb181a7d3a4faf8c72f44688821015941dbe5d55cac48 |