Skip to content

Commit a5d80bd

Browse files
authored
chore(common): bumpe MSRV to 1.57 (open-telemetry#953)
* 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
1 parent 0ef87ad commit a5d80bd

File tree

30 files changed

+77
-44
lines changed

30 files changed

+77
-44
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- uses: actions-rs/toolchain@v1
7171
with:
7272
profile: minimal
73-
toolchain: 1.56
73+
toolchain: 1.57
7474
override: true
7575
- name: Patch dependencies versions # some dependencies bump MSRV without major version bump
7676
run: ./scripts/patch_dependencies.sh

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
2525
can export and analyze them using [Prometheus], [Jaeger], and other
2626
observability tools.
2727

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

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

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

143143
The current stable Rust compiler and the three most recent minor versions

opentelemetry-api/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository = "https://github.com/open-telemetry/opentelemetry-rust"
77
readme = "README.md"
88
license = "Apache-2.0"
99
edition = "2021"
10-
rust-version = "1.56"
10+
rust-version = "1.57"
1111

1212
[dependencies]
1313
fnv = { version = "1.0", optional = true }

opentelemetry-api/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
2525
can export and analyze them using [Prometheus], [Jaeger], and other
2626
observability tools.
2727

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

3030
[Prometheus]: https://prometheus.io
3131
[Jaeger]: https://www.jaegertracing.io

opentelemetry-api/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! services to capture distributed traces and metrics from your application. You
33
//! can analyze them using [Prometheus], [Jaeger], and other observability tools.
44
//!
5-
//! *Compiler support: [requires `rustc` 1.56+][msrv]*
5+
//! *Compiler support: [requires `rustc` 1.57+][msrv]*
66
//!
77
//! [Prometheus]: https://prometheus.io
88
//! [Jaeger]: https://www.jaegertracing.io
@@ -11,7 +11,7 @@
1111
//! ## Supported Rust Versions
1212
//!
1313
//! OpenTelemetry is built against the latest stable release. The minimum
14-
//! supported version is 1.56. The current OpenTelemetry version is not
14+
//! supported version is 1.57. The current OpenTelemetry version is not
1515
//! guaranteed to build on Rust versions earlier than the minimum supported
1616
//! version.
1717
//!

opentelemetry-aws/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ categories = [
1212
keywords = ["opentelemetry", "tracing"]
1313
license = "Apache-2.0"
1414
edition = "2021"
15-
rust-version = "1.56"
15+
rust-version = "1.57"
1616

1717
[package.metadata.docs.rs]
1818
all-features = true

opentelemetry-contrib/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ categories = [
1212
keywords = ["opentelemetry", "tracing"]
1313
license = "Apache-2.0"
1414
edition = "2021"
15-
rust-version = "1.56"
15+
rust-version = "1.57"
1616

1717
[package.metadata.docs.rs]
1818
all-features = true

opentelemetry-datadog/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ categories = [
1212
keywords = ["opentelemetry", "tracing"]
1313
license = "Apache-2.0"
1414
edition = "2021"
15-
rust-version = "1.56"
15+
rust-version = "1.57"
1616

1717
[package.metadata.docs.rs]
1818
all-features = true

opentelemetry-dynatrace/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
keywords = ["opentelemetry", "metrics", "dynatrace"]
1414
license = "Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.56"
16+
rust-version = "1.57"
1717

1818
[package.metadata.docs.rs]
1919
all-features = true

opentelemetry-http/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository = "https://github.com/open-telemetry/opentelemetry-rust"
77
keywords = ["opentelemetry", "tracing", "metrics"]
88
license = "Apache-2.0"
99
edition = "2021"
10-
rust-version = "1.56"
10+
rust-version = "1.57"
1111

1212
[dependencies]
1313
async-trait = "0.1"

opentelemetry-http/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ analysis in order to understand your software's performance and behavior. This
2121
crate provides a HTTP client interface for use by trace exporters, as well as
2222
helper types to inject and extract key value pairs into/from HTTP headers.
2323

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

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

2929
## Supported Rust Versions
3030

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

3535
The current stable Rust compiler and the three most recent minor versions

opentelemetry-jaeger/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
keywords = ["opentelemetry", "jaeger", "tracing", "async"]
1414
license = "Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.56"
16+
rust-version = "1.57"
1717

1818
[package.metadata.docs.rs]
1919
all-features = true

opentelemetry-jaeger/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ analysis in order to understand your software's performance and behavior. This
2323
crate provides a trace pipeline and exporter for sending span information to a
2424
Jaeger `agent` or `collector` endpoint for processing and visualization.
2525

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

2828
[`Jaeger`]: https://www.jaegertracing.io/
2929
[`OpenTelemetry`]: https://crates.io/crates/opentelemetry

opentelemetry-jaeger/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//!
44
//! See the [Jaeger Docs] for details about Jaeger and deployment information.
55
//!
6-
//! *Compiler support: [requires `rustc` 1.56+][msrv]*
6+
//! *Compiler support: [requires `rustc` 1.57+][msrv]*
77
//!
88
//! [Jaeger Docs]: https://www.jaegertracing.io/docs/
99
//! [msrv]: #supported-rust-versions
@@ -280,13 +280,13 @@
280280
//! # Supported Rust Versions
281281
//!
282282
//! OpenTelemetry is built against the latest stable release. The minimum
283-
//! supported version is 1.56. The current OpenTelemetry version is not
283+
//! supported version is 1.57. The current OpenTelemetry version is not
284284
//! guaranteed to build on Rust versions earlier than the minimum supported
285285
//! version.
286286
//!
287287
//! The current stable Rust compiler and the three most recent minor versions
288288
//! before it will always be supported. For example, if the current stable
289-
//! compiler version is 1.56, the minimum supported version will not be
289+
//! compiler version is 1.57, the minimum supported version will not be
290290
//! increased past 1.46, three minor versions prior. Increasing the minimum
291291
//! supported compiler version is not considered a semver breaking change as
292292
//! long as doing so complies with this policy.

opentelemetry-otlp/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
keywords = ["opentelemetry", "otlp", "logging", "tracing", "metrics"]
1414
license = "Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.56"
16+
rust-version = "1.57"
1717
autotests = false
1818

1919
[lib]

opentelemetry-prometheus/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
keywords = ["opentelemetry", "prometheus", "metrics", "async"]
1414
license = "Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.56"
16+
rust-version = "1.57"
1717

1818
[package.metadata.docs.rs]
1919
all-features = true

opentelemetry-proto/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ categories = [
1414
keywords = ["opentelemetry", "otlp", "logging", "tracing", "metrics"]
1515
license = "Apache-2.0"
1616
edition = "2021"
17-
rust-version = "1.56"
17+
rust-version = "1.57"
1818
autotests = false
1919

2020
[lib]

opentelemetry-sdk/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository = "https://github.com/open-telemetry/opentelemetry-rust"
77
readme = "README.md"
88
license = "Apache-2.0"
99
edition = "2021"
10-
rust-version = "1.56"
10+
rust-version = "1.57"
1111

1212
[dependencies]
1313
opentelemetry_api = { version = "0.18", path = "../opentelemetry-api/" }

opentelemetry-sdk/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
2525
can export and analyze them using [Prometheus], [Jaeger], and other
2626
observability tools.
2727

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

3030
[Prometheus]: https://prometheus.io
3131
[Jaeger]: https://www.jaegertracing.io

opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs

+28
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,31 @@ impl ShouldSample for JaegerRemoteSampler {
256256
})
257257
}
258258
}
259+
260+
#[cfg(test)]
261+
mod tests {
262+
use crate::trace::sampler::jaeger_remote::remote::SamplingStrategyType;
263+
use std::fmt::{Debug, Formatter};
264+
265+
impl Debug for SamplingStrategyType {
266+
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
267+
match &self {
268+
SamplingStrategyType::Probabilistic => f.write_str("Probabilistic"),
269+
SamplingStrategyType::RateLimiting => f.write_str("RateLimiting"),
270+
}
271+
}
272+
}
273+
274+
#[test]
275+
fn deserialize_sampling_strategy_response() {
276+
let json = r#"{
277+
"strategyType": "PROBABILISTIC",
278+
"probabilisticSampling": {
279+
"samplingRate": 0.5
280+
}
281+
}"#;
282+
let resp: super::SamplingStrategyResponse = serde_json::from_str(json).unwrap();
283+
assert_eq!(resp.strategy_type, SamplingStrategyType::Probabilistic);
284+
assert_eq!(resp.probabilistic_sampling.unwrap().sampling_rate, 0.5);
285+
}
286+
}

