Skip to content

Commit

Permalink
Make sentry an optional feature
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhurt committed Oct 7, 2024
1 parent 33fb157 commit 0327578
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bleep
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5bbb21bd377e352872ab767af7583e4d8e9022f8
db1062544ff6061f40cf33801b12a8c407c0d574
9 changes: 6 additions & 3 deletions pingora-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sentry = { version = "0.26", features = [
"panic",
"reqwest",
"rustls",
], default-features = false }
], default-features = false, optional = true }
regex = "1"
percent-encoding = "2.1"
parking_lot = { version = "0.12", features = ["arc_lock"] }
Expand All @@ -77,7 +77,9 @@ windows-sys = { version = "0.59.0", features = ["Win32_Networking_WinSock"] }
[dev-dependencies]
matches = "0.1"
env_logger = "0.9"
reqwest = { version = "0.11", features = ["rustls"], default-features = false }
reqwest = { version = "0.11", features = [
"rustls-tls",
], default-features = false }
hyper = "0.14"

[target.'cfg(unix)'.dev-dependencies]
Expand All @@ -88,5 +90,6 @@ jemallocator = "0.5"
default = ["openssl"]
openssl = ["pingora-openssl", "some_tls"]
boringssl = ["pingora-boringssl", "some_tls"]
sentry = ["dep:sentry"]
patched_http1 = []
some_tls = []
some_tls = []
4 changes: 4 additions & 0 deletions pingora-core/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use daemon::daemonize;
use log::{debug, error, info, warn};
use pingora_runtime::Runtime;
use pingora_timeout::fast_timeout;
#[cfg(feature = "sentry")]
use sentry::ClientOptions;
use std::sync::Arc;
use std::thread;
Expand Down Expand Up @@ -67,6 +68,7 @@ pub struct Server {
pub configuration: Arc<ServerConf>,
/// The parser command line options
pub options: Option<Opt>,
#[cfg(feature = "sentry")]
/// The Sentry ClientOptions.
///
/// Panics and other events sentry captures will be sent to this DSN **only in release mode**
Expand Down Expand Up @@ -191,6 +193,7 @@ impl Server {
shutdown_recv: rx,
configuration: Arc::new(conf),
options: Some(opt),
#[cfg(feature = "sentry")]
sentry: None,
}
}
Expand Down Expand Up @@ -231,6 +234,7 @@ impl Server {
shutdown_recv: rx,
configuration: Arc::new(conf),
options: opt,
#[cfg(feature = "sentry")]
sentry: None,
})
}
Expand Down
5 changes: 3 additions & 2 deletions pingora-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ regex = "1"
[dev-dependencies]
reqwest = { version = "0.11", features = [
"gzip",
"rustls",
"rustls-tls",
], default-features = false }
tokio-test = "0.4"
env_logger = "0.9"
Expand All @@ -58,10 +58,11 @@ hyperlocal = "0.8"
default = ["openssl"]
openssl = ["pingora-core/openssl", "pingora-cache/openssl"]
boringssl = ["pingora-core/boringssl", "pingora-cache/boringssl"]
sentry = ["pingora-core/sentry"]

# or locally cargo doc --config "build.rustdocflags='--cfg doc_async_trait'"
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "doc_async_trait"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_async_trait)'] }
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_async_trait)'] }

0 comments on commit 0327578

Please sign in to comment.