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

Update metrics to 0.24 #183

Merged
merged 2 commits into from
Oct 21, 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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ jobs:

# Lint
# 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=metrics-0_24,prometheus-exporter
- run: cargo clippy --features=prometheus-0_13
- 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_21
- 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-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

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

# Install protoc for the examples
- uses: arduino/setup-protoc@v3
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

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

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

Expand Down
8 changes: 4 additions & 4 deletions autometrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ readme = "README.md"

[features]
# Metrics backends
metrics-0_21 = ["dep:metrics"]
metrics-0_24 = ["dep:metrics"]
opentelemetry-0_24 = ["opentelemetry/metrics", "dep:prometheus"]
prometheus-0_13 = ["dep:prometheus"]
prometheus-client-0_22 = ["dep:prometheus-client"]

# Deprecated feature flags
metrics = ["metrics-0_21"]
metrics = ["metrics-0_24"]
opentelemetry = ["opentelemetry-0_24"]
prometheus = ["prometheus-0_13"]
prometheus-client = ["prometheus-client-0_22"]
Expand Down Expand Up @@ -94,11 +94,11 @@ thiserror = "1"
opentelemetry = { version = "0.24", default-features = false, optional = true }

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

# Used for prometheus-exporter feature
http = { version = "1.0.0", optional = true }
metrics-exporter-prometheus = { version = "0.12", default-features = false, optional = true }
metrics-exporter-prometheus = { version = "0.16", default-features = false, optional = true }
opentelemetry-prometheus = { version = "0.17", optional = true }
opentelemetry_sdk = { version = "0.24.1", default-features = false, features = [
"metrics",
Expand Down
4 changes: 2 additions & 2 deletions autometrics/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub fn main() {
println!("cargo:rerun-if-changed=build.rs");

#[cfg(feature = "metrics")]
println!("cargo:warning=The `metrics` feature is deprecated and will be removed in the next version. Please use `metrics-0_21` instead.");
println!("cargo:warning=The `metrics` feature is deprecated and will be removed in the next version. Please use `metrics-0_24` instead.");
#[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")]
Expand All @@ -16,7 +16,7 @@ pub fn main() {

cfg_aliases! {
// Backends
metrics: { any(feature = "metrics", feature = "metrics-0_21") },
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_client_feature: { any(feature = "prometheus-client", feature = "prometheus-client-0_22") },
Expand Down
2 changes: 1 addition & 1 deletion autometrics/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ 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_24` - 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
- `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-client-0_22` - use the official [prometheus-client](https://crates.io/crates/prometheus-client) crate for producing metrics

Expand Down
2 changes: 1 addition & 1 deletion examples/custom-metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cargo run -p example-custom-metrics --features=opentelemetry-0_20
### Using the `metrics` crate

```shell
cargo run -p example-custom-metrics --features=metrics-0_21
cargo run -p example-custom-metrics --features=metrics-0_24
```

### Using the `prometheus` crate
Expand Down
Loading