Skip to content

Commit

Permalink
Distinguish between system and account ratelimit in metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mooselumph committed Apr 2, 2024
1 parent 3d9fff2 commit 1947b61
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions disperser/apiserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,13 @@ func (s *DispersalServer) checkRateLimitsAndAddRatesToHeader(ctx context.Context
s.metrics.HandleInternalFailureRpcRequest(apiMethodName)
return api.NewInternalError("failed to cast limiterInfo")
}
s.metrics.HandleSystemRateLimitedRpcRequest(apiMethodName)
s.metrics.HandleSystemRateLimitedRequest(fmt.Sprint(info.QuorumID), blobSize, apiMethodName)
if info.RateType == SystemThroughputType || info.RateType == SystemBlobRateType {
s.metrics.HandleSystemRateLimitedRpcRequest(apiMethodName)
s.metrics.HandleSystemRateLimitedRequest(fmt.Sprint(info.QuorumID), blobSize, apiMethodName)
} else if info.RateType == AccountThroughputType || info.RateType == AccountBlobRateType {
s.metrics.HandleAccountRateLimitedRpcRequest(apiMethodName)
s.metrics.HandleAccountRateLimitedRequest(fmt.Sprint(info.QuorumID), blobSize, apiMethodName)
}
errorString := fmt.Sprintf("request ratelimited: %s for quorum %d", info.RateType.String(), info.QuorumID)
return api.NewResourceExhaustedError(errorString)
}
Expand Down

0 comments on commit 1947b61

Please sign in to comment.