Instrument asyncio Python for AWS X-Ray.
xraysink (aka xray-asyncio)
Extra AWS X-Ray instrumentation for asyncio Python libraries that are not (yet) supported by the official aws_xray_sdk library.
- Generic ASGI-compatible tracing middleware for any ASGI-compliant web framework. This has been tested with:
xraysink is distributed as a standard python package through pypi, so you can install it with your favourite Python package manager. For example:
pip install xraysink
How to use
Instrument incoming requests in your FastAPI web server by adding the
xray_middleware. For example:
# Basic asyncio X-Ray configuration xray_recorder.configure(context=AsyncContext(), service="my-cute-little-service") # Create a FastAPI app with various middleware app = FastAPI() app.add_middleware(MyTracingDependentMiddleware) # Any middleware that is added earlier will have the X-Ray tracing context available to it app.add_middleware(BaseHTTPMiddleware, dispatch=xray_middleware)
This project uses the Apache 2.0 licence, to make it compatible with aws_xray_sdk, the primary library for integrating with AWS X-Ray.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
xraysink-1.0.0.tar.gz (9.3 kB view hashes)