Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions sentry-actix/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
//! The actix middleware will automatically start a new session for each request
//! when `auto_session_tracking` is enabled and the client is configured to
//! use `SessionMode::Request`.
//! The `release-health` feature flag also needs to be enabled on either
//! `sentry` or `sentry-actix` for this to work.
//!
//! ```
//! let _sentry = sentry::init(sentry::ClientOptions {
Expand Down Expand Up @@ -294,6 +296,7 @@ where
.map(|client| client.options().max_request_body_size)
.unwrap_or(MaxRequestBodySize::None);
if track_sessions {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should probably move the #[cfg] up to where you define this field. I believe the client options auto_session_tracking is also not available with this feature, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment the option is available even without the flag, I've just added a doc line on it to make it clear that the feature flag needs to be enabled for that option to have any effect.

But, I think both auto_session_tracking and session_mode in ClientOptions should instead not be available if the feature is not enabled.
This way, if someone uses those options but their deps don't bring in sentry-core/release-health, it will fail to compile. Better than no-opping silently.

I will update the PR.

#[cfg(feature = "release-health")]
hub.start_session();
}
let with_pii = client
Expand Down
1 change: 0 additions & 1 deletion sentry-opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ all-features = true
[dependencies]
sentry-core = { version = "0.37.0", path = "../sentry-core", features = [
"client",
"release-health"
] }
opentelemetry = { version = "0.29.0", default-features = false }
opentelemetry_sdk = { version = "0.29.0", default-features = false, features = [
Expand Down
3 changes: 1 addition & 2 deletions sentry-tower/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ rust-version = "1.81"
all-features = true

[features]
default = ["release-health"]
default = []
http = ["dep:http", "pin-project", "url"]
axum-matched-path = ["http", "axum/matched-path"]
release-health = ["sentry-core/release-health"]

[dependencies]
axum = { version = "0.8", optional = true, default-features = false }
Expand Down
3 changes: 1 addition & 2 deletions sentry-tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ rust-version = "1.81"
all-features = true

[features]
default = ["release-health"]
default = []
backtrace = ["dep:sentry-backtrace"]
release-health = ["sentry-core/release-health"]

[dependencies]
sentry-core = { version = "0.37.0", path = "../sentry-core", features = [
Expand Down