Skip to content

Commit

Permalink
Fix:Update starlette.asciidoc, incorrect middleware order (#1956)
Browse files Browse the repository at this point in the history
* Update starlette.asciidoc

Fix typo

* Update starlette.asciidoc

---------

Co-authored-by: Colton Myers <[email protected]>
  • Loading branch information
mariocandela and basepi authored Feb 21, 2024
1 parent bdc0eac commit 58c916b
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit 58c916b

Please sign in to comment.