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

kharekartik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 77a5672f6c Update metric rules to emit database as a label (#12739)
77a5672f6c is described below

commit 77a5672f6c42fe1e536230875a92ef4f27310e02
Author: Shounak kulkarni <[email protected]>
AuthorDate: Fri Apr 5 11:37:22 2024 +0500

    Update metric rules to emit database as a label (#12739)
---
 .../jmx_prometheus_javaagent/configs/broker.yml    | 227 ++++---
 .../configs/controller.yml                         | 289 +++++----
 .../jmx_prometheus_javaagent/configs/minion.yml    |  36 +-
 .../etc/jmx_prometheus_javaagent/configs/pinot.yml | 665 ++++++++++++---------
 .../jmx_prometheus_javaagent/configs/server.yml    | 223 +++----
 5 files changed, 829 insertions(+), 611 deletions(-)

diff --git 
a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/broker.yml 
b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/broker.yml
index ef2ab9f153..ce5e5df7b9 100644
--- a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/broker.yml
+++ b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/broker.yml
@@ -1,76 +1,90 @@
 rules:
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?).authorization\"><>(\\w+)"
-  name: "pinot_broker_authorization_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?).authorization\"><>(\\w+)"
+  name: "pinot_broker_authorization_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.documentsScanned\"><>(\\w+)"
-  name: "pinot_broker_documentsScanned_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.documentsScanned\"><>(\\w+)"
+  name: "pinot_broker_documentsScanned_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.entriesScannedInFilter\"><>(\\w+)"
-  name: "pinot_broker_entriesScannedInFilter_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.entriesScannedInFilter\"><>(\\w+)"
+  name: "pinot_broker_entriesScannedInFilter_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.entriesScannedPostFilter\"><>(\\w+)"
-  name: "pinot_broker_entriesScannedPostFilter_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.entriesScannedPostFilter\"><>(\\w+)"
+  name: "pinot_broker_entriesScannedPostFilter_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.freshnessLagMs\"><>(\\w+)"
-  name: "pinot_broker_freshnessLagMs_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.freshnessLagMs\"><>(\\w+)"
+  name: "pinot_broker_freshnessLagMs_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queries\"><>(\\w+)"
-  name: "pinot_broker_queries_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queries\"><>(\\w+)"
+  name: "pinot_broker_queries_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queryExecution\"><>(\\w+)"
-  name: "pinot_broker_queryExecution_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryExecution\"><>(\\w+)"
+  name: "pinot_broker_queryExecution_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queryRouting\"><>(\\w+)"
-  name: "pinot_broker_queryRouting_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryRouting\"><>(\\w+)"
+  name: "pinot_broker_queryRouting_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.reduce\"><>(\\w+)"
-  name: "pinot_broker_reduce_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.reduce\"><>(\\w+)"
+  name: "pinot_broker_reduce_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.requestCompilation\"><>(\\w+)"
-  name: "pinot_broker_requestCompilation_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.requestCompilation\"><>(\\w+)"
+  name: "pinot_broker_requestCompilation_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.scatterGather\"><>(\\w+)"
-  name: "pinot_broker_scatterGather_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.scatterGather\"><>(\\w+)"
+  name: "pinot_broker_scatterGather_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.totalServerResponseSize\"><>(\\w+)"
-  name: "pinot_broker_totalServerResponseSize_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.totalServerResponseSize\"><>(\\w+)"
+  name: "pinot_broker_totalServerResponseSize_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)_(OFFLINE|REALTIME).groupBySize\"><>(\\w+)"
-  name: "pinot_broker_groupBySize_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).groupBySize\"><>(\\w+)"
+  name: "pinot_broker_groupBySize_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)_(OFFLINE|REALTIME).noServingHostForSegment\"><>(\\w+)"
-  name: "pinot_broker_noServingHostForSegment_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).noServingHostForSegment\"><>(\\w+)"
+  name: "pinot_broker_noServingHostForSegment_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.healthcheck(\\w+)\"><>(\\w+)"
   name: "pinot_broker_healthcheck_$1_$2"
   cache: true
@@ -98,57 +112,67 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.routingTableUpdateTime\"><>(\\w+)"
   name: "pinot_broker_routingTableUpdateTime_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.brokerResponsesWithPartialServersResponded\"><>(\\w+)"
-  name: "pinot_broker_brokerResponsesWithPartialServersResponded_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithPartialServersResponded\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithPartialServersResponded_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.brokerResponsesWithTimeouts\"><>(\\w+)"
-  name: "pinot_broker_brokerResponsesWithTimeouts_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithTimeouts\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithTimeouts_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.noServerFoundExceptions\"><>(\\w+)"
-  name: "pinot_broker_noServerFoundExceptions_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.noServerFoundExceptions\"><>(\\w+)"
+  name: "pinot_broker_noServerFoundExceptions_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.brokerResponsesWithProcessingExceptions\"><>(\\w+)"
-  name: "pinot_broker_brokerResponsesWithProcessingExceptions_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithProcessingExceptions\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithProcessingExceptions_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.brokerResponsesWithNumGroupsLimitReached\"><>(\\w+)"
-  name: "pinot_broker_brokerResponsesWithNumGroupsLimitReached_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithNumGroupsLimitReached\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithNumGroupsLimitReached_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queryQuotaExceeded\"><>(\\w+)"
-  name: "pinot_broker_queryQuotaExceeded_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryQuotaExceeded\"><>(\\w+)"
+  name: "pinot_broker_queryQuotaExceeded_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queryTotalTimeMs\"><>(\\w+)"
-  name: "pinot_broker_queryTotalTimeMs_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryTotalTimeMs\"><>(\\w+)"
+  name: "pinot_broker_queryTotalTimeMs_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)_(OFFLINE|REALTIME).serverMissingForRouting\"><>(\\w+)"
-  name: "pinot_broker_serverMissingForRouting_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).serverMissingForRouting\"><>(\\w+)"
+  name: "pinot_broker_serverMissingForRouting_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.deserialization\"><>(\\w+)"
-  name: "pinot_broker_deserialization_$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.deserialization\"><>(\\w+)"
+  name: "pinot_broker_deserialization_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.requestConnectionWait\"><>(\\w+)"
-  name: "pinot_broker_requestConnectionWait_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.requestConnectionWait\"><>(\\w+)"
+  name: "pinot_broker_requestConnectionWait_$4"
   cache: true
   labels:
-    table: "$1"
+    database: "$2"
+    table: "$1$3"
 - pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.version\\.(\\w+)\"?><>(\\w+)"
   name: "pinot_$1_version"
   cache: true
@@ -157,43 +181,48 @@ rules:
 
   ## Metrics that fit the catch-all patterns above should not be added to this 
file.
   ## In case a metric does not fit the catch-all patterns, add them before 
this comment
-  # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without kafka topic
-  # Patterns after this line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$4_$5"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\d+)\"?><>(\\w+)"
+  name: "pinot_$1_$2_$8"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$2_$6"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
+    partition: "$7"
+  # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without kafka topic
+  # Patterns after this line may be skipped.
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$6_$7"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
-    partition: "$5"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
   #when there is no partition in the metric
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\\"?><>(\\w+)"
-  name: "pinot_$1_$2_$5"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\\"?><>(\\w+)"
+  name: "pinot_$1_$2_$7"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
   #This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix that also contain kafka topic
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$2_$7"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$2_$9"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
-    topic: "$5"
-    partition: "$6"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
+    topic: "$7"
+    partition: "$8"
   # This is a catch-all pattern for pinot table metrics. Patterns after this 
line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$3_$4"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$5_$6"
   cache: true
   labels:
-    table: "$2"
+    database: "$3"
+    table: "$2$4"
   # This is a catch-all pattern for pinot controller metrics not related to 
tables. Patterns after this line may be skipped.
 - pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
   name: "pinot_$1_$2_$3"
diff --git 
a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/controller.yml 
b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/controller.yml
index 45ff802de3..44b07d1718 100644
--- a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/controller.yml
+++ b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/controller.yml
@@ -8,54 +8,62 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.helixZookeeperReconnects\"><>(\\w+)"
   name: "pinot_controller_helix_ZookeeperReconnects_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.idealstateZnodeSize.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_idealstateZnodeSize_$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.idealstateZnodeSize.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_idealstateZnodeSize_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.idealstateZnodeByteSize.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_idealstateZnodeByteSize_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.idealstateZnodeByteSize.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_idealstateZnodeByteSize_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.replicationFromConfig.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_replicationFromConfig_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.replicationFromConfig.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_replicationFromConfig_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.numberOfReplicas.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_numberOfReplicas_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.numberOfReplicas.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_numberOfReplicas_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.percentOfReplicas.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_percentOfReplicas_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.percentOfReplicas.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_percentOfReplicas_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.percentSegmentsAvailable.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_percentSegmentsAvailable_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.percentSegmentsAvailable.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_percentSegmentsAvailable_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.segmentCount.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_segmentCount_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.segmentCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_segmentCount_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.segmentsInErrorState.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_segmentsInErrorState_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.segmentsInErrorState.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_segmentsInErrorState_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.numberSegmentUploadTimeoutExceeded\"><>(\\w+)"
   name: "pinot_controller_numberSegmentUploadTimeoutExceeded_$1"
   cache: true
@@ -77,128 +85,146 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.offlineTableCount\"><>(\\w+)"
   name: "pinot_controller_offlineTableCount_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ValidationMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_validateion_$2_$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ValidationMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_validateion_$4_$5"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.cronSchedulerJobScheduled.([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_cronSchedulerJobScheduled_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.cronSchedulerJobScheduled.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_cronSchedulerJobScheduled_$5"
   cache: true
   labels:
-    table: "$1"
-    taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+).cronSchedulerJobTriggered\"><>(\\w+)"
-  name: "pinot_controller_cronSchedulerJobTriggered_$3"
+    database: "$2"
+    table: "$1$3"
+    taskType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+).cronSchedulerJobTriggered\"><>(\\w+)"
+  name: "pinot_controller_cronSchedulerJobTriggered_$5"
   cache: true
   labels:
-    table: "$1"
-    taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+).cronSchedulerJobSkipped\"><>(\\w+)"
-  name: "pinot_controller_cronSchedulerJobSkipped_$3"
+    database: "$2"
+    table: "$1$3"
+    taskType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+).cronSchedulerJobSkipped\"><>(\\w+)"
+  name: "pinot_controller_cronSchedulerJobSkipped_$5"
   cache: true
   labels:
