Skip to content

Commit fc622b6

Browse files
committed
Add a feature for push with reqwest rustls
Signed-off-by: Bob AminAzad <[email protected]>
1 parent 1d3174b commit fc622b6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ default = ["protobuf"]
2020
gen = ["protobuf-codegen"]
2121
nightly = ["libc"]
2222
process = ["libc", "procfs"]
23-
push = ["reqwest", "libc", "protobuf"]
23+
push = ["dep:reqwest", "libc", "protobuf", "reqwest/default-tls"]
24+
push-rustls = ["dep:reqwest", "libc", "protobuf", "reqwest/rustls-tls"]
2425

2526
[dependencies]
2627
cfg-if = "^1.0"
@@ -30,7 +31,7 @@ libc = { version = "^0.2", optional = true }
3031
parking_lot = "^0.12"
3132
protobuf = { version = "^3.7.2", optional = true }
3233
memchr = "^2.3"
33-
reqwest = { version = "^0.12", features = ["blocking"], optional = true }
34+
reqwest = { version = "^0.12", features = ["blocking"], default-features = false, optional = true }
3435
thiserror = "^2.0"
3536

3637
[target.'cfg(target_os = "linux")'.dependencies]

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ mod histogram;
149149
mod metrics;
150150
mod nohash;
151151
mod pulling_gauge;
152-
#[cfg(feature = "push")]
152+
#[cfg(any(feature = "push", feature = "push-rustls"))]
153153
mod push;
154154
mod registry;
155155
mod value;
@@ -211,7 +211,7 @@ pub use self::histogram::{exponential_buckets, linear_buckets};
211211
pub use self::histogram::{Histogram, HistogramOpts, HistogramTimer, HistogramVec};
212212
pub use self::metrics::Opts;
213213
pub use self::pulling_gauge::PullingGauge;
214-
#[cfg(feature = "push")]
214+
#[cfg(any(feature = "push", feature = "push-rustls"))]
215215
pub use self::push::{
216216
hostname_grouping_key, push_add_collector, push_add_metrics, push_collector, push_metrics,
217217
BasicAuthentication,

0 commit comments

Comments
 (0)