opentelemetry-semantic-conventions/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
keywords = ["opentelemetry", "tracing", "async"]
1414
license = "Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.56"
16+
rust-version = "1.57"
1717

1818
[package.metadata.docs.rs]
1919
all-features = true

opentelemetry-semantic-conventions/src/trace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//! let _span = tracer
2222
//! .span_builder("span-name")
2323
//! .with_attributes(vec![
24-
//! semcov::trace::NET_PEER_IP.string("10.0.0.1"),
24+
//! semcov::trace::NET_PEER_NAME.string("example.org"),
2525
//! semcov::trace::NET_PEER_PORT.i64(80),
2626
//! ])
2727
//! .start(&tracer);

opentelemetry-zipkin/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
keywords = ["opentelemetry", "zipkin", "tracing", "async"]
1414
license = "Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.56"
16+
rust-version = "1.57"
1717

1818
[package.metadata.docs.rs]
1919
all-features = true

opentelemetry-zipkin/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ analysis in order to understand your software's performance and behavior. This
2323
crate provides a trace pipeline and exporter for sending span information to a
2424
Zipkin collector for processing and visualization.
2525

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

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

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

113113
The current stable Rust compiler and the three most recent minor versions before
114114
it will always be supported. For example, if the current stable compiler version
115-
is 1.56, the minimum supported version will not be increased past 1.46, three
115+
is 1.57, the minimum supported version will not be increased past 1.46, three
116116
minor versions prior. Increasing the minimum supported compiler version is not
117117
considered a semver breaking change as long as doing so complies with this
118118
policy.