-    table: "$1"
-    taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+).cronSchedulerJobExecutionTimeMs\"><>(\\w+)"
-  name: "pinot_controller_cronSchedulerJobExecutionTimeMs_$3"
+    database: "$2"
+    table: "$1$3"
+    taskType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+).cronSchedulerJobExecutionTimeMs\"><>(\\w+)"
+  name: "pinot_controller_cronSchedulerJobExecutionTimeMs_$5"
   cache: true
   labels:
-    table: "$1"
-    taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+).tableRebalanceExecutionTimeMs\"><>(\\w+)"
-  name: "pinot_controller_tableRebalanceExecutionTimeMs_$3"
+    database: "$2"
+    table: "$1$3"
+    taskType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+).tableRebalanceExecutionTimeMs\"><>(\\w+)"
+  name: "pinot_controller_tableRebalanceExecutionTimeMs_$5"
   cache: true
   labels:
-    table: "$1"
-    result: "$2"
+    database: "$2"
+    table: "$1$3"
+    result: "$4"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.taskStatus.([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
   name: "pinot_controller_taskStatus_$3"
   cache: true
   labels:
     taskType: "$1"
     status: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.timeMsSinceLastMinionTaskMetadataUpdate.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_timeMsSinceLastMinionTaskMetadataUpdate_$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.timeMsSinceLastMinionTaskMetadataUpdate.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_timeMsSinceLastMinionTaskMetadataUpdate_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    taskType: "$3"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(numMinionSubtasksRunning|numMinionSubtasksWaiting|numMinionSubtasksError|percentMinionSubtasksInQueue|percentMinionSubtasksInError).([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_$1_$5"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    taskType: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(numMinionSubtasksRunning|numMinionSubtasksWaiting|numMinionSubtasksError|percentMinionSubtasksInQueue|percentMinionSubtasksInError).(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_$1_$7"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
-    taskType: "$4"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
+    taskType: "$6"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(numMinionTasksInProgress|numMinionSubtasksRunning|numMinionSubtasksWaiting|numMinionSubtasksError|percentMinionSubtasksInQueue|percentMinionSubtasksInError).(\\w+)\"><>(\\w+)"
   name: "pinot_controller_$1_$3"
   cache: true
   labels:
     taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.timeMsSinceLastSuccessfulMinionTaskGeneration.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_timeMsSinceLastSuccessfulMinionTaskGeneration_$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.timeMsSinceLastSuccessfulMinionTaskGeneration.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_timeMsSinceLastSuccessfulMinionTaskGeneration_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    taskType: "$3"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.lastMinionTaskGenerationEncountersError.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_lastMinionTaskGenerationEncountersError_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    taskType: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.lastMinionTaskGenerationEncountersError.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_lastMinionTaskGenerationEncountersError_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    taskType: "$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    taskType: "$5"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.pinotLeadControllerResourceEnabled\"><>(\\w+)"
   name: "pinot_controller_pinotLeadControllerResourceEnabled_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.offlineTableEstimatedSize.([^\\.]*?)\"><>(\\w+)"
-  name: "pinot_controller_offlineTableEstimatedSize_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.offlineTableEstimatedSize.(([^\\.]+)\\.)?([^\\.]*?)\"><>(\\w+)"
+  name: "pinot_controller_offlineTableEstimatedSize_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableQuota.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableQuota_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableQuota.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableQuota_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)_(OFFLINE|REALTIME).(\\w+).periodicTaskError\"><>(\\w+)"
-  name: "pinot_controller_periodicTaskError_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+).periodicTaskError\"><>(\\w+)"
+  name: "pinot_controller_periodicTaskError_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    periodicTask: "$3"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableStorageQuotaUtilization.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableStorageQuotaUtilization_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    periodicTask: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableStorageQuotaUtilization.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableStorageQuotaUtilization_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableStorageEstMissingSegmentPercent.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableStorageEstMissingSegmentPercent_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableStorageEstMissingSegmentPercent.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableStorageEstMissingSegmentPercent_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableTotalSizeOnServer.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableTotalSizeOnServer_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableTotalSizeOnServer.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableTotalSizeOnServer_$5"
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableSizePerReplicaOnServer.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableSizePerReplicaOnServer_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableSizePerReplicaOnServer.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableSizePerReplicaOnServer_$5"
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableCompressedSize.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableCompressedSize_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableCompressedSize.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableCompressedSize_$5"
   labels:
-    table: "$1"
-    tableType: "$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
 - pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.version\\.(\\w+)\"?><>(\\w+)"
   name: "pinot_$1_version"
   cache: true
@@ -209,41 +235,46 @@ rules:
   ## In case a metric does not fit the catch-all patterns, add them before 
this comment
   # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without kafka topic
   # Patterns after this line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$4_$5"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\d+)\"?><>(\\w+)"
+  name: "pinot_$1_$2_$8"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$2_$6"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
+    partition: "$7"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$6_$7"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
-    partition: "$5"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
   #This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix that also contain kafka topic
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$2_$7"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$2_$9"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
-    topic: "$5"
-    partition: "$6"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
+    topic: "$7"
+    partition: "$8"
   #when there is no partition in the metric
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\\"?><>(\\w+)"
-  name: "pinot_$1_$2_$5"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\\"?><>(\\w+)"
+  name: "pinot_$1_$2_$7"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
   # This is a catch-all pattern for pinot table metrics. Patterns after this 
line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$3_$4"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$5_$6"
   cache: true
   labels:
-    table: "$2"
+    database: "$3"
+    table: "$2$4"
   # This is a catch-all pattern for pinot controller metrics not related to 
tables. Patterns after this line may be skipped.
 - pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
   name: "pinot_$1_$2_$3"
diff --git 
a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/minion.yml 
b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/minion.yml
index 584cde5963..3541cc8f36 100644
--- a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/minion.yml
+++ b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/minion.yml
@@ -4,19 +4,21 @@ rules:
   cache: true
   labels:
     version: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.numberOfTasks.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_minion_numberOfTasks_$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.numberOfTasks.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_minion_numberOfTasks_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.([^\\.]*?)_(OFFLINE|REALTIME).(\\w+).(taskExecution|taskQueueing|numberTasks|numberTasksExecuted|numberTasksCompleted|numberTasksCancelled|numberTasksFailed|numberTasksFatalFailed)\"><>(\\w+)"
-  name: "pinot_minion_$4_$5"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+).(taskExecution|taskQueueing|numberTasks|numberTasksExecuted|numberTasksCompleted|numberTasksCancelled|numberTasksFailed|numberTasksFatalFailed)\"><>(\\w+)"
+  name: "pinot_minion_$6_$7"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    taskType: "$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    taskType: "$5"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.(\\w+)\"><>(\\w+)"
   name: "pinot_minion_$1_$2"
   cache: true
@@ -36,18 +38,20 @@ rules:
 
   # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix.
   # Patterns after this line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$4_$5"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$6_$7"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
   # This is a catch-all pattern for pinot table metrics. Patterns after this 
line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$3_$4"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$5_$6"
   cache: true
   labels:
-    table: "$2"
+    database: "$3"
+    table: "$2$4"
   # This is a catch-all pattern for pinot controller metrics not related to 
tables. Patterns after this line may be skipped.
 - pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
   name: "pinot_$1_$2_$3"
diff --git a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml 
b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml
index 6fc787cee9..2739fb557d 100644
--- a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml
+++ b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml
@@ -14,48 +14,62 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.helixZookeeperReconnects\"><>(\\w+)"
   name: "pinot_controller_helix_ZookeeperReconnects_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.idealstateZnodeSize.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_idealstateZnodeSize_$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.idealstateZnodeSize.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_idealstateZnodeSize_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.idealstateZnodeByteSize.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_idealstateZnodeByteSize_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.idealstateZnodeByteSize.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_idealstateZnodeByteSize_$5"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.replicationFromConfig.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_replicationFromConfig_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.numberOfReplicas.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_numberOfReplicas_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.numberOfReplicas.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_numberOfReplicas_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.percentOfReplicas.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_percentOfReplicas_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.percentOfReplicas.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_percentOfReplicas_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.percentSegmentsAvailable.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_percentSegmentsAvailable_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.percentSegmentsAvailable.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_percentSegmentsAvailable_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.segmentCount.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_segmentCount_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.segmentCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_segmentCount_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.segmentsInErrorState.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_segmentsInErrorState_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.segmentsInErrorState.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_segmentsInErrorState_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.numberSegmentUploadTimeoutExceeded\"><>(\\w+)"
   name: "pinot_controller_numberSegmentUploadTimeoutExceeded_$1"
   cache: true
@@ -77,205 +91,246 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.offlineTableCount\"><>(\\w+)"
   name: "pinot_controller_offlineTableCount_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ValidationMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_validateion_$2_$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ValidationMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_validateion_$4_$5"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.cronSchedulerJobScheduled.([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_cronSchedulerJobScheduled_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.cronSchedulerJobScheduled.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_cronSchedulerJobScheduled_$5"
   cache: true
   labels:
-    table: "$1"
-    taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+).cronSchedulerJobTriggered\"><>(\\w+)"
-  name: "pinot_controller_cronSchedulerJobTriggered_$3"
+    database: "$2"
+    table: "$1$3"
+    taskType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+).cronSchedulerJobTriggered\"><>(\\w+)"
+  name: "pinot_controller_cronSchedulerJobTriggered_$5"
   cache: true
   labels:
-    table: "$1"
-    taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+).cronSchedulerJobSkipped\"><>(\\w+)"
-  name: "pinot_controller_cronSchedulerJobSkipped_$3"
+    database: "$2"
+    table: "$1$3"
+    taskType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+).cronSchedulerJobSkipped\"><>(\\w+)"
+  name: "pinot_controller_cronSchedulerJobSkipped_$5"
   cache: true
   labels:
-    table: "$1"
-    taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+).cronSchedulerJobExecutionTimeMs\"><>(\\w+)"
-  name: "pinot_controller_cronSchedulerJobExecutionTimeMs_$3"
+    database: "$2"
+    table: "$1$3"
+    taskType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+).cronSchedulerJobExecutionTimeMs\"><>(\\w+)"
+  name: "pinot_controller_cronSchedulerJobExecutionTimeMs_$5"
   cache: true
   labels:
