Skip to content

Commit

Permalink
Merge pull request #173 from github/rashiq-emit-internal-errors
Browse files Browse the repository at this point in the history
Emit internal error metrics
  • Loading branch information
rashiq authored Oct 7, 2024
2 parents 336333c + 3ef5d56 commit b3fbe7e
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 b3fbe7e

Please sign in to comment.