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

chore(deps): bump metrics to 0.22 #8517

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
125 changes: 69 additions & 56 deletions Cargo.lock

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

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ strum = "0.26"
rayon = "1.7"
itertools = "0.12"
parking_lot = "0.12"
# Needed for `metrics-macro` to resolve the crate using `::metrics` notation
metrics = "0.21.1"
modular-bitfield = "0.11.2"
once_cell = "1.17"
syn = "2.0"
Expand All @@ -373,6 +371,12 @@ sha2 = { version = "0.10", default-features = false }
paste = "1.0"
url = "2.3"

# metrics
metrics = "0.22.0"
metrics-exporter-prometheus = { version = "0.14.0", default-features = false }
Copy link
Member Author

@DaniPopes DaniPopes May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default-features = false disables exporter (see https://docs.rs/metrics-exporter-prometheus/latest/metrics_exporter_prometheus/#features).
We need to disable this because it pulls in openssl through hyper-tls.

We only use the recorder, not the exporter, so this is fine:

let recorder = PrometheusBuilder::new().build_recorder();

metrics-util = "0.16.0"
metrics-process = "2.0.0"

# proc-macros
proc-macro2 = "1.0"
quote = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ confy.workspace = true
toml = { workspace = true, features = ["display"] }

# metrics
metrics-process = "=1.0.14"
metrics-process.workspace = true

# test vectors generation
proptest.workspace = true
Expand Down
10 changes: 5 additions & 5 deletions crates/metrics/metrics-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ mod with_attrs;
/// impl Default for CustomMetrics {
/// fn default() -> Self {
/// Self {
/// gauge: metrics::register_gauge!("metrics_custom_gauge"),
/// gauge2: metrics::register_gauge!("metrics_custom_second_gauge"),
/// counter: metrics::register_counter!("metrics_custom_counter"),
/// histo: metrics::register_histogram!("metrics_custom_histogram"),
/// gauge: metrics::gauge!("metrics_custom_gauge"),
/// gauge2: metrics::gauge!("metrics_custom_second_gauge"),
/// counter: metrics::counter!("metrics_custom_counter"),
/// histo: metrics::histogram!("metrics_custom_histogram"),
/// }
/// }
/// }
Expand Down Expand Up @@ -115,7 +115,7 @@ mod with_attrs;
///
/// impl DynamicScopeMetrics {
/// pub fn new(scope: &str) -> Self {
/// Self { gauge: metrics::register_gauge!(format!("{}{}{}", scope, "_", "gauge")) }
/// Self { gauge: metrics::gauge!(format!("{}{}{}", scope, "_", "gauge")) }
/// }
///
/// pub fn describe(scope: &str) {
Expand Down
6 changes: 3 additions & 3 deletions crates/metrics/metrics-derive/src/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ impl<'a> Metric<'a> {
if let Type::Path(ref path_ty) = self.field.ty {
if let Some(last) = path_ty.path.segments.last() {
let registrar = match last.ident.to_string().as_str() {
COUNTER_TY => quote! { metrics::register_counter! },
HISTOGRAM_TY => quote! { metrics::register_histogram! },
GAUGE_TY => quote! { metrics::register_gauge! },
COUNTER_TY => quote! { metrics::counter! },
HISTOGRAM_TY => quote! { metrics::histogram! },
GAUGE_TY => quote! { metrics::gauge! },
_ => return Err(Error::new_spanned(path_ty, "Unsupported metric type")),
};

Expand Down
Loading
Loading