Skip to content

Commit

Permalink
Emit internal error metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
rashiq committed Oct 4, 2024
1 parent d89b112 commit e0638e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/throttle/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ func (check *ThrottlerCheck) Check(appName string, storeType string, storeName s

metrics.GetOrRegisterCounter(fmt.Sprintf("check.any.%s.%s.error", storeType, storeName), nil).Inc(1)
metrics.GetOrRegisterCounter(fmt.Sprintf("check.%s.%s.%s.error", appName, storeType, storeName), nil).Inc(1)

if statusCode == http.StatusInternalServerError {
metrics.GetOrRegisterCounter("check.any.internal-error", nil).Inc(1)
metrics.GetOrRegisterCounter(fmt.Sprintf("check.%s.internal-error", appName), nil).Inc(1)

metrics.GetOrRegisterCounter(fmt.Sprintf("check.any.%s.%s.internal-error", storeType, storeName), nil).Inc(1)
metrics.GetOrRegisterCounter(fmt.Sprintf("check.%s.%s.%s.internal-error", appName, storeType, storeName), nil).Inc(1)
}
}

check.throttler.markRecentApp(appName, remoteAddr)
Expand Down

0 comments on commit e0638e1

Please sign in to comment.