Skip to content

Commit ab1b717

Browse files
committed
Make sentry an optional feature
1 parent 33fb157 commit ab1b717

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

.bleep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5bbb21bd377e352872ab767af7583e4d8e9022f8
1+
db1062544ff6061f40cf33801b12a8c407c0d574

pingora-core/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ sentry = { version = "0.26", features = [
5151
"panic",
5252
"reqwest",
5353
"rustls",
54-
], default-features = false }
54+
], default-features = false, optional = true }
5555
regex = "1"
5656
percent-encoding = "2.1"
5757
parking_lot = { version = "0.12", features = ["arc_lock"] }
@@ -77,7 +77,9 @@ windows-sys = { version = "0.59.0", features = ["Win32_Networking_WinSock"] }
7777
[dev-dependencies]
7878
matches = "0.1"
7979
env_logger = "0.9"
80-
reqwest = { version = "0.11", features = ["rustls"], default-features = false }
80+
reqwest = { version = "0.11", features = [
81+
"rustls-tls",
82+
], default-features = false }
8183
hyper = "0.14"
8284

8385
[target.'cfg(unix)'.dev-dependencies]
@@ -88,5 +90,6 @@ jemallocator = "0.5"
8890
default = ["openssl"]
8991
openssl = ["pingora-openssl", "some_tls"]
9092
boringssl = ["pingora-boringssl", "some_tls"]
93+
sentry = ["dep:sentry"]
9194
patched_http1 = []
92-
some_tls = []
95+
some_tls = []

pingora-core/src/server/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use daemon::daemonize;
2222
use log::{debug, error, info, warn};
2323
use pingora_runtime::Runtime;
2424
use pingora_timeout::fast_timeout;
25+
#[cfg(feature = "sentry")]
2526
use sentry::ClientOptions;
2627
use std::sync::Arc;
2728
use std::thread;
@@ -67,6 +68,7 @@ pub struct Server {
6768
pub configuration: Arc<ServerConf>,
6869
/// The parser command line options
6970
pub options: Option<Opt>,
71+
#[cfg(feature = "sentry")]
7072
/// The Sentry ClientOptions.
7173
///
7274
/// Panics and other events sentry captures will be sent to this DSN **only in release mode**
@@ -191,6 +193,7 @@ impl Server {
191193
shutdown_recv: rx,
192194
configuration: Arc::new(conf),
193195
options: Some(opt),
196+
#[cfg(feature = "sentry")]
194197
sentry: None,
195198
}
196199
}
@@ -231,6 +234,7 @@ impl Server {
231234
shutdown_recv: rx,
232235
configuration: Arc::new(conf),
233236
options: opt,
237+
#[cfg(feature = "sentry")]
234238
sentry: None,
235239
})
236240
}

pingora-proxy/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ regex = "1"
3737
[dev-dependencies]
3838
reqwest = { version = "0.11", features = [
3939
"gzip",
40-
"rustls",
40+
"rustls-tls",
4141
], default-features = false }
4242
tokio-test = "0.4"
4343
env_logger = "0.9"
@@ -58,10 +58,11 @@ hyperlocal = "0.8"
5858
default = ["openssl"]
5959
openssl = ["pingora-core/openssl", "pingora-cache/openssl"]
6060
boringssl = ["pingora-core/boringssl", "pingora-cache/boringssl"]
61+
sentry = ["pingora-core/sentry"]
6162

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

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

0 commit comments

Comments
 (0)