-    table: "$1"
-    taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.([^\\.]*?)\\.(\\w+).tableRebalanceExecutionTimeMs\"><>(\\w+)"
-  name: "pinot_controller_tableRebalanceExecutionTimeMs_$3"
+    database: "$2"
+    table: "$1$3"
+    taskType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)\\.(\\w+).tableRebalanceExecutionTimeMs\"><>(\\w+)"
+  name: "pinot_controller_tableRebalanceExecutionTimeMs_$5"
   cache: true
   labels:
-    table: "$1"
-    result: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.taskStatus.(\\w+)\\.(\\w+)\"><>(\\w+)"
+    database: "$2"
+    table: "$1$3"
+    result: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.taskStatus.([^\\.]*?)\\.(\\w+)\"><>(\\w+)"
   name: "pinot_controller_taskStatus_$3"
   cache: true
   labels:
     taskType: "$1"
     status: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.timeMsSinceLastMinionTaskMetadataUpdate.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_timeMsSinceLastMinionTaskMetadataUpdate_$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.timeMsSinceLastMinionTaskMetadataUpdate.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_timeMsSinceLastMinionTaskMetadataUpdate_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    taskType: "$3"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(numMinionSubtasksRunning|numMinionSubtasksWaiting|numMinionSubtasksError|percentMinionSubtasksInQueue|percentMinionSubtasksInError).([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_$1_$5"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    taskType: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(numMinionSubtasksRunning|numMinionSubtasksWaiting|numMinionSubtasksError|percentMinionSubtasksInQueue|percentMinionSubtasksInError).(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_$1_$7"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
-    taskType: "$4"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
+    taskType: "$6"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(numMinionTasksInProgress|numMinionSubtasksRunning|numMinionSubtasksWaiting|numMinionSubtasksError|percentMinionSubtasksInQueue|percentMinionSubtasksInError).(\\w+)\"><>(\\w+)"
   name: "pinot_controller_$1_$3"
   cache: true
   labels:
     taskType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.timeMsSinceLastSuccessfulMinionTaskGeneration.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_timeMsSinceLastSuccessfulMinionTaskGeneration_$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.timeMsSinceLastSuccessfulMinionTaskGeneration.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_timeMsSinceLastSuccessfulMinionTaskGeneration_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    taskType: "$3"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.lastMinionTaskGenerationEncountersError.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_controller_lastMinionTaskGenerationEncountersError_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    taskType: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.lastMinionTaskGenerationEncountersError.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_controller_lastMinionTaskGenerationEncountersError_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    taskType: "$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    taskType: "$5"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.pinotLeadControllerResourceEnabled\"><>(\\w+)"
   name: "pinot_controller_pinotLeadControllerResourceEnabled_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.offlineTableEstimatedSize.([^\\.]*?)\"><>(\\w+)"
-  name: "pinot_controller_offlineTableEstimatedSize_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.offlineTableEstimatedSize.(([^\\.]+)\\.)?([^\\.]*?)\"><>(\\w+)"
+  name: "pinot_controller_offlineTableEstimatedSize_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.largestSegmentSizeOnServer.([^\\.]*?)\"><>(\\w+)"
-  name: "pinot_controller_largestSegmentSizeOnServer_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.largestSegmentSizeOnServer.(([^\\.]+)\\.)?([^\\.]*?)\"><>(\\w+)"
+  name: "pinot_controller_largestSegmentSizeOnServer_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableTotalSizeOnServer.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableTotalSizeOnServer_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableTotalSizeOnServer.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableTotalSizeOnServer_$5"
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableSizePerReplicaOnServer.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableSizePerReplicaOnServer_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableSizePerReplicaOnServer.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableSizePerReplicaOnServer_$5"
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableCompressedSize.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableCompressedSize_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableCompressedSize.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableCompressedSize_$5"
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableQuota.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableQuota_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableQuota.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableQuota_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableStorageQuotaUtilization.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableStorageQuotaUtilization_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+).periodicTaskError\"><>(\\w+)"
+  name: "pinot_controller_periodicTaskError_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableStorageEstMissingSegmentPercent.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_controller_tableStorageEstMissingSegmentPercent_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    periodicTask: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableStorageQuotaUtilization.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableStorageQuotaUtilization_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", 
name=\"pinot.controller.tableStorageEstMissingSegmentPercent.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_controller_tableStorageEstMissingSegmentPercent_$5"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
 
   # Pinot Broker
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?).authorization\"><>(\\w+)"
-  name: "pinot_broker_authorization_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?).authorization\"><>(\\w+)"
+  name: "pinot_broker_authorization_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.documentsScanned\"><>(\\w+)"
-  name: "pinot_broker_documentsScanned_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.documentsScanned\"><>(\\w+)"
+  name: "pinot_broker_documentsScanned_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.entriesScannedInFilter\"><>(\\w+)"
-  name: "pinot_broker_entriesScannedInFilter_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.entriesScannedInFilter\"><>(\\w+)"
+  name: "pinot_broker_entriesScannedInFilter_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.entriesScannedPostFilter\"><>(\\w+)"
-  name: "pinot_broker_entriesScannedPostFilter_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.entriesScannedPostFilter\"><>(\\w+)"
+  name: "pinot_broker_entriesScannedPostFilter_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.freshnessLagMs\"><>(\\w+)"
-  name: "pinot_broker_freshnessLagMs_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.freshnessLagMs\"><>(\\w+)"
+  name: "pinot_broker_freshnessLagMs_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queries\"><>(\\w+)"
-  name: "pinot_broker_queries_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queries\"><>(\\w+)"
+  name: "pinot_broker_queries_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queryExecution\"><>(\\w+)"
-  name: "pinot_broker_queryExecution_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryExecution\"><>(\\w+)"
+  name: "pinot_broker_queryExecution_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queryRouting\"><>(\\w+)"
-  name: "pinot_broker_queryRouting_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryRouting\"><>(\\w+)"
+  name: "pinot_broker_queryRouting_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queryTotalTimeMs\"><>(\\w+)"
-  name: "pinot_broker_queryTotalTimeMs_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryTotalTimeMs\"><>(\\w+)"
+  name: "pinot_broker_queryTotalTimeMs_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.reduce\"><>(\\w+)"
-  name: "pinot_broker_reduce_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.reduce\"><>(\\w+)"
+  name: "pinot_broker_reduce_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.requestCompilation\"><>(\\w+)"
-  name: "pinot_broker_requestCompilation_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.requestCompilation\"><>(\\w+)"
+  name: "pinot_broker_requestCompilation_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.scatterGather\"><>(\\w+)"
-  name: "pinot_broker_scatterGather_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.scatterGather\"><>(\\w+)"
+  name: "pinot_broker_scatterGather_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.totalServerResponseSize\"><>(\\w+)"
-  name: "pinot_broker_totalServerResponseSize_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.totalServerResponseSize\"><>(\\w+)"
+  name: "pinot_broker_totalServerResponseSize_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)_(OFFLINE|REALTIME).groupBySize\"><>(\\w+)"
-  name: "pinot_broker_groupBySize_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).groupBySize\"><>(\\w+)"
+  name: "pinot_broker_groupBySize_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)_(OFFLINE|REALTIME).noServingHostForSegment\"><>(\\w+)"
-  name: "pinot_broker_noServingHostForSegment_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).noServingHostForSegment\"><>(\\w+)"
+  name: "pinot_broker_noServingHostForSegment_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.healthcheck(\\w+)\"><>(\\w+)"
   name: "pinot_broker_healthcheck_$1_$2"
   cache: true
