Skip to content

Commit 5013311

Browse files
authored
Merge branch 'main' into modify-batchProcessor-test-use-flush-instead-of-sleeptime
2 parents b1f51d9 + 6648d74 commit 5013311

File tree

5 files changed

+37
-45
lines changed

5 files changed

+37
-45
lines changed

opentelemetry-sdk/CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,37 @@
22

33
## vNext
44

5-
- Calls to `MeterProviderBuilder::with_resource`, `TracerProviderBuilder::with_resource`,
5+
- Calls to `MeterProviderBuilder::with_resource`, `TracerProviderBuilder::with_resource`,
66
`LoggerProviderBuilder::with_resource` are now additive ([#2677](https://github.com/open-telemetry/opentelemetry-rust/pull/2677)).
7-
- *Breaking*: Make `force_flush()` in `PushMetricExporter` synchronous
87
- Moved `ExportError` trait from `opentelemetry::trace::ExportError` to `opentelemetry_sdk::export::ExportError`
98
- Moved `TraceError` enum from `opentelemetry::trace::TraceError` to `opentelemetry_sdk::trace::TraceError`
109
- Moved `TraceResult` type alias from `opentelemetry::trace::TraceResult` to `opentelemetry_sdk::trace::TraceResult`
10+
- *Breaking*: Make `force_flush()` in `PushMetricExporter` synchronous
11+
- **Breaking Change:** Updated the `SpanExporter` trait method signature:
12+
13+
```rust
14+
fn export(&mut self, batch: Vec<SpanData>) -> BoxFuture<'static, OTelSdkResult>;
15+
```
16+
17+
to
18+
19+
```rust
20+
fn export(
21+
&mut self,
22+
batch: Vec<SpanData>,
23+
) -> impl std::future::Future<Output = OTelSdkResult> + Send;
24+
```
25+
26+
This affects anyone who writes custom exporters, as custom implementations of SpanExporter
27+
should now define export as an `async fn`:
28+
29+
```rust
30+
impl trace::SpanExporter for CustomExporter {
31+
async fn export(&mut self, batch: Vec<trace::SpanData>) -> OTelSdkResult {
32+
// Implementation here
33+
}
34+
}
35+
```
1136

1237
## 0.28.0
1338

opentelemetry-sdk/src/logs/log_processor.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,8 @@ pub(crate) mod tests {
8888
}
8989

9090
impl LogExporter for MockLogExporter {
91-
#[allow(clippy::manual_async_fn)]
92-
fn export(
93-
&self,
94-
_batch: LogBatch<'_>,
95-
) -> impl std::future::Future<Output = OTelSdkResult> + Send {
96-
async { Ok(()) }
91+
async fn export(&self, _batch: LogBatch<'_>) -> OTelSdkResult {
92+
Ok(())
9793
}
9894

9995
fn shutdown(&mut self) -> OTelSdkResult {

opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,8 @@ mod tests {
317317
}
318318

319319
impl LogExporter for MockLogExporter {
320-
#[allow(clippy::manual_async_fn)]
321-
fn export(
322-
&self,
323-
_batch: LogBatch<'_>,
324-
) -> impl std::future::Future<Output = OTelSdkResult> + Send {
325-
async { Ok(()) }
320+
async fn export(&self, _batch: LogBatch<'_>) -> OTelSdkResult {
321+
Ok(())
326322
}
327323

328324
fn shutdown(&mut self) -> OTelSdkResult {

opentelemetry-sdk/src/logs/simple_log_processor.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,14 @@ mod tests {
168168
}
169169

170170
impl LogExporter for LogExporterThatRequiresTokio {
171-
#[allow(clippy::manual_async_fn)]
172-
fn export(
173-
&self,
174-
batch: LogBatch<'_>,
175-
) -> impl std::future::Future<Output = OTelSdkResult> + Send {
171+
async fn export(&self, batch: LogBatch<'_>) -> OTelSdkResult {
176172
// Simulate minimal dependency on tokio by sleeping asynchronously for a short duration
177-
async move {
178-
tokio::time::sleep(Duration::from_millis(50)).await;
173+
tokio::time::sleep(Duration::from_millis(50)).await;
179174

180-
for _ in batch.iter() {
181-
self.export_count.fetch_add(1, Ordering::Acquire);
182-
}
183-
Ok(())
175+
for _ in batch.iter() {
176+
self.export_count.fetch_add(1, Ordering::Acquire);
184177
}
178+
Ok(())
185179
}
186180
}
187181

opentelemetry/CHANGELOG.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,10 @@
22

33
## vNext
44

5-
- **Breaking Change:** Updated the `SpanExporter` trait method signature:
6-
```rust
7-
fn export(&mut self, batch: Vec<SpanData>) -> BoxFuture<'static, OTelSdkResult>;
8-
```
9-
to
10-
```rust
11-
fn export(
12-
&mut self,
13-
batch: Vec<SpanData>,
14-
) -> impl std::future::Future<Output = OTelSdkResult> + Send;
15-
```
16-
This affects the exporter devs, as custom implementations of SpanExporter
17-
should now define export as an `async fn`:
18-
```rust
19-
impl trace::SpanExporter for CustomExporter {
20-
async fn export(&mut self, batch: Vec<trace::SpanData>) -> OTelSdkResult {
21-
// Implementation here
22-
}
23-
}
24-
```
255
- *Breaking* Moved `ExportError` trait from `opentelemetry::trace::ExportError` to `opentelemetry_sdk::export::ExportError`
266
- *Breaking* Moved `TraceError` enum from `opentelemetry::trace::TraceError` to `opentelemetry_sdk::trace::TraceError`
277
- *Breaking* Moved `TraceResult` type alias from `opentelemetry::trace::TraceResult` to `opentelemetry_sdk::trace::TraceResult`
8+
- {PLACEHOLDER} - Remove the above completely. // TODO fill this when changes are actually in.
289

2910
## 0.28.0
3011

0 commit comments

Comments
 (0)