Skip to content

Commit 08cf765

Browse files
sidkhilloncharlesconnell
authored andcommitted
HubSpot Backport HBASE-29629 Record the quota user name value on metrics for RpcThrottlingExceptions (apache#7345) (#208)
Signed-off-by: Wellington Chevreuil <[email protected]>
1 parent f0c5cb9 commit 08cf765

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ protected boolean isExceedThrottleQuotaEnabled() {
228228
* username
229229
* @param ugi The request's UserGroupInformation
230230
*/
231-
private String getQuotaUserName(final UserGroupInformation ugi) {
231+
String getQuotaUserName(final UserGroupInformation ugi) {
232232
if (userOverrideRequestAttributeKey == null) {
233233
return ugi.getShortUserName();
234234
}

hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionServerRpcQuotaManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public OperationQuota checkScanQuota(final Region region,
199199
LOG.debug("Throttling exception for user=" + ugi.getUserName() + " table=" + table + " scan="
200200
+ scanRequest.getScannerId() + ": " + e.getMessage());
201201

202-
rsServices.getMetrics().recordThrottleException(e.getType(), ugi.getShortUserName(),
202+
rsServices.getMetrics().recordThrottleException(e.getType(), quotaCache.getQuotaUserName(ugi),
203203
table.getNameAsString());
204204

205205
throw e;
@@ -276,7 +276,7 @@ public OperationQuota checkBatchQuota(final Region region, final int numWrites,
276276
LOG.debug("Throttling exception for user=" + ugi.getUserName() + " table=" + table
277277
+ " numWrites=" + numWrites + " numReads=" + numReads + ": " + e.getMessage());
278278

279-
rsServices.getMetrics().recordThrottleException(e.getType(), ugi.getShortUserName(),
279+
rsServices.getMetrics().recordThrottleException(e.getType(), quotaCache.getQuotaUserName(ugi),
280280
table.getNameAsString());
281281

282282
throw e;

0 commit comments

Comments
 (0)