@@ -303,111 +358,150 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.routingTableUpdateTime\"><>(\\w+)"
   name: "pinot_broker_routingTableUpdateTime_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.brokerResponsesWithPartialServersResponded\"><>(\\w+)"
-  name: "pinot_broker_brokerResponsesWithPartialServersResponded_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithPartialServersResponded\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithPartialServersResponded_$4"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithProcessingExceptions\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithProcessingExceptions_$4"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithNumGroupsLimitReached\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithNumGroupsLimitReached_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.brokerResponsesWithProcessingExceptions\"><>(\\w+)"
-  name: "pinot_broker_brokerResponsesWithProcessingExceptions_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryQuotaExceeded\"><>(\\w+)"
+  name: "pinot_broker_queryQuotaExceeded_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.brokerResponsesWithNumGroupsLimitReached\"><>(\\w+)"
-  name: "pinot_broker_brokerResponsesWithNumGroupsLimitReached_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).serverMissingForRouting\"><>(\\w+)"
+  name: "pinot_broker_serverMissingForRouting_$5"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.deserialization\"><>(\\w+)"
+  name: "pinot_broker_deserialization_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.queryQuotaExceeded\"><>(\\w+)"
-  name: "pinot_broker_queryQuotaExceeded_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.requestConnectionWait\"><>(\\w+)"
+  name: "pinot_broker_requestConnectionWait_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)_(OFFLINE|REALTIME).serverMissingForRouting\"><>(\\w+)"
-  name: "pinot_broker_serverMissingForRouting_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithTimeouts\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithTimeouts_$4"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.deserialization\"><>(\\w+)"
-  name: "pinot_broker_deserialization_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.noServerFoundExceptions\"><>(\\w+)"
+  name: "pinot_broker_noServerFoundExceptions_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.([^\\.]*?)\\.requestConnectionWait\"><>(\\w+)"
-  name: "pinot_broker_requestConnectionWait_$2"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.brokerResponsesWithProcessingExceptions\"><>(\\w+)"
+  name: "pinot_broker_brokerResponsesWithProcessingExceptions_$4"
   cache: true
   labels:
