File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 130
130
//! # }
131
131
//! ```
132
132
//!
133
+ //! When using `axum`, either use [`tower::ServiceBuilder`] as shown above, or make sure you
134
+ //! reorder the layers, like so:
135
+ //!
136
+ //! ```rust
137
+ //! let app = Router::new()
138
+ //! .route("/", get(handler))
139
+ //! .layer(sentry_tower::SentryHttpLayer::with_transaction())
140
+ //! .layer(sentry_tower::NewSentryLayer::<Request>::new_from_top())
141
+ //! ```
142
+ //!
143
+ //! This is because `axum` applies middleware in the opposite order as [`tower::ServiceBuilder`].
144
+ //! Applying the layers in the wrong order can result in memory leaks.
145
+ //!
133
146
//! [`tower::ServiceBuilder`]: https://docs.rs/tower/latest/tower/struct.ServiceBuilder.html
134
147
135
148
#![ doc( html_favicon_url = "https://sentry-brand.storage.googleapis.com/favicon.ico" ) ]
You can’t perform that action at this time.
0 commit comments