diff --git a/pkg/vm/engine/tae/rpc/handle.go b/pkg/vm/engine/tae/rpc/handle.go index d2dc24428456c..c00c93c6c730f 100644 --- a/pkg/vm/engine/tae/rpc/handle.go +++ b/pkg/vm/engine/tae/rpc/handle.go @@ -1269,7 +1269,9 @@ func (h *Handle) HandleStorageUsage(ctx context.Context, meta txn.TxnMeta, memo := h.db.GetUsageMemo() start := time.Now() - defer v2.TaskStorageUsageReqDurationHistogram.Observe(time.Since(start).Seconds()) + defer func() { + v2.TaskStorageUsageReqDurationHistogram.Observe(time.Since(start).Seconds()) + }() memo.EnterProcessing() defer func() {