Skip to content

Commit

Permalink
Adding comment regarding middleware ordering
Browse files Browse the repository at this point in the history
Co-authored-by: Mathieu Hinderyckx <[email protected]>
  • Loading branch information
ocelotl and mhindery committed Apr 26, 2020
1 parent 6a95663 commit 7a3f0e3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ def _instrument(self, **kwargs):
):
return

# This can not be solved, but is an inherent problem of this approach:
# the order of middleware entries matters, and here you have no control
# on that:
# https://docs.djangoproject.com/en/3.0/topics/http/middleware/#activating-middleware
# https://docs.djangoproject.com/en/3.0/ref/middleware/#middleware-ordering

settings_middleware = getattr(settings, self._middleware_setting, [])
settings_middleware.append(self._opentelemetry_middleware)

Expand Down

0 comments on commit 7a3f0e3

Please sign in to comment.