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

feat: allow using prometheus-client crate with PrometheusClientLayer #3134

Merged
merged 18 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ layers-all = [
layers-chaos = ["dep:rand"]
# Enable layers metrics support
layers-metrics = ["dep:metrics"]
# Enable layers prometheus support
# Enable layers prometheus support, with tikv/prometheus-rs crate
layers-prometheus = ["dep:prometheus"]
# Enable layers prometheus support, with prometheus-client crate
layers-prometheus-client = ["dep:prometheus-client"]
# Enable layers madsim support
layers-madsim = ["dep:madsim"]
# Enable layers minitrace support.
Expand Down Expand Up @@ -243,6 +245,7 @@ percent-encoding = "2"
persy = { version = "1.4.4", optional = true }
pin-project = "1"
prometheus = { version = "0.13", features = ["process"], optional = true }
prometheus-client = { version = "0.21.2", optional = true }
prost = { version = "0.11", optional = true }
quick-xml = { version = "0.29", features = ["serialize", "overlapped-lists"] }
rand = { version = "0.8", optional = true }
Expand Down
5 changes: 5 additions & 0 deletions core/src/layers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ mod prometheus;
#[cfg(feature = "layers-prometheus")]
pub use self::prometheus::PrometheusLayer;

#[cfg(feature = "layers-prometheus-client")]
mod prometheus_client;
#[cfg(feature = "layers-prometheus-client")]
pub use self::prometheus_client::PrometheusClientLayer;

mod retry;
pub use self::retry::RetryInterceptor;
pub use self::retry::RetryLayer;
Expand Down
Loading