-    table: "$1"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", 
name=\"pinot.broker.(([^\\.]+)\\.)?([^\\.]*?)\\.queryTotalTimeMs\"><>(\\w+)"
+  name: "pinot_broker_queryTotalTimeMs_$4"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
 
 # Pinot Server
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.documentCount.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_server_documentCount_$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.documentCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_server_documentCount_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.segmentCount.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_server_segmentCount_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.segmentCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_server_segmentCount_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_server_$3_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_server_$5_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+).realtimeRowsConsumed\"><>(\\w+)"
-  name: "pinot_server_realtimeRowsConsumed_$5"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+).(invalidRealtimeRowsDropped|incompleteRealtimeRowsConsumed|rowsWithErrors|realtimeRowsConsumed|realtimeRowsFetched|streamConsumerCreateExceptions)\"><>(\\w+)"
+  name: "pinot_server_$7_$8"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    topic: "$3"
-    partition: "$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    topic: "$5"
+    partition: "$6"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.helix.connected\"><>(\\w+)"
   name: "pinot_server_helix_connected_$1"
   cache: true
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.helixZookeeperReconnects\"><>(\\w+)"
   name: "pinot_server_helix_zookeeperReconnects_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.highestKafkaOffsetConsumed.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
-  name: "pinot_server_highestKafkaOffsetConsumed_$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.highestKafkaOffsetConsumed.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
+  name: "pinot_server_highestKafkaOffsetConsumed_$7"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    topic: "$3"
-    partition: "$4"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.highestStreamOffsetConsumed.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
-  name: "pinot_server_highestStreamOffsetConsumed_$5"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    topic: "$5"
+    partition: "$6"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.highestStreamOffsetConsumed.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
+  name: "pinot_server_highestStreamOffsetConsumed_$7"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    topic: "$3"
-    partition: "$4"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.lastRealtimeSegment(\\w+)Seconds.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
-  name: "pinot_server_lastRealtimeSegment$1Seconds_$6"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    topic: "$5"
+    partition: "$6"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.lastRealtimeSegment(\\w+)Seconds.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
+  name: "pinot_server_lastRealtimeSegment$1Seconds_$8"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
-    topic: "$4"
-    partition: "$5"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
+    topic: "$6"
+    partition: "$7"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.llcControllerResponse(\\w+)\"><>(\\w+)"
   name: "pinot_server_llcControllerResponse_$1_$2"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.llcPartitionConsuming.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
