Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions opentelemetry-otlp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## vNext

- Make `force_flush()` in `PushMetricExporter` synchronous

## 0.28.0

Released 2025-Feb-10
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/src/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
self.client.export(metrics).await
}

async fn force_flush(&self) -> OTelSdkResult {
fn force_flush(&self) -> OTelSdkResult {

Check warning on line 147 in opentelemetry-otlp/src/metric.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-otlp/src/metric.rs#L147

Added line #L147 was not covered by tests
// this component is stateless
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/metrics/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub trait PushMetricExporter: Send + Sync + 'static {
) -> impl std::future::Future<Output = OTelSdkResult> + Send;

/// Flushes any metric data held by an exporter.
fn force_flush(&self) -> impl std::future::Future<Output = OTelSdkResult> + Send;
fn force_flush(&self) -> OTelSdkResult;

/// Releases any held computational resources.
///
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/metrics/in_memory_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
.map_err(|_| OTelSdkError::InternalFailure("Failed to lock metrics".to_string()))
}

async fn force_flush(&self) -> OTelSdkResult {
fn force_flush(&self) -> OTelSdkResult {

Check warning on line 275 in opentelemetry-sdk/src/metrics/in_memory_exporter.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/metrics/in_memory_exporter.rs#L275

Added line #L275 was not covered by tests
Ok(()) // In this implementation, flush does nothing
}

Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-sdk/src/metrics/periodic_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@
}
}

async fn force_flush(&self) -> OTelSdkResult {
fn force_flush(&self) -> OTelSdkResult {

Check warning on line 560 in opentelemetry-sdk/src/metrics/periodic_reader.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/metrics/periodic_reader.rs#L560

Added line #L560 was not covered by tests
Ok(())
}

Expand All @@ -580,7 +580,7 @@
Ok(())
}

async fn force_flush(&self) -> OTelSdkResult {
fn force_flush(&self) -> OTelSdkResult {

Check warning on line 583 in opentelemetry-sdk/src/metrics/periodic_reader.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/metrics/periodic_reader.rs#L583

Added line #L583 was not covered by tests
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-stdout/src/metrics/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
}

async fn force_flush(&self) -> OTelSdkResult {
fn force_flush(&self) -> OTelSdkResult {

Check warning on line 61 in opentelemetry-stdout/src/metrics/exporter.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stdout/src/metrics/exporter.rs#L61

Added line #L61 was not covered by tests
// exporter holds no state, nothing to flush
Ok(())
}
Expand Down
Loading