opentelemetry-zipkin/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Collects OpenTelemetry spans and reports them to a given Zipkin collector
44
//! endpoint. See the [Zipkin Docs] for details and deployment information.
55
//!
6-
//! *Compiler support: [requires `rustc` 1.56+][msrv]*
6+
//! *Compiler support: [requires `rustc` 1.57+][msrv]*
77
//!
88
//! [Zipkin Docs]: https://zipkin.io/
99
//! [msrv]: #supported-rust-versions
@@ -167,7 +167,7 @@
167167
//! ## Supported Rust Versions
168168
//!
169169
//! OpenTelemetry is built against the latest stable release. The minimum
170-
//! supported version is 1.56. The current OpenTelemetry version is not
170+
//! supported version is 1.57. The current OpenTelemetry version is not
171171
//! guaranteed to build on Rust versions earlier than the minimum supported
172172
//! version.
173173
//!

opentelemetry-zpages/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
keywords = ["opentelemetry", "zipkin", "tracing", "async"]
1414
license = "Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.56"
16+
rust-version = "1.57"
1717

1818
[package.metadata.docs.rs]
1919
all-features = true

opentelemetry/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ categories = [
1414
keywords = ["opentelemetry", "logging", "tracing", "metrics", "async"]
1515
license = "Apache-2.0"
1616
edition = "2021"
17-
rust-version = "1.56"
17+
rust-version = "1.57"
1818

1919
[package.metadata.docs.rs]
2020
all-features = true

opentelemetry/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
2525
can export and analyze them using [Prometheus], [Jaeger], and other
2626
observability tools.
2727

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

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

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

136136
The current stable Rust compiler and the three most recent minor versions

opentelemetry/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! services to capture distributed traces and metrics from your application. You
33
//! can analyze them using [Prometheus], [Jaeger], and other observability tools.
44
//!
5-
//! *Compiler support: [requires `rustc` 1.56+][msrv]*
5+
//! *Compiler support: [requires `rustc` 1.57+][msrv]*
66
//!
77
//! [Prometheus]: https://prometheus.io
88
//! [Jaeger]: https://www.jaegertracing.io
@@ -192,7 +192,7 @@
192192
//! ## Supported Rust Versions
193193
//!
194194
//! OpenTelemetry is built against the latest stable release. The minimum
195-
//! supported version is 1.56. The current OpenTelemetry version is not
195+
//! supported version is 1.57. The current OpenTelemetry version is not
196196
//! guaranteed to build on Rust versions earlier than the minimum supported
197197
//! version.
198198
//!

scripts/patch_dependencies.sh

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# Dashmap >= 5.3.4 requires 1.59
2-
latest_version=$(cargo search --limit 1 dashmap | head -1 | cut -d'"' -f2) &&
3-
cargo update -p dashmap:$latest_version --precise 5.1.0 &&
4-
# async-global-executor >= 2.3.0 requires 1.59
5-
latest_version=$(cargo search --limit 1 async-global-executor | head -1 | cut -d'"' -f2) &&
6-
cargo update -p async-global-executor:$latest_version --precise 2.2.0
1+
#!/bin/bash
2+
3+
function patch_version() {
4+
local latest_version=$(cargo search --limit 1 $1 | head -1 | cut -d'"' -f2)
5+
echo "patching $1 from $latest_version to $2"
6+
cargo update -p $1:$latest_version --precise $2
7+
}
8+
# Dashmap >= 5.3.4 requires rust 1.59
9+
patch_version "dashmap" "5.1.0"
10+
# async-global-executor >= 2.3.0 requires rust 1.59
11+
patch_version "async-global-executor" "2.2.0"

0 commit comments

Comments
 (0)