-  name: "pinot_server_llcPartitionConsuming_$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.llcPartitionConsuming.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
+  name: "pinot_server_llcPartitionConsuming_$7"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    topic: "$3"
-    partition: "$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    topic: "$5"
+    partition: "$6"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.llcSimultaneousSegmentBuilds\"><>(\\w+)"
   name: "pinot_server_llcSimultaneousSegmentBuilds_$1"
   cache: true
@@ -420,11 +514,12 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeConsumptionExceptions\"><>(\\w+)"
   name: "pinot_server_realtime_consumptionExceptions_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeOffheapMemoryUsed.([^\\.]*?)\"><>(\\w+)"
-  name: "pinot_server_realtime_offheapMemoryUsed_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeOffheapMemoryUsed.(([^\\.]+)\\.)?([^\\.]*?)\"><>(\\w+)"
+  name: "pinot_server_realtime_offheapMemoryUsed_$4"
   cache: true
   labels:
-    table: "$1"
+    database: "$2"
+    table: "$1$3"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeOffsetCommits\"><>(\\w+)"
   name: "pinot_server_realtime_offsetCommits_$1"
   cache: true
@@ -445,46 +540,79 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.nettyConnection(\\w+)\"><>(\\w+)"
   name: "pinot_server_nettyConnection_$1_$2"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeSegmentNumPartitions.([^\\.]*?)\"><>(\\w+)"
