You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by ko...@apache.org on 2026/03/24 04:51:53 UTC

(opendal) branch main updated: fix(observability): Fix executing operation gauge decrement on error (#7267)

This is an automated email from the ASF dual-hosted git repository.

koushiro pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 195a7931b fix(observability): Fix executing operation gauge decrement on error (#7267)
195a7931b is described below

commit 195a7931b61a350863c31c37e004d1e48b9e3449
Author: dentiny <de...@gmail.com>
AuthorDate: Mon Mar 23 21:51:46 2026 -0700

    fix(observability): Fix executing operation gauge decrement on error (#7267)
---
 core/layers/observe-metrics-common/src/lib.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/core/layers/observe-metrics-common/src/lib.rs b/core/layers/observe-metrics-common/src/lib.rs
index 2ac677ea0..f805ffde3 100644
--- a/core/layers/observe-metrics-common/src/lib.rs
+++ b/core/layers/observe-metrics-common/src/lib.rs
@@ -672,6 +672,8 @@ impl<A: Access, I: MetricsIntercept> LayeredAccess for MetricsAccessor<A, I> {
                     labels.clone().with_error(err.kind()),
                     MetricValue::OperationErrorsTotal,
                 );
+                self.interceptor
+                    .observe(labels.clone(), MetricValue::OperationExecuting(-1));
             })?;
 
         Ok((
@@ -693,6 +695,8 @@ impl<A: Access, I: MetricsIntercept> LayeredAccess for MetricsAccessor<A, I> {
                 labels.clone().with_error(err.kind()),
                 MetricValue::OperationErrorsTotal,
             );
+            self.interceptor
+                .observe(labels.clone(), MetricValue::OperationExecuting(-1));
         })?;
 
         Ok((
@@ -804,6 +808,8 @@ impl<A: Access, I: MetricsIntercept> LayeredAccess for MetricsAccessor<A, I> {
                 labels.clone().with_error(err.kind()),
                 MetricValue::OperationErrorsTotal,
             );
+            self.interceptor
+                .observe(labels.clone(), MetricValue::OperationExecuting(-1));
         })?;
 
         Ok((
@@ -825,6 +831,8 @@ impl<A: Access, I: MetricsIntercept> LayeredAccess for MetricsAccessor<A, I> {
                 labels.clone().with_error(err.kind()),
                 MetricValue::OperationErrorsTotal,
             );
+            self.interceptor
+                .observe(labels.clone(), MetricValue::OperationExecuting(-1));
         })?;
 
         Ok((