Skip to content

Commit f752d50

Browse files
committed
add comment
1 parent dfac978 commit f752d50

File tree

2 files changed

+12
-9
lines changed
  • opentelemetry-otlp/src/exporter/tonic
  • opentelemetry-sdk/src/export/logs

2 files changed

+12
-9
lines changed

opentelemetry-otlp/src/exporter/tonic/logs.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ impl LogExporter for TonicLogsClient {
8080

8181
let resource_logs = group_logs_by_resource_and_scope(batch, &self.resource);
8282

83-
otel_debug!(name: "TonicsLogsClient.CallingExport");
83+
otel_debug!(name: "TonicsLogsClient.CallingExport");
8484

85-
client
86-
.export(Request::from_parts(
87-
metadata,
88-
extensions,
89-
ExportLogsServiceRequest { resource_logs },
90-
))
91-
.await
92-
.map_err(crate::Error::from)?;
85+
client
86+
.export(Request::from_parts(
87+
metadata,
88+
extensions,
89+
ExportLogsServiceRequest { resource_logs },
90+
))
91+
.await
92+
.map_err(crate::Error::from)?;
9393
Ok(())
9494
}
9595
}

opentelemetry-sdk/src/export/logs/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ pub trait LogExporter: Send + Sync + Debug {
7979
/// A `LogResult<()>`, which is a result type indicating either a successful export (with
8080
/// `Ok(())`) or an error (`Err(LogError)`) if the export operation failed.
8181
///
82+
/// Note:
83+
/// The `Send` bound ensures the future can be safely moved across threads, which is crucial for multi-threaded async runtimes like Tokio.
84+
/// Explicit lifetimes (`'a`) synchronize the lifetimes of `self`, `batch`, and the returned future.
8285
fn export<'a>(
8386
&'a self,
8487
batch: &'a LogBatch<'a>,

0 commit comments

Comments
 (0)