Skip to content

Commit

Permalink
build(sentry): Vendor the sentry-tower integration (#3395)
Browse files Browse the repository at this point in the history
Vendors the `sentry-tower` integration and upgrades the Sentry SDK to
`0.32.x` without upgrading axum. Going forward, this allows us to keep
the Sentry SDK up-to-date independently of the web framework.

The integration's code was copied from version `0.31.8`, which is the
last release matching our version of `axum`. Minor adjustments to the
imports were made.

This will be removed once `axum` is upgraded to latest.
  • Loading branch information
jan-auer authored Apr 9, 2024
1 parent 986b48e commit 4e025ce
Show file tree
Hide file tree
Showing 8 changed files with 380 additions and 45 deletions.
49 changes: 17 additions & 32 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ parking_lot = "0.12.1"
path-slash = "0.2.1"
pest = "2.1.3"
pest_derive = "2.1.0"
pin-project-lite = "0.2.12"
pretty-hex = "0.3.0"
proc-macro2 = "1.0.8"
quote = "1.0.2"
Expand All @@ -131,11 +132,11 @@ reqwest = "0.11.1"
rmp-serde = "1.1.1"
rust-embed = "8.0.0"
schemars = { version = "=0.8.10", features = ["uuid1", "chrono"] }
sentry = "0.31.7"
sentry-core = "0.31.7"
sentry = "0.32.2"
sentry-core = "0.32.2"
sentry-kafka-schemas = { version = "0.1.64", default-features = false }
sentry-release-parser = { version = "1.3.2", default-features = false }
sentry-types = "0.31.3"
sentry-types = "0.32.2"
sentry_usage_accountant = { version = "0.1.0", default-features = false }
serde = { version = "1.0.159", features = ["derive", "rc"] }
serde-transcode = "1.1.1"
Expand Down
5 changes: 3 additions & 2 deletions relay-log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ relay-common = { workspace = true }
relay-crash = { workspace = true, optional = true }
sentry = { workspace = true, features = [
"debug-images",
"tower-axum-matched-path",
"tracing",
], optional = true }
sentry-core = { workspace = true }
tokio = { workspace = true, default-features = false, features = ["sync"], optional = true }
tokio = { workspace = true, default-features = false, features = [
"sync",
], optional = true }
serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
tracing = { workspace = true }
Expand Down
4 changes: 1 addition & 3 deletions relay-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,10 @@ mod test;
pub use test::*;

mod utils;
#[cfg(feature = "sentry")]
pub use sentry::integrations::tower;
// Expose the minimal log facade.
#[doc(inline)]
pub use tracing::{debug, error, info, trace, warn, Level};
// Expose the minimal error reporting API.
#[doc(inline)]
pub use sentry_core::{capture_error, configure_scope, protocol, with_scope, Hub};
pub use sentry_core::{self as sentry, capture_error, configure_scope, protocol, with_scope, Hub};
pub use utils::*;
5 changes: 2 additions & 3 deletions relay-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ mime_guess = { workspace = true, optional = true }
minidump = { workspace = true, optional = true }
multer = { workspace = true }
once_cell = { workspace = true }
pin-project-lite = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
relay-auth = { workspace = true }
Expand Down Expand Up @@ -138,9 +139,7 @@ axum-extra = { workspace = true, features = ["protobuf"] }
[dev-dependencies]
tokio = { workspace = true, features = ['test-util'] }
insta = { workspace = true }
relay-event-schema = { workspace = true, features = [
"jsonschema",
] }
relay-event-schema = { workspace = true, features = ["jsonschema"] }
relay-protocol = { workspace = true, features = ["test"] }
relay-test = { workspace = true }
similar-asserts = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions relay-server/src/middlewares/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ mod decompression;
mod handle_panic;
mod metrics;
mod normalize_path;
mod sentry_tower;
mod trace;

pub use self::cors::*;
pub use self::decompression::*;
pub use self::handle_panic::*;
pub use self::metrics::*;
pub use self::normalize_path::*;
pub use self::sentry_tower::*;
pub use self::trace::*;
Loading

0 comments on commit 4e025ce

Please sign in to comment.