File tree Expand file tree Collapse file tree 6 files changed +8
-6
lines changed
opentelemetry-sdk/src/metrics
opentelemetry-stdout/src/metrics Expand file tree Collapse file tree 6 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 22
33## vNext
44
5+ - Make ` force_flush() ` in ` PushMetricExporter ` synchronous
6+
57## 0.28.0
68
79Released 2025-Feb-10
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ impl PushMetricExporter for MetricExporter {
144144 self . client . export ( metrics) . await
145145 }
146146
147- async fn force_flush ( & self ) -> OTelSdkResult {
147+ fn force_flush ( & self ) -> OTelSdkResult {
148148 // this component is stateless
149149 Ok ( ( ) )
150150 }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ pub trait PushMetricExporter: Send + Sync + 'static {
2020 ) -> impl std:: future:: Future < Output = OTelSdkResult > + Send ;
2121
2222 /// Flushes any metric data held by an exporter.
23- fn force_flush ( & self ) -> impl std :: future :: Future < Output = OTelSdkResult > + Send ;
23+ fn force_flush ( & self ) -> OTelSdkResult ;
2424
2525 /// Releases any held computational resources.
2626 ///
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ impl PushMetricExporter for InMemoryMetricExporter {
272272 . map_err ( |_| OTelSdkError :: InternalFailure ( "Failed to lock metrics" . to_string ( ) ) )
273273 }
274274
275- async fn force_flush ( & self ) -> OTelSdkResult {
275+ fn force_flush ( & self ) -> OTelSdkResult {
276276 Ok ( ( ) ) // In this implementation, flush does nothing
277277 }
278278
Original file line number Diff line number Diff line change @@ -557,7 +557,7 @@ mod tests {
557557 }
558558 }
559559
560- async fn force_flush ( & self ) -> OTelSdkResult {
560+ fn force_flush ( & self ) -> OTelSdkResult {
561561 Ok ( ( ) )
562562 }
563563
@@ -580,7 +580,7 @@ mod tests {
580580 Ok ( ( ) )
581581 }
582582
583- async fn force_flush ( & self ) -> OTelSdkResult {
583+ fn force_flush ( & self ) -> OTelSdkResult {
584584 Ok ( ( ) )
585585 }
586586
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ impl PushMetricExporter for MetricExporter {
5858 }
5959 }
6060
61- async fn force_flush ( & self ) -> OTelSdkResult {
61+ fn force_flush ( & self ) -> OTelSdkResult {
6262 // exporter holds no state, nothing to flush
6363 Ok ( ( ) )
6464 }
You can’t perform that action at this time.
0 commit comments