Skip to content

Commit edab145

Browse files
authored
Reduce various info logs to debug (#2700)
1 parent bc5e6ce commit edab145

File tree

5 files changed

+27
-29
lines changed

5 files changed

+27
-29
lines changed

opentelemetry-sdk/CHANGELOG.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,21 @@
3636

3737
- **Breaking** The SpanExporter::export() method no longer requires a mutable reference to self.
3838
Before:
39-
4039
```rust
41-
async fn export(&mut self, batch: Vec<SpanData>) -> OTelSdkResult
40+
async fn export(&mut self, batch: Vec<SpanData>) -> OTelSdkResult
4241
```
43-
4442
After:
45-
4643
```rust
47-
async fn export(&self, batch: Vec<SpanData>) -> OTelSdkResult
44+
async fn export(&self, batch: Vec<SpanData>) -> OTelSdkResult
4845
```
4946

5047
Custom exporters will need to internally synchronize any mutable state, if applicable.
5148

5249
- Bug Fix: `BatchLogProcessor` now correctly calls `shutdown` on the exporter
5350
when its `shutdown` is invoked.
5451

52+
- Reduced some info level logs to debug
53+
5554
## 0.28.0
5655

5756
Released 2025-Feb-10
@@ -93,7 +92,7 @@ field as metadata, a feature introduced in version 0.1.40.
9392
- `Resource::{new,empty,from_detectors,new_with_defaults,from_schema_url,merge,default}`.
9493
To create Resources you should only use `Resource::builder()` or `Resource::builder_empty()`. See
9594
[#2322](https://github.com/open-telemetry/opentelemetry-rust/pull/2322) for a migration guide.
96-
95+
9796
Example Usage:
9897

9998
```rust
@@ -181,7 +180,7 @@ field as metadata, a feature introduced in version 0.1.40.
181180
- Does not support `hyper`, `reqwest` HTTP Clients
182181
- Does not support multiple concurrent exports (`with_max_concurrent_exports`
183182
is not supported). This existed only for traces.
184-
183+
185184
If this applies to you, you can get the old behavior back by following steps
186185
below:
187186
- Enable one or more of the feature flag from below
@@ -249,7 +248,7 @@ limit.
249248
- *Breaking*: Rename namespaces for InMemoryExporters. (The module is still
250249
under "testing" feature flag)
251250
before:
252-
251+
253252
```rust
254253
opentelemetry_sdk::testing::logs::{InMemoryLogExporter,
255254
InMemoryLogExporterBuilder};
@@ -260,7 +259,7 @@ limit.
260259
```
261260

262261
now:
263-
262+
264263
```rust
265264
opentelemetry_sdk::logs::{InMemoryLogExporter, InMemoryLogExporterBuilder};
266265
opentelemetry_sdk::trace::{InMemorySpanExporter,

opentelemetry-sdk/src/logs/batch_log_processor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::{
2323
};
2424
use std::sync::mpsc::{self, RecvTimeoutError, SyncSender};
2525

26-
use opentelemetry::{otel_debug, otel_error, otel_info, otel_warn, InstrumentationScope};
26+
use opentelemetry::{otel_debug, otel_error, otel_warn, InstrumentationScope};
2727

2828
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
2929
use std::{cmp::min, env, sync::Mutex};
@@ -342,7 +342,7 @@ impl BatchLogProcessor {
342342
let handle = thread::Builder::new()
343343
.name("OpenTelemetry.Logs.BatchProcessor".to_string())
344344
.spawn(move || {
345-
otel_info!(
345+
otel_debug!(
346346
name: "BatchLogProcessor.ThreadStarted",
347347
interval_in_millisecs = config.scheduled_delay.as_millis(),
348348
max_export_batch_size = config.max_export_batch_size,
@@ -476,7 +476,7 @@ impl BatchLogProcessor {
476476
}
477477
}
478478
}
479-
otel_info!(
479+
otel_debug!(
480480
name: "BatchLogProcessor.ThreadStopped"
481481
);
482482
})

opentelemetry-sdk/src/metrics/meter_provider.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl SdkMeterProvider {
110110
/// There is no guaranteed that all telemetry be flushed or all resources have
111111
/// been released on error.
112112
pub fn shutdown(&self) -> OTelSdkResult {
113-
otel_info!(
113+
otel_debug!(
114114
name: "MeterProvider.Shutdown",
115115
message = "User initiated shutdown of MeterProvider."
116116
);
@@ -164,7 +164,7 @@ impl Drop for SdkMeterProviderInner {
164164
reason = format!("{}", err)
165165
);
166166
} else {
167-
otel_info!(
167+
otel_debug!(
168168
name: "MeterProvider.Drop.ShutdownCompleted",
169169
);
170170
}
@@ -310,7 +310,7 @@ impl MeterProviderBuilder {
310310
}),
311311
};
312312

313-
otel_info!(
313+
otel_debug!(
314314
name: "MeterProvider.Built",
315315
);
316316
meter_provider

opentelemetry-sdk/src/metrics/periodic_reader.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<E: PushMetricExporter> PeriodicReader<E> {
160160
.spawn(move || {
161161
let mut interval_start = Instant::now();
162162
let mut remaining_interval = interval;
163-
otel_info!(
163+
otel_debug!(
164164
name: "PeriodReaderThreadStarted",
165165
interval_in_millisecs = interval.as_millis(),
166166
);
@@ -190,16 +190,16 @@ impl<E: PushMetricExporter> PeriodicReader<E> {
190190

191191
if export_result.is_err() {
192192
if response_sender.send(false).is_err() {
193-
otel_info!(
193+
otel_debug!(
194194
name: "PeriodReader.Flush.ResponseSendError",
195-
message = "PeriodicReader's flush has failed, but unable to send this info back to caller.
195+
message = "PeriodicReader's flush has failed, but unable to send this info back to caller.
196196
This occurs when the caller has timed out waiting for the response. If you see this occuring frequently, consider increasing the flush timeout."
197197
);
198198
}
199199
} else if response_sender.send(true).is_err() {
200-
otel_info!(
200+
otel_debug!(
201201
name: "PeriodReader.Flush.ResponseSendError",
202-
message = "PeriodicReader's flush has completed successfully, but unable to send this info back to caller.
202+
message = "PeriodicReader's flush has completed successfully, but unable to send this info back to caller.
203203
This occurs when the caller has timed out waiting for the response. If you see this occuring frequently, consider increasing the flush timeout."
204204
);
205205
}
@@ -253,14 +253,14 @@ impl<E: PushMetricExporter> PeriodicReader<E> {
253253
if response_sender.send(false).is_err() {
254254
otel_info!(
255255
name: "PeriodReaderThreadShutdown.ResponseSendError",
256-
message = "PeriodicReader's shutdown has failed, but unable to send this info back to caller.
256+
message = "PeriodicReader's shutdown has failed, but unable to send this info back to caller.
257257
This occurs when the caller has timed out waiting for the response. If you see this occuring frequently, consider increasing the shutdown timeout."
258258
);
259259
}
260260
} else if response_sender.send(true).is_err() {
261-
otel_info!(
261+
otel_debug!(
262262
name: "PeriodReaderThreadShutdown.ResponseSendError",
263-
message = "PeriodicReader completed its shutdown, but unable to send this info back to caller.
263+
message = "PeriodicReader completed its shutdown, but unable to send this info back to caller.
264264
This occurs when the caller has timed out waiting for the response. If you see this occuring frequently, consider increasing the shutdown timeout."
265265
);
266266
}
@@ -312,7 +312,7 @@ impl<E: PushMetricExporter> PeriodicReader<E> {
312312
}
313313
}
314314
}
315-
otel_info!(
315+
otel_debug!(
316316
name: "PeriodReaderThreadStopped"
317317
);
318318
});
@@ -499,7 +499,7 @@ impl<E: PushMetricExporter> MetricReader for PeriodicReader<E> {
499499
/// This function SHOULD be obtained from the exporter.
500500
///
501501
/// If not configured, the Cumulative temporality SHOULD be used.
502-
///
502+
///
503503
/// [metric-reader]: https://github.com/open-telemetry/opentelemetry-specification/blob/0a78571045ca1dca48621c9648ec3c832c3c541c/specification/metrics/sdk.md#metricreader
504504
fn temporality(&self, kind: InstrumentKind) -> Temporality {
505505
kind.temporality_preference(self.inner.temporality(kind))

opentelemetry-sdk/src/trace/span_processor.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ use crate::resource::Resource;
3939
use crate::trace::Span;
4040
use crate::trace::{SpanData, SpanExporter};
4141
use opentelemetry::Context;
42-
use opentelemetry::{otel_debug, otel_warn};
43-
use opentelemetry::{otel_error, otel_info};
42+
use opentelemetry::{otel_debug, otel_error, otel_warn};
4443
use std::cmp::min;
4544
use std::sync::atomic::{AtomicUsize, Ordering};
4645
use std::sync::{Arc, Mutex};
@@ -317,7 +316,7 @@ impl BatchSpanProcessor {
317316
let handle = thread::Builder::new()
318317
.name("OpenTelemetry.Traces.BatchProcessor".to_string())
319318
.spawn(move || {
320-
otel_info!(
319+
otel_debug!(
321320
name: "BatchSpanProcessor.ThreadStarted",
322321
interval_in_millisecs = config.scheduled_delay.as_millis(),
323322
max_export_batch_size = config.max_export_batch_size,
@@ -413,7 +412,7 @@ impl BatchSpanProcessor {
413412
}
414413
}
415414
}
416-
otel_info!(
415+
otel_debug!(
417416
name: "BatchSpanProcessor.ThreadStopped"
418417
);
419418
})

0 commit comments

Comments
 (0)