Skip to content

Commit 2d11e07

Browse files
committed
fix missing implementations
1 parent c18c006 commit 2d11e07

File tree

9 files changed

+21
-19
lines changed

9 files changed

+21
-19
lines changed

examples/tracing-http-propagator/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl LogProcessor for EnrichWithBaggageLogProcessor {
118118
});
119119
}
120120

121-
fn force_flush(&self) -> OTelSdkResult {
121+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
122122
Ok(())
123123
}
124124

opentelemetry-appender-tracing/src/layer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ const fn severity_of_level(level: &Level) -> Severity {
284284

285285
#[cfg(test)]
286286
mod tests {
287+
use std::time::Duration;
287288
use crate::layer;
288289
use opentelemetry::logs::Severity;
289290
use opentelemetry::trace::TracerProvider;
@@ -931,7 +932,7 @@ mod tests {
931932
true
932933
}
933934

934-
fn force_flush(&self) -> OTelSdkResult {
935+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
935936
Ok(())
936937
}
937938

opentelemetry-proto/src/transform/logs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ pub mod tonic {
221221

222222
#[cfg(test)]
223223
mod tests {
224+
use std::time::Duration;
224225
use crate::transform::common::tonic::ResourceAttributesWithSchema;
225226
use opentelemetry::logs::LogRecord as _;
226227
use opentelemetry::logs::Logger;
@@ -238,7 +239,7 @@ mod tests {
238239
impl LogProcessor for MockProcessor {
239240
fn emit(&self, _record: &mut SdkLogRecord, _instrumentation: &InstrumentationScope) {}
240241

241-
fn force_flush(&self) -> OTelSdkResult {
242+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
242243
Ok(())
243244
}
244245

opentelemetry-sdk/src/logs/concurrent_log_processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl<T: LogExporter> LogProcessor for SimpleConcurrentLogProcessor<T> {
3737
}
3838
}
3939

40-
fn force_flush(&self) -> OTelSdkResult {
40+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
4141
// TODO: invoke flush on exporter
4242
// once https://github.com/open-telemetry/opentelemetry-rust/issues/2261
4343
// is resolved

opentelemetry-sdk/src/logs/log_processor.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ pub trait LogProcessor: Send + Sync + Debug {
5353
/// - `instrumentation`: The instrumentation scope associated with the log record.
5454
fn emit(&self, data: &mut SdkLogRecord, instrumentation: &InstrumentationScope);
5555
/// Force the logs lying in the cache to be exported.
56-
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
57-
Ok(())
58-
}
56+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult;
5957
/// Force the logs lying in the cache to be exported with default timeout.
6058
fn force_flush(&self) -> OTelSdkResult {
6159
self.force_flush_with_timeout(Duration::from_secs(5))
@@ -109,6 +107,7 @@ pub(crate) mod tests {
109107
use opentelemetry::logs::{Logger, LoggerProvider};
110108
use opentelemetry::{InstrumentationScope, Key};
111109
use std::sync::{Arc, Mutex};
110+
use std::time::Duration;
112111

113112
#[derive(Debug, Clone)]
114113
pub(crate) struct MockLogExporter {
@@ -158,7 +157,7 @@ pub(crate) mod tests {
158157
.push((record.clone(), instrumentation.clone())); //clone as the LogProcessor is storing the data.
159158
}
160159

161-
fn force_flush(&self) -> OTelSdkResult {
160+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
162161
Ok(())
163162
}
164163

@@ -188,7 +187,7 @@ pub(crate) mod tests {
188187
.push((record.clone(), instrumentation.clone()));
189188
}
190189

191-
fn force_flush(&self) -> OTelSdkResult {
190+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
192191
Ok(())
193192
}
194193

opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<R: RuntimeChannel> LogProcessor for BatchLogProcessor<R> {
7676
}
7777
}
7878

79-
fn force_flush(&self) -> OTelSdkResult {
79+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
8080
let (res_sender, res_receiver) = oneshot::channel();
8181
self.message_sender
8282
.try_send(BatchMessage::Flush(Some(res_sender)))
@@ -625,7 +625,7 @@ mod tests {
625625
.push((record.clone(), instrumentation.clone())); //clone as the LogProcessor is storing the data.
626626
}
627627

628-
fn force_flush(&self) -> OTelSdkResult {
628+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
629629
Ok(())
630630
}
631631

@@ -655,7 +655,7 @@ mod tests {
655655
.push((record.clone(), instrumentation.clone()));
656656
}
657657

658-
fn force_flush(&self) -> OTelSdkResult {
658+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
659659
Ok(())
660660
}
661661

opentelemetry-sdk/src/logs/logger_provider.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ mod tests {
345345
.expect("lock poisoned");
346346
}
347347

348-
fn force_flush(&self) -> OTelSdkResult {
348+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
349349
Ok(())
350350
}
351351

@@ -398,7 +398,7 @@ mod tests {
398398
// nothing to do.
399399
}
400400

401-
fn force_flush(&self) -> OTelSdkResult {
401+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
402402
Ok(())
403403
}
404404

@@ -918,7 +918,7 @@ mod tests {
918918
// nothing to do.
919919
}
920920

921-
fn force_flush(&self) -> OTelSdkResult {
921+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
922922
*self.flush_called.lock().unwrap() = true;
923923
Ok(())
924924
}
@@ -949,7 +949,7 @@ mod tests {
949949
// nothing to do
950950
}
951951

952-
fn force_flush(&self) -> OTelSdkResult {
952+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
953953
*self.flush_called.lock().unwrap() = true;
954954
Ok(())
955955
}

opentelemetry-sdk/src/logs/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ mod tests {
4646
use std::borrow::Borrow;
4747
use std::collections::HashMap;
4848
use std::sync::{Arc, Mutex};
49+
use std::time::Duration;
4950

5051
#[test]
5152
fn logging_sdk_test() {
@@ -167,7 +168,7 @@ mod tests {
167168
});
168169
}
169170

170-
fn force_flush(&self) -> crate::error::OTelSdkResult {
171+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
171172
Ok(())
172173
}
173174

@@ -273,7 +274,7 @@ mod tests {
273274
}
274275
}
275276

276-
fn force_flush(&self) -> OTelSdkResult {
277+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
277278
Ok(())
278279
}
279280

opentelemetry-sdk/src/logs/simple_log_processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<T: LogExporter> LogProcessor for SimpleLogProcessor<T> {
113113
}
114114
}
115115

116-
fn force_flush(&self) -> OTelSdkResult {
116+
fn force_flush_with_timeout(&self, _timeout: Duration) -> OTelSdkResult {
117117
Ok(())
118118
}
119119

0 commit comments

Comments
 (0)