From b4150e96a10730bbe38b31b4259a1e2d7d7919be Mon Sep 17 00:00:00 2001 From: leftmain Date: Thu, 18 Jan 2024 11:47:32 +0300 Subject: [PATCH] NBS-4842 [Disk Manager] add errors/canceled metrics for s3 (#162) * add errors/canceled * fix typo --- cloud/tasks/persistence/s3_metrics.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cloud/tasks/persistence/s3_metrics.go b/cloud/tasks/persistence/s3_metrics.go index 9cfd6378779..c931f0502e6 100644 --- a/cloud/tasks/persistence/s3_metrics.go +++ b/cloud/tasks/persistence/s3_metrics.go @@ -44,7 +44,8 @@ func (m *s3Metrics) StatCall( errorCounter := subRegistry.Counter("errors") successCounter := subRegistry.Counter("success") hangingCounter := subRegistry.Counter("hanging") - timeoutCounter := subRegistry.Counter("timeout") + timeoutCounter := subRegistry.Counter("errors/timeout") + canceledCounter := subRegistry.Counter("errors/canceled") timeHistogram := subRegistry.DurationHistogram("time", s3CallDurationBuckets()) if time.Since(start) >= m.callTimeout { @@ -72,16 +73,12 @@ func (m *s3Metrics) StatCall( errorCounter.Inc() if errors.Is(*err, context.DeadlineExceeded) { - logging.Error( - ctx, - "S3 call with name %v timed out, bucket %v, key %v", - name, - bucket, - key, - ) - timeoutCounter.Inc() } + + if errors.Is(*err, context.Canceled) { + canceledCounter.Inc() + } return }