Skip to content

Commit 0e09785

Browse files
miniduikbootmies
andauthored
Update metrics to 0.24 (#183)
Co-authored-by: Micha Hernandez van Leuffen <[email protected]>
1 parent 97d6aec commit 0e09785

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ jobs:
1919

2020
# Lint
2121
# Note: GitHub hosted runners using the latest stable version of Rust have Clippy pre-installed.
22-
- run: cargo clippy --features=metrics-0_21,prometheus-exporter
22+
- run: cargo clippy --features=metrics-0_24,prometheus-exporter
2323
- run: cargo clippy --features=prometheus-0_13
2424
- run: cargo clippy --features=prometheus-client-0_22
2525
- run: cargo clippy --features=opentelemetry-0_24
2626

2727
# Run the tests with each of the different metrics libraries
2828
- run: cargo test --features=prometheus-exporter
29-
- run: cargo test --features=prometheus-exporter,metrics-0_21
29+
- run: cargo test --features=prometheus-exporter,metrics-0_24
3030
- run: cargo test --features=prometheus-exporter,prometheus-0_13
3131
- run: cargo test --features=prometheus-exporter,prometheus-client-0_22,exemplars-tracing
3232
- run: cargo test --features=prometheus-exporter,prometheus-client-0_22,exemplars-tracing-opentelemetry-0_25
3333
- run: cargo test --features=prometheus-exporter,opentelemetry-0_24
3434

3535
# Build the crate using the other optional features
36-
- run: cargo build --features=metrics-0_21,custom-objective-percentile,custom-objective-latency
36+
- run: cargo build --features=metrics-0_24,custom-objective-percentile,custom-objective-latency
3737

3838
# Install protoc for the examples
3939
- uses: arduino/setup-protoc@v3

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## Unreleased
1111

12-
-
12+
### Breaking changes
13+
- `metrics` has been updated to v0.24 (#183)
14+
New feature flag: `metrics-0_24`
15+
Removed feature flag: `metrics-0_21`
1316

1417
## [2.0.0](https://github.com/autometrics-dev/autometrics-rs/releases/tag/v2.0.0) - 2024-07-25
1518

autometrics/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ readme = "README.md"
1414

1515
[features]
1616
# Metrics backends
17-
metrics-0_21 = ["dep:metrics"]
17+
metrics-0_24 = ["dep:metrics"]
1818
opentelemetry-0_24 = ["opentelemetry/metrics", "dep:prometheus"]
1919
prometheus-0_13 = ["dep:prometheus"]
2020
prometheus-client-0_22 = ["dep:prometheus-client"]
2121

2222
# Deprecated feature flags
23-
metrics = ["metrics-0_21"]
23+
metrics = ["metrics-0_24"]
2424
opentelemetry = ["opentelemetry-0_24"]
2525
prometheus = ["prometheus-0_13"]
2626
prometheus-client = ["prometheus-client-0_22"]
@@ -94,11 +94,11 @@ thiserror = "1"
9494
opentelemetry = { version = "0.24", default-features = false, optional = true }
9595

9696
# Use for metrics feature
97-
metrics = { version = "0.21", default-features = false, optional = true }
97+
metrics = { version = "0.24", default-features = false, optional = true }
9898

9999
# Used for prometheus-exporter feature
100100
http = { version = "1.0.0", optional = true }
101-
metrics-exporter-prometheus = { version = "0.12", default-features = false, optional = true }
101+
metrics-exporter-prometheus = { version = "0.16", default-features = false, optional = true }
102102
opentelemetry-prometheus = { version = "0.17", optional = true }
103103
opentelemetry_sdk = { version = "0.24.1", default-features = false, features = [
104104
"metrics",

autometrics/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pub fn main() {
44
println!("cargo:rerun-if-changed=build.rs");
55

66
#[cfg(feature = "metrics")]
7-
println!("cargo:warning=The `metrics` feature is deprecated and will be removed in the next version. Please use `metrics-0_21` instead.");
7+
println!("cargo:warning=The `metrics` feature is deprecated and will be removed in the next version. Please use `metrics-0_24` instead.");
88
#[cfg(feature = "opentelemetry")]
99
println!("cargo:warning=The `opentelemetry` feature is deprecated and will be removed in the next version. Please use `opentelemetry-0_24` instead.");
1010
#[cfg(feature = "prometheus")]
@@ -16,7 +16,7 @@ pub fn main() {
1616

1717
cfg_aliases! {
1818
// Backends
19-
metrics: { any(feature = "metrics", feature = "metrics-0_21") },
19+
metrics: { any(feature = "metrics", feature = "metrics-0_24") },
2020
opentelemetry: { any(feature = "opentelemetry", feature = "opentelemetry-0_24") },
2121
prometheus: { any(feature = "prometheus", feature = "prometheus-0_13") },
2222
prometheus_client_feature: { any(feature = "prometheus-client", feature = "prometheus-client-0_22") },

autometrics/src/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ If you require more customization than these offered feature flags, enable just
154154
> 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.
155155
156156
- `opentelemetry-0_24` - use the [opentelemetry](https://crates.io/crates/opentelemetry) crate for producing metrics.
157-
- `metrics-0_21` - use the [metrics](https://crates.io/crates/metrics) crate for producing metrics
157+
- `metrics-0_24` - use the [metrics](https://crates.io/crates/metrics) crate for producing metrics
158158
- `prometheus-0_13` - use the [prometheus](https://crates.io/crates/prometheus) crate for producing metrics
159159
- `prometheus-client-0_22` - use the official [prometheus-client](https://crates.io/crates/prometheus-client) crate for producing metrics
160160

examples/custom-metrics/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cargo run -p example-custom-metrics --features=opentelemetry-0_20
1313
### Using the `metrics` crate
1414

1515
```shell
16-
cargo run -p example-custom-metrics --features=metrics-0_21
16+
cargo run -p example-custom-metrics --features=metrics-0_24
1717
```
1818

1919
### Using the `prometheus` crate

0 commit comments

Comments
 (0)