aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKevin Guthrie <[email protected]>2024-10-04 16:47:51 -0400
committerKevin Guthrie <[email protected]>2024-10-07 15:03:26 -0400
commitab1b717bf587723c1c537d6549a8f8096f0900d4 (patch)
tree67b55056568d536a1c66922f2e73425d573b533f
parent33fb157df8d384723bd935db66e0a16658e02688 (diff)
downloadpingora-ab1b717bf587723c1c537d6549a8f8096f0900d4.tar.gz
pingora-ab1b717bf587723c1c537d6549a8f8096f0900d4.zip
Make sentry an optional feature
-rw-r--r--.bleep2
-rw-r--r--pingora-core/Cargo.toml9
-rw-r--r--pingora-core/src/server/mod.rs4
-rw-r--r--pingora-proxy/Cargo.toml5
4 files changed, 14 insertions, 6 deletions
diff --git a/.bleep b/.bleep
index f8542c1..ccd7920 100644
--- a/.bleep
+++ b/.bleep
@@ -1 +1 @@
-5bbb21bd377e352872ab767af7583e4d8e9022f8 \ No newline at end of file
+db1062544ff6061f40cf33801b12a8c407c0d574 \ No newline at end of file
diff --git a/pingora-core/Cargo.toml b/pingora-core/Cargo.toml
index 496e401..3534aea 100644
--- a/pingora-core/Cargo.toml
+++ b/pingora-core/Cargo.toml
@@ -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"] }
@@ -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]
@@ -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 = [] \ No newline at end of file
+some_tls = []
diff --git a/pingora-core/src/server/mod.rs b/pingora-core/src/server/mod.rs
index d9e57dd..0a2977d 100644
--- a/pingora-core/src/server/mod.rs
+++ b/pingora-core/src/server/mod.rs
@@ -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;
@@ -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**
@@ -191,6 +193,7 @@ impl Server {
shutdown_recv: rx,
configuration: Arc::new(conf),
options: Some(opt),
+ #[cfg(feature = "sentry")]
sentry: None,
}
}
@@ -231,6 +234,7 @@ impl Server {
shutdown_recv: rx,
configuration: Arc::new(conf),
options: opt,
+ #[cfg(feature = "sentry")]
sentry: None,
})
}
diff --git a/pingora-proxy/Cargo.toml b/pingora-proxy/Cargo.toml
index b94711d..13d4804 100644
--- a/pingora-proxy/Cargo.toml
+++ b/pingora-proxy/Cargo.toml
@@ -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"
@@ -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)'] } \ No newline at end of file
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_async_trait)'] }