Skip to content

sentry: Replace custom axum middleware with tower-axum-matched-path feature #6497

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

Merged
merged 1 commit into from
May 21, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ring = "=0.16.20"
scheduled-thread-pool = "=0.2.7"
secrecy = "=0.8.0"
semver = { version = "=1.0.17", features = ["serde"] }
sentry = { version = "=0.31.1", features = ["tracing", "tower", "tower-http"] }
sentry = { version = "=0.31.1", features = ["tracing", "tower", "tower-axum-matched-path", "tower-http"] }
serde = { version = "=1.0.163", features = ["derive"] }
serde_json = "=1.0.96"
sha2 = "=0.10.6"
Expand Down
2 changes: 0 additions & 2 deletions src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod head;
pub mod log_request;
pub mod normalize_path;
mod require_user_agent;
mod sentry;
pub mod session;
mod static_or_continue;
mod update_metrics;
Expand Down Expand Up @@ -40,7 +39,6 @@ pub fn apply_axum_middleware(state: AppState, router: Router) -> Router {
let middleware = tower::ServiceBuilder::new()
.layer(sentry_tower::NewSentryLayer::<Request>::new_from_top())
.layer(sentry_tower::SentryHttpLayer::with_transaction())
.layer(from_fn(self::sentry::set_transaction))
.layer(from_fn(log_request::log_requests))
.layer(CatchPanicLayer::new())
.layer(from_fn_with_state(
Expand Down
17 changes: 0 additions & 17 deletions src/middleware/sentry.rs

This file was deleted.