From 8b36b2a02b1a6cddb9da59ce843bbc3d622acd3e Mon Sep 17 00:00:00 2001 From: killzoner Date: Thu, 14 Aug 2025 20:19:59 +0200 Subject: [PATCH 1/2] Update prometheus to 0.14 --- .github/workflows/ci.yml | 4 ++-- README.md | 4 ++-- autometrics/Cargo.toml | 4 ++-- autometrics/build.rs | 4 ++-- autometrics/src/README.md | 2 +- examples/custom-metrics/README.md | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f243f28..1e68bbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,14 +20,14 @@ jobs: # Lint # Note: GitHub hosted runners using the latest stable version of Rust have Clippy pre-installed. - run: cargo clippy --features=metrics-0_24,prometheus-exporter - - run: cargo clippy --features=prometheus-0_13 + - run: cargo clippy --features=prometheus-0_14 - run: cargo clippy --features=prometheus-client-0_22 - run: cargo clippy --features=opentelemetry-0_24 # Run the tests with each of the different metrics libraries - run: cargo test --features=prometheus-exporter - run: cargo test --features=prometheus-exporter,metrics-0_24 - - run: cargo test --features=prometheus-exporter,prometheus-0_13 + - run: cargo test --features=prometheus-exporter,prometheus-0_14 - 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_25 - run: cargo test --features=prometheus-exporter,opentelemetry-0_24 diff --git a/README.md b/README.md index a1a6e2b..1f12a8b 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ https://github.com/autometrics-dev/autometrics-rs/assets/3262610/966ed140-1d6c-4 [dependencies] autometrics = { version = "*", - features = ["prometheus-0_13"], + features = ["prometheus-0_14"], default-features = false } ``` @@ -205,7 +205,7 @@ To see autometrics in action: ## Benchmarks Using each of the following metrics libraries, tracking metrics with the `autometrics` macro adds approximately: -- `prometheus-0_13`: 140-150 nanoseconds +- `prometheus-0_14`: 140-150 nanoseconds - `prometheus-client-0_21`: 150-250 nanoseconds - `metrics-0_21`: 550-650 nanoseconds - `opentelemetry-0_20`: 1700-2100 nanoseconds diff --git a/autometrics/Cargo.toml b/autometrics/Cargo.toml index 72dddd2..6bc2b3e 100644 --- a/autometrics/Cargo.toml +++ b/autometrics/Cargo.toml @@ -16,13 +16,13 @@ readme = "README.md" # Metrics backends metrics-0_24 = ["dep:metrics"] opentelemetry-0_24 = ["opentelemetry/metrics", "dep:prometheus"] -prometheus-0_13 = ["dep:prometheus"] +prometheus-0_14 = ["dep:prometheus"] prometheus-client-0_22 = ["dep:prometheus-client"] # Deprecated feature flags metrics = ["metrics-0_24"] opentelemetry = ["opentelemetry-0_24"] -prometheus = ["prometheus-0_13"] +prometheus = ["prometheus-0_14"] prometheus-client = ["prometheus-client-0_22"] exemplars-tracing-opentelemetry = ["exemplars-tracing-opentelemetry-0_25"] diff --git a/autometrics/build.rs b/autometrics/build.rs index 99105e4..6a3ab11 100644 --- a/autometrics/build.rs +++ b/autometrics/build.rs @@ -8,7 +8,7 @@ pub fn main() { #[cfg(feature = "opentelemetry")] println!("cargo:warning=The `opentelemetry` feature is deprecated and will be removed in the next version. Please use `opentelemetry-0_24` instead."); #[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."); + println!("cargo:warning=The `prometheus` feature is deprecated and will be removed in the next version. Please use `prometheus-0_14` 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_22` instead."); #[cfg(feature = "exemplars-tracing-opentelemetry")] @@ -18,7 +18,7 @@ pub fn main() { // Backends metrics: { any(feature = "metrics", feature = "metrics-0_24") }, opentelemetry: { any(feature = "opentelemetry", feature = "opentelemetry-0_24") }, - prometheus: { any(feature = "prometheus", feature = "prometheus-0_13") }, + prometheus: { any(feature = "prometheus", feature = "prometheus-0_14") }, prometheus_client_feature: { any(feature = "prometheus-client", feature = "prometheus-client-0_22") }, default_backend: { all( prometheus_exporter, diff --git a/autometrics/src/README.md b/autometrics/src/README.md index 5e61b74..8a4af65 100644 --- a/autometrics/src/README.md +++ b/autometrics/src/README.md @@ -155,7 +155,7 @@ If you require more customization than these offered feature flags, enable just - `opentelemetry-0_24` - use the [opentelemetry](https://crates.io/crates/opentelemetry) crate for producing metrics. - `metrics-0_24` - 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-0_14` - use the [prometheus](https://crates.io/crates/prometheus) 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/custom-metrics/README.md b/examples/custom-metrics/README.md index 551659b..e02f0e7 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -19,5 +19,5 @@ cargo run -p example-custom-metrics --features=metrics-0_24 ### Using the `prometheus` crate ```shell -cargo run -p example-custom-metrics --features=prometheus-0_13 +cargo run -p example-custom-metrics --features=prometheus-0_14 ``` From eb7a48fc6affcb30dab1258e966626abbf2c1006 Mon Sep 17 00:00:00 2001 From: killzoner Date: Thu, 14 Aug 2025 20:21:45 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f09c9fd..4b7addb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `metrics` has been updated to v0.24 (#183) New feature flag: `metrics-0_24` Removed feature flag: `metrics-0_21` +- `prometheus` has been updated to v0.14 (#187) + New feature flag: `prometheus-0_14` + Removed feature flag: `prometheus-0_13` ## [2.0.0](https://github.com/autometrics-dev/autometrics-rs/releases/tag/v2.0.0) - 2024-07-25