-  name: "pinot_server_realtimeSegmentNumPartitions_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeSegmentNumPartitions.(([^\\.]+)\\.)?([^\\.]*?)\"><>(\\w+)"
+  name: "pinot_server_realtimeSegmentNumPartitions_$4"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.resizeTimeMs.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_server_resizeTimeMs_$5"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.resizeTimeMs.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_server_resizeTimeMs_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.numResizes.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_server_numResizes_$5"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertPrimaryKeysCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
+  name: "pinot_server_upsertPrimaryKeysCount_$6"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    partition: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeIngestionDelayMs.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_server_realtimeIngestionDelayMs_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertPrimaryKeysCount.([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
-  name: "pinot_server_upsertPrimaryKeysCount_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    partition: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertValidDocSnapshotCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
+  name: "pinot_server_upsertValidDocSnapshotCount_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    partition: "$3"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeIngestionDelayMs.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_server_realtimeIngestionDelayMs_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    partition: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertPrimaryKeysInSnapshotCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
+  name: "pinot_server_upsertPrimaryKeysInSnapshotCount_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    partition: "$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    partition: "$5"
+  #grpc related metrics
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.grpc(.+)\"><>(\\w+)"
+  name: "pinot_server_grpc$1_$2"
+  cache: true
 
 # Pinot Minions
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.numberOfTasks.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_minion_numberOfTasks_$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.numberOfTasks.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_minion_numberOfTasks_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.([^\\.]*?)_(OFFLINE|REALTIME).(\\w+).(taskExecution|taskQueueing|numberTasks|numberTasksExecuted|numberTasksCompleted|numberTasksCancelled|numberTasksFailed|numberTasksFatalFailed)\"><>(\\w+)"
-  name: "pinot_minion_$4_$5"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+).(taskExecution|taskQueueing|numberTasks|numberTasksExecuted|numberTasksCompleted|numberTasksCancelled|numberTasksFailed|numberTasksFatalFailed)\"><>(\\w+)"
+  name: "pinot_minion_$6_$7"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    taskType: "$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    taskType: "$5"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"MinionMetrics\", 
name=\"pinot.minion.(\\w+)\"><>(\\w+)"
   name: "pinot_minion_$1_$2"
   cache: true
@@ -503,45 +631,50 @@ rules:
   ## Metrics that fit the catch-all patterns above should not be added to this 
file.
   ## In case a metric does not fit the catch-all patterns, add them before 
this comment
 
-  # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without topic or partition info
+  # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without topic but containing partition
   # Patterns after this line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$4_$5"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\d+)\"?><>(\\w+)"
+  name: "pinot_$1_$2_$8"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
-  # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without topic but containing partition
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
+    partition: "$7"
+  # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without topic or partition info
   # Patterns after this line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$2_$6"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$6_$7"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
-    partition: "$5"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
   # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix with topic and partition
   # Patterns after this line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$2_$7"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$2_$9"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
-    topic: "$5"
-    partition: "$6"
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\\"?><>(\\w+)"
-  name: "pinot_$1_$2_$5"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
+    topic: "$7"
+    partition: "$8"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\\"?><>(\\w+)"
+  name: "pinot_$1_$2_$7"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
+    database: "$4"
+    table: "$2$5"
+    tableType: "$6"
   # This is a catch-all pattern for pinot table metrics. Patterns after this 
line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$3_$4"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$5_$6"
   cache: true
   labels:
-    table: "$2"
+    database: "$3"
+    table: "$2$4"
   # This is a catch-all pattern for pinot controller metrics not related to 
tables. Patterns after this line may be skipped.
 - pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
   name: "pinot_$1_$2_$3"
diff --git 
a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/server.yml 
b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/server.yml
index d25167e631..f59c707d68 100644
--- a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/server.yml
+++ b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/server.yml
@@ -1,70 +1,78 @@
 rules:
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.documentCount.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_server_documentCount_$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.documentCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_server_documentCount_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.segmentCount.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_server_segmentCount_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.segmentCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_server_segmentCount_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_server_$3_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_server_$5_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.helix.connected\"><>(\\w+)"
   name: "pinot_server_helix_connected_$1"
   cache: true
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.helixZookeeperReconnects\"><>(\\w+)"
   name: "pinot_server_helix_zookeeperReconnects_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.highestKafkaOffsetConsumed.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
-  name: "pinot_server_highestKafkaOffsetConsumed_$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.highestKafkaOffsetConsumed.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
+  name: "pinot_server_highestKafkaOffsetConsumed_$7"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    topic: "$3"
-    partition: "$4"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.highestStreamOffsetConsumed.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
-  name: "pinot_server_highestStreamOffsetConsumed_$5"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    topic: "$5"
+    partition: "$6"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.highestStreamOffsetConsumed.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
+  name: "pinot_server_highestStreamOffsetConsumed_$7"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    topic: "$3"
-    partition: "$4"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.lastRealtimeSegment(\\w+)Seconds.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
-  name: "pinot_server_lastRealtimeSegment$1Seconds_$6"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    topic: "$5"
+    partition: "$6"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.lastRealtimeSegment(\\w+)Seconds.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
+  name: "pinot_server_lastRealtimeSegment$1Seconds_$8"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
-    topic: "$4"
-    partition: "$5"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
+    topic: "$6"
+    partition: "$7"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.llcControllerResponse(\\w+)\"><>(\\w+)"
   name: "pinot_server_llcControllerResponse_$1_$2"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.llcPartitionConsuming.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
-  name: "pinot_server_llcPartitionConsuming_$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.llcPartitionConsuming.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"><>(\\w+)"
+  name: "pinot_server_llcPartitionConsuming_$7"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    topic: "$3"
-    partition: "$4"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeIngestionDelayMs.([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
-  name: "pinot_server_realtimeIngestionDelayMs_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    topic: "$5"
+    partition: "$6"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeIngestionDelayMs.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\.(\\w+)\"><>(\\w+)"
+  name: "pinot_server_realtimeIngestionDelayMs_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    partition: "$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    partition: "$5"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.llcSimultaneousSegmentBuilds\"><>(\\w+)"
   name: "pinot_server_llcSimultaneousSegmentBuilds_$1"
   cache: true
@@ -77,19 +85,21 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeConsumptionExceptions\"><>(\\w+)"
   name: "pinot_server_realtime_consumptionExceptions_$1"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+).(invalidRealtimeRowsDropped|incompleteRealtimeRowsConsumed|rowsWithErrors|realtimeRowsFiltered|realtimeRowsConsumed|realtimeRowsFetched|streamConsumerCreateExceptions)\"><>(\\w+)"
-  name: "pinot_server_$5_$6"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+).(invalidRealtimeRowsDropped|incompleteRealtimeRowsConsumed|rowsWithErrors|realtimeRowsFiltered|realtimeRowsConsumed|realtimeRowsFetched|streamConsumerCreateExceptions)\"><>(\\w+)"
+  name: "pinot_server_$7_$8"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    topic: "$3"
-    partition: "$4"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeOffheapMemoryUsed.([^\\.]*?)\"><>(\\w+)"
-  name: "pinot_server_realtime_offheapMemoryUsed_$2"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    topic: "$5"
+    partition: "$6"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeOffheapMemoryUsed.(([^\\.]+)\\.)?([^\\.]*?)\"><>(\\w+)"
+  name: "pinot_server_realtime_offheapMemoryUsed_$4"
   cache: true
   labels:
-    table: "$1"
+    database: "$2"
+    table: "$1$3"
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeOffsetCommits\"><>(\\w+)"
   name: "pinot_server_realtime_offsetCommits_$1"
   cache: true
@@ -107,49 +117,55 @@ rules:
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.nettyConnection(\\w+)\"><>(\\w+)"
   name: "pinot_server_nettyConnection_$1_$2"
   cache: true
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeSegmentNumPartitions.([^\\.]*?)\"><>(\\w+)"
-  name: "pinot_server_realtimeSegmentNumPartitions_$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.realtimeSegmentNumPartitions.(([^\\.]+)\\.)?([^\\.]*?)\"><>(\\w+)"
+  name: "pinot_server_realtimeSegmentNumPartitions_$4"
   cache: true
   labels:
-    table: "$1"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.numResizes.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_server_numResizes_$3"
+    database: "$2"
+    table: "$1$3"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.numResizes.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_server_numResizes_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.resizeTimeMs.([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
-  name: "pinot_server_resizeTimeMs_$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.resizeTimeMs.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME)\"><>(\\w+)"
+  name: "pinot_server_resizeTimeMs_$5"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertPrimaryKeysCount.([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
-  name: "pinot_server_upsertPrimaryKeysCount_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertPrimaryKeysCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
+  name: "pinot_server_upsertPrimaryKeysCount_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    partition: "$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    partition: "$5"
 - pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.version\\.(\\w+)\"?><>(\\w+)"
   name: "pinot_$1_version"
   cache: true
   labels:
     version: "$2"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertValidDocSnapshotCount.([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
-  name: "pinot_server_upsertValidDocSnapshotCount_$4"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertValidDocSnapshotCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
+  name: "pinot_server_upsertValidDocSnapshotCount_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    partition: "$3"
-- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertPrimaryKeysInSnapshotCount.([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
-  name: "pinot_server_upsertPrimaryKeysInSnapshotCount_$4"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    partition: "$5"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.upsertPrimaryKeysInSnapshotCount.(([^\\.]+)\\.)?([^\\.]*?)_(OFFLINE|REALTIME).(\\w+)\"><>(\\w+)"
+  name: "pinot_server_upsertPrimaryKeysInSnapshotCount_$6"
   cache: true
   labels:
-    table: "$1"
-    tableType: "$2"
-    partition: "$3"
+    database: "$2"
+    table: "$1$3"
+    tableType: "$4"
+    partition: "$5"
 #grpc related metrics
 - pattern: "\"org.apache.pinot.common.metrics\"<type=\"ServerMetrics\", 
name=\"pinot.server.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
@@ -157,44 +173,49 @@ rules:
 
   ## Metrics that fit the catch-all patterns above should not be added to this 
file.
   ## In case a metric does not fit the catch-all patterns, add them before 
this comment
-  # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without the topic
-  # Patterns after this line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$4_$5"
+  # when there is partition but no topic in the metric
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\d+)\"?><>(\\w+)"
+  name: "pinot_$1_$2_$8"
   cache: true
   labels:
-    table: "$2"
-    tableType: "$3"
-#when there is partition but no topic in the metric
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$2_$6"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
+    partition: "$7"
+  # This is a catch-all pattern for pinot table metrics with offline/realtime 
suffix without the topic
+  # Patterns after this line may be skipped.
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$6_$7"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
-    partition: "$5"
+    database: "$3"
+    table: "$2$4"
+    tableType: "$5"
 #when there is partition and topic in the metric
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$2_$7"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\-(.+)\\-(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$2_$9"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
-    topic: "$5"
-    partition: "$6"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
+    topic: "$7"
+    partition: "$8"
 #when there is no partition in the metric
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)_(OFFLINE|REALTIME)\\\"?><>(\\w+)"
-  name: "pinot_$1_$2_$5"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.((\\w+)\\.)?(\\w+)_(OFFLINE|REALTIME)\\\"?><>(\\w+)"
+  name: "pinot_$1_$2_$7"
   cache: true
   labels:
-    table: "$3"
-    tableType: "$4"
+    database: "$4"
+    table: "$3$5"
+    tableType: "$6"
   # This is a catch-all pattern for pinot table metrics. Patterns after this 
line may be skipped.
-- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
-  name: "pinot_$1_$3_$4"
+- pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.((\\w+)\\.)?(\\w+)\\.(\\w+)\"?><>(\\w+)"
+  name: "pinot_$1_$5_$6"
   cache: true
   labels:
-    table: "$2"
+    database: "$3"
+    table: "$2$4"
   # This is a catch-all pattern for pinot controller metrics not related to 
tables. Patterns after this line may be skipped.
 - pattern: "\"?org\\.apache\\.pinot\\.common\\.metrics\"?<type=\"?\\w+\"?, 
name=\"?pinot\\.(\\w+)\\.(\\w+)\"?><>(\\w+)"
   name: "pinot_$1_$2_$3"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to