Skip to content

Commit f203b03

Browse files
lalitbTommyCpp
andauthored
Replace unmaintained actions-rs/toolchain action. (#1655)
Co-authored-by: Zhongyang Wu <[email protected]>
1 parent d5392dc commit f203b03

File tree

24 files changed

+24
-103
lines changed

24 files changed

+24
-103
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ jobs:
2424
- uses: actions/checkout@v4
2525
with:
2626
submodules: true
27-
- uses: actions-rs/toolchain@v1
27+
- uses: dtolnay/rust-toolchain@master
2828
with:
2929
toolchain: ${{ matrix.rust }}
3030
components: rustfmt
31-
profile: minimal
31+
- name: "Set rustup profile"
32+
run: rustup set profile minimal
3233
- uses: arduino/setup-protoc@v3
3334
- name: Test
3435
run: ./scripts/test.sh
@@ -38,11 +39,9 @@ jobs:
3839
- uses: actions/checkout@v4
3940
with:
4041
submodules: true
41-
- uses: actions-rs/toolchain@v1
42+
- uses: dtolnay/rust-toolchain@stable
4243
with:
43-
toolchain: stable
4444
components: rustfmt
45-
profile: minimal
4645
- uses: arduino/setup-protoc@v3
4746
- uses: actions-rs/cargo@v1
4847
with:
@@ -57,11 +56,9 @@ jobs:
5756
runs-on: ubuntu-latest
5857
steps:
5958
- uses: actions/checkout@v4
60-
- uses: actions-rs/toolchain@v1
59+
- uses: dtolnay/rust-toolchain@nightly
6160
with:
62-
toolchain: nightly-2024-02-07
6361
components: rustfmt
64-
override: true
6562
- name: external-type-check
6663
run: |
6764
cargo install cargo-check-external-types
@@ -76,11 +73,9 @@ jobs:
7673
- uses: actions/checkout@v4
7774
with:
7875
submodules: true
79-
- uses: actions-rs/toolchain@v1
76+
- uses: dtolnay/rust-toolchain@stable
8077
with:
81-
toolchain: stable
8278
components: rustfmt
83-
profile: minimal
8479
- uses: arduino/setup-protoc@v3
8580
- name: Build
8681
run: |
@@ -92,11 +87,7 @@ jobs:
9287
- uses: actions/checkout@v4
9388
with:
9489
submodules: true
95-
- uses: actions-rs/toolchain@v1
96-
with:
97-
profile: minimal
98-
toolchain: 1.65.0
99-
override: true
90+
- uses: dtolnay/[email protected]
10091
- name: Patch dependencies versions # some dependencies bump MSRV without major version bump
10192
run: ./scripts/patch_dependencies.sh
10293
- name: Run tests
@@ -117,11 +108,9 @@ jobs:
117108
runs-on: ubuntu-latest
118109
steps:
119110
- uses: actions/checkout@v4
120-
- uses: actions-rs/toolchain@v1
111+
- uses: dtolnay/rust-toolchain@nightly
121112
with:
122-
toolchain: nightly
123113
components: rustfmt
124-
override: true
125114
- uses: arduino/setup-protoc@v3
126115
- name: doc
127116
run: cargo doc --no-deps --all-features
@@ -136,11 +125,10 @@ jobs:
136125
- uses: actions/checkout@v4
137126
with:
138127
submodules: true
139-
- uses: actions-rs/toolchain@v1
128+
- uses: dtolnay/rust-toolchain@stable
140129
with:
141130
toolchain: stable
142131
components: rustfmt,llvm-tools-preview
143-
override: true
144132
- uses: arduino/setup-protoc@v3
145133
- name: cargo install cargo-llvm-cov
146134
uses: taiki-e/install-action@cargo-llvm-cov

.github/workflows/integration_tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ jobs:
2020
- uses: actions/checkout@v4
2121
with:
2222
submodules: true
23-
- uses: actions-rs/toolchain@v1
23+
- uses: dtolnay/rust-toolchain@stable
2424
with:
25-
toolchain: stable
2625
components: rustfmt
27-
profile: minimal
2826
- uses: arduino/setup-protoc@v3
2927
- name: Run integration tests using docker compose
3028
run: ./scripts/integration_tests.sh

opentelemetry-http/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ pub trait HttpClient: Debug + Send + Sync {
6767
#[cfg(feature = "reqwest")]
6868
mod reqwest {
6969
use super::{async_trait, Bytes, HttpClient, HttpError, Request, Response};
70-
use std::convert::TryInto;
7170

7271
#[async_trait]
7372
impl HttpClient for reqwest::Client {

opentelemetry-jaeger-propagator/src/propagator.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,7 @@ impl TextMapPropagator for Propagator {
214214
#[cfg(test)]
215215
mod tests {
216216
use super::*;
217-
use opentelemetry::{
218-
propagation::{Injector, TextMapPropagator},
219-
testing::trace::TestSpan,
220-
trace::{SpanContext, SpanId, TraceContextExt, TraceFlags, TraceId, TraceState},
221-
Context,
222-
};
217+
use opentelemetry::testing::trace::TestSpan;
223218
use std::collections::HashMap;
224219

225220
const LONG_TRACE_ID_STR: &str = "000000000000004d0000000000000016";

opentelemetry-jaeger/src/exporter/config/agent.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ use std::sync::Arc;
44
use std::{env, net};
55

66
use opentelemetry::trace::TraceError;
7+
use opentelemetry_sdk::trace::{BatchConfig, Config, TracerProvider};
78
use opentelemetry_sdk::trace::{BatchSpanProcessor, Tracer};
8-
use opentelemetry_sdk::{
9-
self,
10-
trace::{BatchConfig, Config, TracerProvider},
11-
};
129

1310
use crate::exporter::agent::{AgentAsyncClientUdp, AgentSyncClientUdp};
1411
use crate::exporter::config::{

opentelemetry-jaeger/src/exporter/config/collector/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::borrow::BorrowMut;
2-
use std::convert::TryFrom;
32
use std::env;
43
use std::sync::Arc;
54
#[cfg(feature = "collector_client")]

opentelemetry-otlp/src/logs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use opentelemetry::{
1616
global,
1717
logs::{LogError, LoggerProvider},
1818
};
19-
use opentelemetry_sdk::{self, export::logs::LogData, runtime::RuntimeChannel};
19+
use opentelemetry_sdk::{export::logs::LogData, runtime::RuntimeChannel};
2020

2121
/// Compression algorithm to use, defaults to none.
2222
pub const OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: &str = "OTEL_EXPORTER_OTLP_LOGS_COMPRESSION";

opentelemetry-sdk/src/logs/log_emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ mod tests {
248248
use opentelemetry::global::{logger, set_logger_provider, shutdown_logger_provider};
249249
use opentelemetry::logs::Logger;
250250
use opentelemetry::{Key, KeyValue, Value};
251-
use std::sync::{Arc, Mutex};
251+
use std::sync::Mutex;
252252
use std::thread;
253253

254254
#[test]

opentelemetry-sdk/src/metrics/view.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ pub fn new_view(criteria: Instrument, mask: Stream) -> Result<Box<dyn View>> {
177177
#[cfg(test)]
178178
mod tests {
179179
use super::*;
180-
use crate::metrics::Instrument;
181180
#[test]
182181
fn test_new_view_matching_all() {
183182
let criteria = Instrument::new().name("*");

opentelemetry-sdk/src/propagation/baggage.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ impl TextMapPropagator for BaggagePropagator {
155155
#[cfg(test)]
156156
mod tests {
157157
use super::*;
158-
use opentelemetry::{
159-
baggage::BaggageMetadata, propagation::TextMapPropagator, Key, KeyValue, StringValue, Value,
160-
};
158+
use opentelemetry::{baggage::BaggageMetadata, Key, KeyValue, StringValue, Value};
161159
use std::collections::HashMap;
162160

163161
#[rustfmt::skip]

opentelemetry-sdk/src/propagation/trace_context.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,7 @@ impl TextMapPropagator for TraceContextPropagator {
154154
mod tests {
155155
use super::*;
156156
use crate::testing::trace::TestSpan;
157-
use opentelemetry::{
158-
propagation::{Extractor, Injector, TextMapPropagator},
159-
trace::{SpanContext, SpanId, TraceId},
160-
};
161157
use std::collections::HashMap;
162-
use std::str::FromStr;
163158

164159
#[rustfmt::skip]
165160
fn extract_data() -> Vec<(&'static str, &'static str, SpanContext)> {

opentelemetry-sdk/src/resource/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,6 @@ pub trait ResourceDetector {
259259
#[cfg(test)]
260260
mod tests {
261261
use super::*;
262-
use crate::resource::EnvResourceDetector;
263-
use std::collections::HashMap;
264262
use std::time;
265263

266264
#[test]

opentelemetry-sdk/src/trace/sampler.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use opentelemetry::{
44
},
55
Context, KeyValue,
66
};
7-
use std::convert::TryInto;
87

98
#[cfg(feature = "jaeger_remote_sampler")]
109
mod jaeger_remote;
@@ -250,8 +249,7 @@ pub(crate) fn sample_based_on_probability(prob: &f64, trace_id: TraceId) -> Samp
250249
mod tests {
251250
use super::*;
252251
use crate::testing::trace::TestSpan;
253-
use crate::trace::{Sampler, ShouldSample};
254-
use opentelemetry::trace::{SamplingDecision, SpanContext, SpanId, TraceFlags, TraceState};
252+
use opentelemetry::trace::{SpanContext, SpanId, TraceFlags};
255253
use rand::Rng;
256254

257255
#[rustfmt::skip]

opentelemetry-sdk/src/trace/span.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ mod tests {
283283
DEFAULT_MAX_ATTRIBUTES_PER_SPAN, DEFAULT_MAX_EVENT_PER_SPAN, DEFAULT_MAX_LINKS_PER_SPAN,
284284
};
285285
use crate::trace::{SpanEvents, SpanLinks};
286-
use opentelemetry::trace::{self, Link, SpanBuilder, TraceFlags, TraceId, Tracer};
287-
use opentelemetry::{trace::Span as _, trace::TracerProvider, KeyValue};
286+
use opentelemetry::trace::{self, SpanBuilder, TraceFlags, TraceId, Tracer};
287+
use opentelemetry::{trace::Span as _, trace::TracerProvider};
288288
use std::time::Duration;
289289
use std::vec;
290290

opentelemetry-zipkin/src/propagator/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,7 @@ impl TextMapPropagator for Propagator {
306306
#[cfg(test)]
307307
mod tests {
308308
use super::*;
309-
use opentelemetry::{
310-
propagation::TextMapPropagator,
311-
testing::trace::TestSpan,
312-
trace::{SpanContext, SpanId, TraceFlags, TraceId},
313-
};
309+
use opentelemetry::testing::trace::TestSpan;
314310
use std::collections::HashMap;
315311

316312
const TRACE_ID_STR: &str = "4bf92f3577b34da6a3ce929d0e0e4736";

opentelemetry/src/baggage.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use crate::{Context, Key, KeyValue, Value};
1818
use once_cell::sync::Lazy;
1919
use std::collections::{hash_map, HashMap};
2020
use std::fmt;
21-
use std::iter::FromIterator;
2221

2322
static DEFAULT_BAGGAGE: Lazy<Baggage> = Lazy::new(Baggage::default);
2423

opentelemetry/src/metrics/instruments/counter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use crate::{
33
KeyValue,
44
};
55
use core::fmt;
6+
use std::any::Any;
67
use std::sync::Arc;
7-
use std::{any::Any, convert::TryFrom};
88

99
/// An SDK implemented instrument that records increasing values.
1010
pub trait SyncCounter<T> {

opentelemetry/src/metrics/instruments/gauge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use crate::{
33
KeyValue,
44
};
55
use core::fmt;
6+
use std::any::Any;
67
use std::sync::Arc;
7-
use std::{any::Any, convert::TryFrom};
88

99
/// An SDK implemented instrument that records independent values
1010
pub trait SyncGauge<T> {

opentelemetry/src/metrics/instruments/histogram.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::{
33
KeyValue,
44
};
55
use core::fmt;
6-
use std::convert::TryFrom;
76
use std::sync::Arc;
87

98
/// An SDK implemented instrument that records a distribution of values.

opentelemetry/src/metrics/instruments/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::KeyValue;
33
use core::fmt;
44
use std::any::Any;
55
use std::borrow::Cow;
6-
use std::convert::TryFrom;
76
use std::marker;
87
use std::sync::Arc;
98

opentelemetry/src/metrics/instruments/up_down_counter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use crate::{
33
KeyValue,
44
};
55
use core::fmt;
6+
use std::any::Any;
67
use std::sync::Arc;
7-
use std::{any::Any, convert::TryFrom};
88

99
use super::{AsyncInstrument, AsyncInstrumentBuilder};
1010

opentelemetry/src/propagation/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ impl PropagationError {
9696
#[cfg(test)]
9797
mod tests {
9898
use super::*;
99-
use std::collections::HashMap;
10099

101100
#[test]
102101
fn hash_map_get() {

opentelemetry/src/trace/noop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl TextMapPropagator for NoopTextMapPropagator {
164164
mod tests {
165165
use super::*;
166166
use crate::testing::trace::TestSpan;
167-
use crate::trace::{self, Span, TraceState, Tracer};
167+
use crate::trace::{Span, TraceState, Tracer};
168168

169169
fn valid_span_context() -> trace::SpanContext {
170170
trace::SpanContext::new(

stress/src/logs.rs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,10 @@
11
use opentelemetry_appender_tracing::layer;
22
use opentelemetry_sdk::logs::{LogProcessor, LoggerProvider};
33
use tracing::error;
4-
use tracing_subscriber::{prelude::*, Layer};
4+
use tracing_subscriber::prelude::*;
55

66
mod throughput;
77

8-
struct NoopEventVisitor;
9-
10-
impl tracing::field::Visit for NoopEventVisitor {
11-
fn record_debug(&mut self, _field: &tracing::field::Field, _value: &dyn std::fmt::Debug) {}
12-
}
13-
14-
struct NoOpLogLayer;
15-
impl<S> Layer<S> for NoOpLogLayer
16-
where
17-
S: tracing::Subscriber,
18-
{
19-
fn on_event(
20-
&self,
21-
event: &tracing::Event<'_>,
22-
_ctx: tracing_subscriber::layer::Context<'_, S>,
23-
) {
24-
let mut visitor = NoopEventVisitor;
25-
event.record(&mut visitor);
26-
}
27-
28-
fn event_enabled(
29-
&self,
30-
_event: &tracing::Event<'_>,
31-
_ctx: tracing_subscriber::layer::Context<'_, S>,
32-
) -> bool {
33-
true
34-
}
35-
}
36-
378
#[derive(Debug)]
389
pub struct NoOpLogProcessor;
3910

@@ -67,12 +38,6 @@ fn main() {
6738
// Use the OpenTelemetryTracingBridge to test the throughput of the appender-tracing.
6839
let layer = layer::OpenTelemetryTracingBridge::new(&provider);
6940
tracing_subscriber::registry().with(layer).init();
70-
71-
// Use a "Do-Nothing" layer to test the throughput of the tracing system without
72-
// OpenTelemetry overhead. This helps measure the OpenTelemetry overhead.
73-
// let noop_layer = NoOpLogLayer;
74-
// tracing_subscriber::registry().with(noop_layer).init();
75-
7641
throughput::test_throughput(test_log);
7742
}
7843

0 commit comments

Comments
 (0)