From ddaa0bf2cb8932052c0ef0f0572b45a26f6421ba Mon Sep 17 00:00:00 2001 From: Mari Date: Mon, 27 Nov 2023 11:17:29 +0100 Subject: [PATCH 1/2] upgrade prometheus-client --- .github/workflows/ci.yml | 6 +++--- autometrics/Cargo.toml | 8 ++++---- autometrics/build.rs | 4 ++-- autometrics/src/README.md | 4 ++-- examples/exemplars-tracing-opentelemetry/Cargo.toml | 2 +- examples/exemplars-tracing/Cargo.toml | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 387a6a83..a14e8bf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,15 +21,15 @@ jobs: # Note: GitHub hosted runners using the latest stable version of Rust have Clippy pre-installed. - run: cargo clippy --features=metrics-0_21,prometheus-exporter - run: cargo clippy --features=prometheus-0_13 - - run: cargo clippy --features=prometheus-client-0_21 + - run: cargo clippy --features=prometheus-client-0_22 - run: cargo clippy --features=opentelemetry-0_21 # Run the tests with each of the different metrics libraries - run: cargo test --features=prometheus-exporter - run: cargo test --features=prometheus-exporter,metrics-0_21 - run: cargo test --features=prometheus-exporter,prometheus-0_13 - - run: cargo test --features=prometheus-exporter,prometheus-client-0_21,exemplars-tracing - - run: cargo test --features=prometheus-exporter,prometheus-client-0_21,exemplars-tracing-opentelemetry-0_22 + - run: cargo test --features=prometheus-exporter,prometheus-client-0_22,exemplars-tracing + - run: cargo test --features=prometheus-exporter,prometheus-client-0_22,exemplars-tracing-opentelemetry-0_22 - run: cargo test --features=prometheus-exporter,opentelemetry-0_21 # Build the crate using the other optional features diff --git a/autometrics/Cargo.toml b/autometrics/Cargo.toml index c29ea674..8e38701e 100644 --- a/autometrics/Cargo.toml +++ b/autometrics/Cargo.toml @@ -17,13 +17,13 @@ readme = "README.md" metrics-0_21 = ["dep:metrics"] opentelemetry-0_21 = ["opentelemetry/metrics", "dep:prometheus"] prometheus-0_13 = ["dep:prometheus"] -prometheus-client-0_21 = ["dep:prometheus-client"] +prometheus-client-0_22 = ["dep:prometheus-client"] # Deprecated feature flags metrics = ["metrics-0_21"] opentelemetry = ["opentelemetry-0_21"] prometheus = ["prometheus-0_13"] -prometheus-client = ["prometheus-client-0_21"] +prometheus-client = ["prometheus-client-0_22"] exemplars-tracing-opentelemetry = ["exemplars-tracing-opentelemetry-0_22"] # Misc @@ -106,7 +106,7 @@ opentelemetry-otlp = { version = "0.14.0", default-features = false, optional = prometheus = { version = "0.13", default-features = false, optional = true } # Used for prometheus-client feature -prometheus-client = { version = "0.21.1", optional = true } +prometheus-client = { version = "0.22", optional = true } # Used for exemplars-tracing feature tracing = { version = "0.1", optional = true } @@ -124,7 +124,7 @@ criterion = "0.5" http = "0.2" opentelemetry = "0.21" opentelemetry-stdout = { version = "0.2", features = ["trace"] } -prometheus-client = "0.21" +prometheus-client = "0.22" tokio = { version = "1", features = ["full"] } tracing = "0.1" tracing-subscriber = "0.3" diff --git a/autometrics/build.rs b/autometrics/build.rs index a5d8b319..34f838de 100644 --- a/autometrics/build.rs +++ b/autometrics/build.rs @@ -10,7 +10,7 @@ pub fn main() { #[cfg(feature = "prometheus")] println!("cargo:warning=The `prometheus` feature is deprecated and will be removed in the next version. Please use `prometheus-0_13` instead."); #[cfg(feature = "prometheus-client")] - println!("cargo:warning=The `prometheus-client` feature is deprecated and will be removed in the next version. Please use `prometheus-client-0_21` instead."); + println!("cargo:warning=The `prometheus-client` feature is deprecated and will be removed in the next version. Please use `prometheus-client-0_22` instead."); #[cfg(feature = "exemplars-tracing-opentelemetry")] println!("cargo:warning=The `exemplars-tracing-opentelemetry` feature is deprecated and will be removed in the next version. Please use `exemplars-tracing-opentelemetry-0_22` instead."); @@ -19,7 +19,7 @@ pub fn main() { metrics: { any(feature = "metrics", feature = "metrics-0_21") }, opentelemetry: { any(feature = "opentelemetry", feature = "opentelemetry-0_21") }, prometheus: { any(feature = "prometheus", feature = "prometheus-0_13") }, - prometheus_client_feature: { any(feature = "prometheus-client", feature = "prometheus-client-0_21") }, + prometheus_client_feature: { any(feature = "prometheus-client", feature = "prometheus-client-0_22") }, default_backend: { all( prometheus_exporter, not(any(metrics, opentelemetry, prometheus, prometheus_client_feature)) diff --git a/autometrics/src/README.md b/autometrics/src/README.md index fb72294c..eb487088 100644 --- a/autometrics/src/README.md +++ b/autometrics/src/README.md @@ -148,10 +148,10 @@ If you require more customization than these offered feature flags, enable just > If you are exporting metrics yourself rather than using the `prometheus-exporter`, you must ensure that you are using the exact same version of the metrics library as `autometrics` (and it must come from `crates.io` rather than git or another source). If not, the autometrics metrics will not appear in your exported metrics. -- `opentelemetry-0_20` - use the [opentelemetry](https://crates.io/crates/opentelemetry) crate for producing metrics. +- `opentelemetry-0_21` - use the [opentelemetry](https://crates.io/crates/opentelemetry) crate for producing metrics. - `metrics-0_21` - use the [metrics](https://crates.io/crates/metrics) crate for producing metrics - `prometheus-0_13` - use the [prometheus](https://crates.io/crates/prometheus) crate for producing metrics -- `prometheus-client-0_21` - use the official [prometheus-client](https://crates.io/crates/prometheus-client) crate for producing metrics +- `prometheus-client-0_22` - use the official [prometheus-client](https://crates.io/crates/prometheus-client) crate for producing metrics ### Exemplars (for integrating metrics with traces) diff --git a/examples/exemplars-tracing-opentelemetry/Cargo.toml b/examples/exemplars-tracing-opentelemetry/Cargo.toml index 7966589c..8ae1aabf 100644 --- a/examples/exemplars-tracing-opentelemetry/Cargo.toml +++ b/examples/exemplars-tracing-opentelemetry/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] autometrics = { path = "../../autometrics", features = [ - "prometheus-client-0_21", + "prometheus-client-0_22", "prometheus-exporter", "exemplars-tracing-opentelemetry-0_22", ] } diff --git a/examples/exemplars-tracing/Cargo.toml b/examples/exemplars-tracing/Cargo.toml index c749d893..6d8dd7be 100644 --- a/examples/exemplars-tracing/Cargo.toml +++ b/examples/exemplars-tracing/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] autometrics = { path = "../../autometrics", features = [ - "prometheus-client-0_21", + "prometheus-client-0_22", "prometheus-exporter", "exemplars-tracing" ] } From bbf46542a68fc396d74890840d27ec34a392d1f7 Mon Sep 17 00:00:00 2001 From: Mari Date: Mon, 27 Nov 2023 11:26:10 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce015367..bb851447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ The following changes are made in order to bring the release in compliance with as with the `prometheus` and `prometheus-client` crates, because the histogram buckets can now be configured via the settings - Upgraded `opentelemetry` to v0.20 +- Upgraded `prometheus-client` to v0.22 ### Deprecated