Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix:Update starlette.asciidoc, incorrect middleware order #1956

Merged
merged 6 commits into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/starlette.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ app = Starlette()
app.add_middleware(ElasticAPM)
----

WARNING: If you are using any `BaseHTTPMiddleware` middleware, you must add them
*before* the ElasticAPM middleware. This is because `BaseHTTPMiddleware` breaks
`contextvar` propagation, as noted
https://www.starlette.io/middleware/#limitations[here].
WARNING: `BaseHTTPMiddleware` breaks `contextvar` propagation, as noted
https://www.starlette.io/middleware/#limitations[here]. This means the
ElasticAPM middleware must be above any `BaseHTTPMiddleware` in the final
middleware list. If you're calling `add_middleware` repeatedly, add the
ElasticAPM middleware last. If you're passing in a list of middleware,
ElasticAPM should be first on that list.

To configure the agent using initialization arguments:

Expand Down
Loading