Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "push-no-tls" feature, for HTTP-only push support #461

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ default = ["protobuf"]
gen = ["protobuf-codegen-pure"]
nightly = ["libc"]
process = ["libc", "procfs"]
push = ["reqwest", "libc", "protobuf"]
push = ["push-reqwest-ssl", "push-deps"]
push-no-tls = ["push-deps"]
push-reqwest-ssl = ["reqwest?/default-tls"]
push-deps = ["reqwest", "libc", "protobuf"]

[dependencies]
cfg-if = "^1.0"
Expand All @@ -32,7 +35,7 @@ libc = { version = "^0.2", optional = true }
parking_lot = "^0.12"
protobuf = { version = "^2.0", optional = true }
memchr = "^2.3"
reqwest = { version = "^0.11", features = ["blocking"], optional = true }
reqwest = { version = "^0.11", default-features = false, features = ["blocking"], optional = true }
thiserror = "^1.0"

[target.'cfg(target_os = "linux")'.dependencies]
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ This crate provides several optional components which can be enabled via [Cargo

- `push`: Enable [push metrics](https://prometheus.io/docs/instrumenting/pushing/) support.

- `push-no-tls`: An alternative to `push`, which will not link in TLS libraries, disabling HTTPS support but resulting in a leaner build.
By default, the Pushgateway uses HTTP and not HTTPS.

### Static Metric

When using a `MetricVec` with label values known at compile time
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ mod gauge;
mod histogram;
mod metrics;
mod pulling_gauge;
#[cfg(feature = "push")]
#[cfg(feature = "push-deps")]
mod push;
mod registry;
mod value;
Expand Down Expand Up @@ -221,7 +221,7 @@ pub use self::histogram::{exponential_buckets, linear_buckets};
pub use self::histogram::{Histogram, HistogramOpts, HistogramTimer, HistogramVec};
pub use self::metrics::Opts;
pub use self::pulling_gauge::PullingGauge;
#[cfg(feature = "push")]
#[cfg(feature = "push-deps")]
pub use self::push::{
hostname_grouping_key, push_add_collector, push_add_metrics, push_collector, push_metrics,
BasicAuthentication,
Expand Down