Skip to content

Commit

Permalink
NBS-4842 [Disk Manager] add errors/canceled metrics for s3 (#162)
Browse files Browse the repository at this point in the history
* add errors/canceled

* fix typo
  • Loading branch information
leftmain authored Jan 18, 2024
1 parent a3aea5a commit b4150e9
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions cloud/tasks/persistence/s3_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit b4150e9

Please sign in to comment.