Skip to content

Commit 0dee7d5

Browse files
mariocandelabasepi
authored andcommitted
Fix:Update starlette.asciidoc, incorrect middleware order (#1956)
* Update starlette.asciidoc Fix typo * Update starlette.asciidoc --------- Co-authored-by: Colton Myers <colton@basepi.net>
1 parent 8915ec3 commit 0dee7d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/starlette.asciidoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ app = Starlette()
4242
app.add_middleware(ElasticAPM)
4343
----
4444

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

5052
To configure the agent using initialization arguments:
5153

0 commit comments

Comments
 (0)