This is an automated email from the ASF dual-hosted git repository.

wchevreuil pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-3 by this push:
     new e2af57e4856 HBASE-29629 Record the quota user name value on metrics 
for RpcThrottlingExceptions (#7345)
e2af57e4856 is described below

commit e2af57e48566829e653af6a875da4ea8de0e375a
Author: Siddharth Khillon <[email protected]>
AuthorDate: Tue Sep 30 04:13:38 2025 -0700

    HBASE-29629 Record the quota user name value on metrics for 
RpcThrottlingExceptions (#7345)
    
    Signed-off-by: Wellington Chevreuil <[email protected]>
---
 .../src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java      | 2 +-
 .../org/apache/hadoop/hbase/quotas/RegionServerRpcQuotaManager.java   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
index 6b1585c5855..e912fe8ee15 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
@@ -229,7 +229,7 @@ public class QuotaCache implements Stoppable {
    * username
    * @param ugi The request's UserGroupInformation
    */
-  private String getQuotaUserName(final UserGroupInformation ugi) {
+  String getQuotaUserName(final UserGroupInformation ugi) {
     if (userOverrideRequestAttributeKey == null) {
       return ugi.getShortUserName();
     }
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionServerRpcQuotaManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionServerRpcQuotaManager.java
index 7a42d0f1aa3..34fc57cb081 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionServerRpcQuotaManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionServerRpcQuotaManager.java
@@ -199,7 +199,7 @@ public class RegionServerRpcQuotaManager implements 
RpcQuotaManager, Configurati
       LOG.debug("Throttling exception for user=" + ugi.getUserName() + " 
table=" + table + " scan="
         + scanRequest.getScannerId() + ": " + e.getMessage());
 
-      rsServices.getMetrics().recordThrottleException(e.getType(), 
ugi.getShortUserName(),
+      rsServices.getMetrics().recordThrottleException(e.getType(), 
quotaCache.getQuotaUserName(ugi),
         table.getNameAsString());
 
       throw e;
@@ -276,7 +276,7 @@ public class RegionServerRpcQuotaManager implements 
RpcQuotaManager, Configurati
       LOG.debug("Throttling exception for user=" + ugi.getUserName() + " 
table=" + table
         + " numWrites=" + numWrites + " numReads=" + numReads + ": " + 
e.getMessage());
 
-      rsServices.getMetrics().recordThrottleException(e.getType(), 
ugi.getShortUserName(),
+      rsServices.getMetrics().recordThrottleException(e.getType(), 
quotaCache.getQuotaUserName(ugi),
         table.getNameAsString());
 
       throw e;

Reply via email to