Skip to content

Commit

Permalink
chore(common): bumpe MSRV to 1.57 (#953)
Browse files Browse the repository at this point in the history
* chore(common): bump MSRV to 1.57

* test(semcov): fix doc tests

* test(trace): add unit test for jaeger remote sampler.

* additional line for EOF
  • Loading branch information
TommyCpp authored Jan 24, 2023
1 parent 0ef87ad commit a5d80bd
Show file tree
Hide file tree
Showing 30 changed files with 77 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.56
toolchain: 1.57
override: true
- name: Patch dependencies versions # some dependencies bump MSRV without major version bump
run: ./scripts/patch_dependencies.sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
can export and analyze them using [Prometheus], [Jaeger], and other
observability tools.

*Compiler support: [requires `rustc` 1.56+][msrv]*
*Compiler support: [requires `rustc` 1.57+][msrv]*

[Prometheus]: https://prometheus.io
[Jaeger]: https://www.jaegertracing.io
Expand Down Expand Up @@ -137,7 +137,7 @@ above, please let us know! We'd love to add your project to the list!
## Supported Rust Versions

OpenTelemetry is built against the latest stable release. The minimum supported
version is 1.56. The current OpenTelemetry version is not guaranteed to build
version is 1.57. The current OpenTelemetry version is not guaranteed to build
on Rust versions earlier than the minimum supported version.

The current stable Rust compiler and the three most recent minor versions
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/open-telemetry/opentelemetry-rust"
readme = "README.md"
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[dependencies]
fnv = { version = "1.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
can export and analyze them using [Prometheus], [Jaeger], and other
observability tools.

*Compiler support: [requires `rustc` 1.56+][msrv]*
*Compiler support: [requires `rustc` 1.57+][msrv]*

[Prometheus]: https://prometheus.io
[Jaeger]: https://www.jaegertracing.io
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! services to capture distributed traces and metrics from your application. You
//! can analyze them using [Prometheus], [Jaeger], and other observability tools.
//!
//! *Compiler support: [requires `rustc` 1.56+][msrv]*
//! *Compiler support: [requires `rustc` 1.57+][msrv]*
//!
//! [Prometheus]: https://prometheus.io
//! [Jaeger]: https://www.jaegertracing.io
Expand All @@ -11,7 +11,7 @@
//! ## Supported Rust Versions
//!
//! OpenTelemetry is built against the latest stable release. The minimum
//! supported version is 1.56. The current OpenTelemetry version is not
//! supported version is 1.57. The current OpenTelemetry version is not
//! guaranteed to build on Rust versions earlier than the minimum supported
//! version.
//!
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-aws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = [
keywords = ["opentelemetry", "tracing"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-contrib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = [
keywords = ["opentelemetry", "tracing"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-datadog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = [
keywords = ["opentelemetry", "tracing"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-dynatrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = [
keywords = ["opentelemetry", "metrics", "dynatrace"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/open-telemetry/opentelemetry-rust"
keywords = ["opentelemetry", "tracing", "metrics"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[dependencies]
async-trait = "0.1"
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ analysis in order to understand your software's performance and behavior. This
crate provides a HTTP client interface for use by trace exporters, as well as
helper types to inject and extract key value pairs into/from HTTP headers.

*Compiler support: [requires `rustc` 1.56+][msrv]*
*Compiler support: [requires `rustc` 1.57+][msrv]*

[`OpenTelemetry`]: https://crates.io/crates/opentelemetry
[msrv]: #supported-rust-versions

## Supported Rust Versions

OpenTelemetry is built against the latest stable release. The minimum supported
version is 1.56. The current OpenTelemetry version is not guaranteed to build
version is 1.57. The current OpenTelemetry version is not guaranteed to build
on Rust versions earlier than the minimum supported version.

The current stable Rust compiler and the three most recent minor versions
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = [
keywords = ["opentelemetry", "jaeger", "tracing", "async"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ analysis in order to understand your software's performance and behavior. This
crate provides a trace pipeline and exporter for sending span information to a
Jaeger `agent` or `collector` endpoint for processing and visualization.

*Compiler support: [requires `rustc` 1.56+][msrv]*
*Compiler support: [requires `rustc` 1.57+][msrv]*

[`Jaeger`]: https://www.jaegertracing.io/
[`OpenTelemetry`]: https://crates.io/crates/opentelemetry
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-jaeger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//!
//! See the [Jaeger Docs] for details about Jaeger and deployment information.
//!
//! *Compiler support: [requires `rustc` 1.56+][msrv]*
//! *Compiler support: [requires `rustc` 1.57+][msrv]*
//!
//! [Jaeger Docs]: https://www.jaegertracing.io/docs/
//! [msrv]: #supported-rust-versions
Expand Down Expand Up @@ -280,13 +280,13 @@
//! # Supported Rust Versions
//!
//! OpenTelemetry is built against the latest stable release. The minimum
//! supported version is 1.56. The current OpenTelemetry version is not
//! supported version is 1.57. The current OpenTelemetry version is not
//! guaranteed to build on Rust versions earlier than the minimum supported
//! version.
//!
//! The current stable Rust compiler and the three most recent minor versions
//! before it will always be supported. For example, if the current stable
//! compiler version is 1.56, the minimum supported version will not be
//! compiler version is 1.57, the minimum supported version will not be
//! increased past 1.46, three minor versions prior. Increasing the minimum
//! supported compiler version is not considered a semver breaking change as
//! long as doing so complies with this policy.
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = [
keywords = ["opentelemetry", "otlp", "logging", "tracing", "metrics"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"
autotests = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-prometheus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = [
keywords = ["opentelemetry", "prometheus", "metrics", "async"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = [
keywords = ["opentelemetry", "otlp", "logging", "tracing", "metrics"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"
autotests = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/open-telemetry/opentelemetry-rust"
readme = "README.md"
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[dependencies]
opentelemetry_api = { version = "0.18", path = "../opentelemetry-api/" }
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
can export and analyze them using [Prometheus], [Jaeger], and other
observability tools.

*Compiler support: [requires `rustc` 1.56+][msrv]*
*Compiler support: [requires `rustc` 1.57+][msrv]*

[Prometheus]: https://prometheus.io
[Jaeger]: https://www.jaegertracing.io
Expand Down
28 changes: 28 additions & 0 deletions opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,31 @@ impl ShouldSample for JaegerRemoteSampler {
})
}
}

#[cfg(test)]
mod tests {
use crate::trace::sampler::jaeger_remote::remote::SamplingStrategyType;
use std::fmt::{Debug, Formatter};

impl Debug for SamplingStrategyType {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match &self {
SamplingStrategyType::Probabilistic => f.write_str("Probabilistic"),
SamplingStrategyType::RateLimiting => f.write_str("RateLimiting"),
}
}
}

#[test]
fn deserialize_sampling_strategy_response() {
let json = r#"{
"strategyType": "PROBABILISTIC",
"probabilisticSampling": {
"samplingRate": 0.5
}
}"#;
let resp: super::SamplingStrategyResponse = serde_json::from_str(json).unwrap();
assert_eq!(resp.strategy_type, SamplingStrategyType::Probabilistic);
assert_eq!(resp.probabilistic_sampling.unwrap().sampling_rate, 0.5);
}
}
2 changes: 1 addition & 1 deletion opentelemetry-semantic-conventions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = [
keywords = ["opentelemetry", "tracing", "async"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-semantic-conventions/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//! let _span = tracer
//! .span_builder("span-name")
//! .with_attributes(vec![
//! semcov::trace::NET_PEER_IP.string("10.0.0.1"),
//! semcov::trace::NET_PEER_NAME.string("example.org"),
//! semcov::trace::NET_PEER_PORT.i64(80),
//! ])
//! .start(&tracer);
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-zipkin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = [
keywords = ["opentelemetry", "zipkin", "tracing", "async"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-zipkin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ analysis in order to understand your software's performance and behavior. This
crate provides a trace pipeline and exporter for sending span information to a
Zipkin collector for processing and visualization.

*Compiler support: [requires `rustc` 1.56+][msrv]*
*Compiler support: [requires `rustc` 1.57+][msrv]*

[`Zipkin`]: https://zipkin.io/
[`OpenTelemetry`]: https://crates.io/crates/opentelemetry
Expand Down Expand Up @@ -107,12 +107,12 @@ available so be sure to match them appropriately.
## Supported Rust Versions

OpenTelemetry is built against the latest stable release. The minimum supported
version is 1.56. The current OpenTelemetry version is not guaranteed to build on
version is 1.57. The current OpenTelemetry version is not guaranteed to build on
Rust versions earlier than the minimum supported version.

The current stable Rust compiler and the three most recent minor versions before
it will always be supported. For example, if the current stable compiler version
is 1.56, the minimum supported version will not be increased past 1.46, three
is 1.57, the minimum supported version will not be increased past 1.46, three
minor versions prior. Increasing the minimum supported compiler version is not
considered a semver breaking change as long as doing so complies with this
policy.
4 changes: 2 additions & 2 deletions opentelemetry-zipkin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Collects OpenTelemetry spans and reports them to a given Zipkin collector
//! endpoint. See the [Zipkin Docs] for details and deployment information.
//!
//! *Compiler support: [requires `rustc` 1.56+][msrv]*
//! *Compiler support: [requires `rustc` 1.57+][msrv]*
//!
//! [Zipkin Docs]: https://zipkin.io/
//! [msrv]: #supported-rust-versions
Expand Down Expand Up @@ -167,7 +167,7 @@
//! ## Supported Rust Versions
//!
//! OpenTelemetry is built against the latest stable release. The minimum
//! supported version is 1.56. The current OpenTelemetry version is not
//! supported version is 1.57. The current OpenTelemetry version is not
//! guaranteed to build on Rust versions earlier than the minimum supported
//! version.
//!
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-zpages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = [
keywords = ["opentelemetry", "zipkin", "tracing", "async"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = [
keywords = ["opentelemetry", "logging", "tracing", "metrics", "async"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"

[package.metadata.docs.rs]
all-features = true
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
can export and analyze them using [Prometheus], [Jaeger], and other
observability tools.

*Compiler support: [requires `rustc` 1.56+][msrv]*
*Compiler support: [requires `rustc` 1.57+][msrv]*

[Prometheus]: https://prometheus.io
[Jaeger]: https://www.jaegertracing.io
Expand Down Expand Up @@ -130,7 +130,7 @@ above, please let us know! We'd love to add your project to the list!
## Supported Rust Versions

OpenTelemetry is built against the latest stable release. The minimum supported
version is 1.56. The current OpenTelemetry version is not guaranteed to build
version is 1.57. The current OpenTelemetry version is not guaranteed to build
on Rust versions earlier than the minimum supported version.

The current stable Rust compiler and the three most recent minor versions
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! services to capture distributed traces and metrics from your application. You
//! can analyze them using [Prometheus], [Jaeger], and other observability tools.
//!
//! *Compiler support: [requires `rustc` 1.56+][msrv]*
//! *Compiler support: [requires `rustc` 1.57+][msrv]*
//!
//! [Prometheus]: https://prometheus.io
//! [Jaeger]: https://www.jaegertracing.io
Expand Down Expand Up @@ -192,7 +192,7 @@
//! ## Supported Rust Versions
//!
//! OpenTelemetry is built against the latest stable release. The minimum
//! supported version is 1.56. The current OpenTelemetry version is not
//! supported version is 1.57. The current OpenTelemetry version is not
//! guaranteed to build on Rust versions earlier than the minimum supported
//! version.
//!
Expand Down
17 changes: 11 additions & 6 deletions scripts/patch_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Dashmap >= 5.3.4 requires 1.59
latest_version=$(cargo search --limit 1 dashmap | head -1 | cut -d'"' -f2) &&
cargo update -p dashmap:$latest_version --precise 5.1.0 &&
# async-global-executor >= 2.3.0 requires 1.59
latest_version=$(cargo search --limit 1 async-global-executor | head -1 | cut -d'"' -f2) &&
cargo update -p async-global-executor:$latest_version --precise 2.2.0
#!/bin/bash

function patch_version() {
local latest_version=$(cargo search --limit 1 $1 | head -1 | cut -d'"' -f2)
echo "patching $1 from $latest_version to $2"
cargo update -p $1:$latest_version --precise $2
}
# Dashmap >= 5.3.4 requires rust 1.59
patch_version "dashmap" "5.1.0"
# async-global-executor >= 2.3.0 requires rust 1.59
patch_version "async-global-executor" "2.2.0"

0 comments on commit a5d80bd

Please sign in to comment.