Created
November 12, 2021 12:04
-
-
Save jsmolina/b116e3858469e7bfaa89e4e05c8c23cc to your computer and use it in GitHub Desktop.
simple w3c tracecontext plugin for traceapi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plugin import TraceParentLogger | |
def create_app(): | |
config = get_api_settings() | |
app = FastAPI... | |
.... | |
app.add_middleware(RawContextMiddleware, plugins=(TraceParentLogger(),) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from starlette_context.plugins.base import Plugin | |
class TraceParentLogger(Plugin): | |
key = "traceparent" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment