Skip to content

Commit 01dd231

Browse files
committed
Merge branch 'set_instrumentation_scope' of github.com:lalitb/opentelemetry-rust into set_instrumentation_scope
2 parents 64a4077 + da5a284 commit 01dd231

File tree

6 files changed

+88
-39
lines changed

6 files changed

+88
-39
lines changed

.github/workflows/ci.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,21 @@ jobs:
101101
msrv:
102102
strategy:
103103
matrix:
104-
os: [ windows-latest, ubuntu-latest ]
104+
os: [windows-latest, ubuntu-latest]
105+
rust: [1.65.0, 1.70.0]
105106
runs-on: ${{ matrix.os }}
106107
steps:
107-
- uses: actions/checkout@v4
108-
with:
109-
submodules: true
110-
- uses: dtolnay/rust-toolchain@1.65.0
111-
- name: Patch dependencies versions # some dependencies bump MSRV without major version bump
112-
run: bash ./scripts/patch_dependencies.sh
113-
- name: Check MSRV for all crates
114-
run: bash ./scripts/msrv.sh
108+
- uses: actions/checkout@v4
109+
with:
110+
submodules: true
111+
- name: Set up Rust ${{ matrix.rust }}
112+
uses: dtolnay/rust-toolchain@master
113+
with:
114+
toolchain: ${{ matrix.rust }}
115+
- name: Patch dependencies versions
116+
run: bash ./scripts/patch_dependencies.sh
117+
- name: Check MSRV for all crates
118+
run: bash ./scripts/msrv.sh ${{ matrix.rust }}
115119
cargo-deny:
116120
runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux
117121
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci

opentelemetry-proto/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## vNext
44

5+
- Bump MSRV to 1.70 [1864](https://github.com/open-telemetry/opentelemetry-rust/pull/1874)
6+
57
## v0.6.0
68

79
- Update protobuf definitions to v1.3.1 [#1721](https://github.com/open-telemetry/opentelemetry-rust/pull/1721)

opentelemetry-proto/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.65"
16+
rust-version = "1.70"
1717
autotests = false
1818

1919
[lib]

opentelemetry-proto/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
# OpenTelemetry Proto
66
This crate contains generated files from [opentelemetry-proto](https://github.com/open-telemetry/opentelemetry-proto)
77
repository and transformation between types from generated files and types defined in [opentelemetry](https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry).
8+
9+
10+
*Compiler support: [requires `rustc` 1.70+]

scripts/msrv.sh

+52-29
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,55 @@
22

33
set -eu
44

5-
echo "Running msrv check for opentelemetry package"
6-
cargo check --manifest-path=opentelemetry/Cargo.toml --all-features
7-
8-
echo "Running msrv check for opentelemetry-sdk package"
9-
cargo check --manifest-path=opentelemetry-sdk/Cargo.toml --all-features
10-
11-
echo "Running msrv check for opentelemetry-stdout package"
12-
cargo check --manifest-path=opentelemetry-stdout/Cargo.toml --all-features
13-
14-
# TODO: Ignoring as this is failing with the following error:
15-
# error: package `prost-derive v0.12.6` cannot be built because it requires rustc 1.70 or newer, while the currently active rustc version is 1.65.0
16-
#echo "Running msrv check for opentelemetry-otlp package"
17-
# cargo check --manifest-path=opentelemetry-otlp/Cargo.toml --all-features
18-
19-
echo "Running msrv check for opentelemetry-http package"
20-
cargo check --manifest-path=opentelemetry-http/Cargo.toml --all-features
21-
22-
echo "Running msrv check for opentelemetry-jaeger-propagator package"
23-
cargo check --manifest-path=opentelemetry-jaeger-propagator/Cargo.toml --all-features
24-
25-
echo "Running msrv check for opentelemetry-zipkin package"
26-
cargo check --manifest-path=opentelemetry-zipkin/Cargo.toml --all-features
27-
28-
echo "Running msrv check for opentelemetry-appender-log package"
29-
cargo check --manifest-path=opentelemetry-appender-log/Cargo.toml --all-features
30-
31-
echo "Running msrv check for opentelemetry-appender-tracing package"
32-
cargo check --manifest-path=opentelemetry-appender-tracing/Cargo.toml --all-features
33-
5+
# Check if a version is specified as parameter
6+
if [ $# -eq 0 ]; then
7+
echo "No Rust version specified. Usage: $0 <rust-version>"
8+
exit 1
9+
fi
10+
11+
RUST_VERSION=$1
12+
13+
# Determine the directory containing the script
14+
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
15+
16+
# Path to the configuration file
17+
CONFIG_FILE="$SCRIPT_DIR/msrv_config.json"
18+
19+
# Change to the root directory of the repository
20+
cd "$SCRIPT_DIR/.."
21+
22+
echo "Current working directory: $(pwd)"
23+
24+
# function to check if specified toolchain is installed
25+
check_rust_toolchain_installed() {
26+
local version=$1
27+
if ! rustup toolchain list | grep -q "$version"; then
28+
echo "Rust toolchain $version is not installed. Please install it using 'rustup toolchain install $version'."
29+
exit 1
30+
fi
31+
}
32+
33+
# check if specified toolchain is installed
34+
check_rust_toolchain_installed "$RUST_VERSION"
35+
36+
# Extract the exact installed rust version string
37+
installed_version=$(rustup toolchain list | grep "$RUST_VERSION" | awk '{print $1}')
38+
39+
# Read the configuration file and get the packages for the specified version
40+
if [ -f "$CONFIG_FILE" ]; then
41+
packages=$(jq -r --arg version "$RUST_VERSION" '.[$version] | .[]' "$CONFIG_FILE" | tr '\n' ' ')
42+
if [ -z "$packages" ]; then
43+
echo "No packages found for Rust version $RUST_VERSION in the configuration file."
44+
exit 1
45+
fi
46+
else
47+
echo "Configuration file $CONFIG_FILE not found."
48+
exit 1
49+
fi
50+
51+
# Check MSRV for the packages
52+
for package in $packages; do
53+
package=$(echo "$package" | tr -d '\r\n') # Remove any newline and carriage return characters
54+
echo "Command: rustup run \"$installed_version\" cargo check --manifest-path=\"$package\" --all-features"
55+
rustup run "$installed_version" cargo check --manifest-path=$package --all-features
56+
done

scripts/msrv_config.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"1.65.0": [
3+
"opentelemetry/Cargo.toml",
4+
"opentelemetry-sdk/Cargo.toml",
5+
"opentelemetry-stdout/Cargo.toml",
6+
"opentelemetry-http/Cargo.toml",
7+
"opentelemetry-jaeger-propagator/Cargo.toml",
8+
"opentelemetry-zipkin/Cargo.toml",
9+
"opentelemetry-appender-log/Cargo.toml",
10+
"opentelemetry-appender-tracing/Cargo.toml"
11+
],
12+
"1.70.0": [
13+
"opentelemetry-otlp/Cargo.toml",
14+
"opentelemetry-proto/Cargo.toml"
15+
]
16+
}
17+

0 commit comments

Comments
 (0)