You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "xiangfu0 (via GitHub)" <gi...@apache.org> on 2025/09/03 11:53:57 UTC

[PR] Support more kafka client metrics in jmx exporter templates [pinot]

xiangfu0 opened a new pull request, #16745:
URL: https://github.com/apache/pinot/pull/16745

   This pull request adds support for collecting Kafka consumer metrics using a scope-based approach in both the `pinot.yml` and `server.yml` JMX Prometheus Java Agent configuration files. The new rules enable more granular monitoring of Kafka consumer activity by capturing metrics at the consumer, topic, and partition levels, with appropriate labeling for easier identification and aggregation.
   
   **Kafka Consumer Metrics Collection:**
   
   * Added rules to capture consumer-level metrics (e.g., fetch rate, latency, bytes consumed) with labels for `table`, `topic_name`, `partition`, and `scope=consumer` in both `pinot.yml` and `server.yml`. [[1]](diffhunk://#diff-7f4df59f77472c0840d9b41bf3ec680ed286cb34c504079f798a5dac652d6919R599-R626) [[2]](diffhunk://#diff-2eab1bf3447d4d9c61dfc80e6a0299e3785045f368019d2d9d593f95515cf39eR88-R115)
   * Added rules for topic-level metrics (e.g., bytes consumed rate, fetch size) with labels for `table`, `topic_name`, `partition`, and `scope=topic` in both configuration files. [[1]](diffhunk://#diff-7f4df59f77472c0840d9b41bf3ec680ed286cb34c504079f798a5dac652d6919R599-R626) [[2]](diffhunk://#diff-2eab1bf3447d4d9c61dfc80e6a0299e3785045f368019d2d9d593f95515cf39eR88-R115)
   * Added rules for partition-level metrics (e.g., records lag/lead) with labels for `table`, `topic_name`, `partition`, and `scope=partition` in both configuration files. [[1]](diffhunk://#diff-7f4df59f77472c0840d9b41bf3ec680ed286cb34c504079f798a5dac652d6919R599-R626) [[2]](diffhunk://#diff-2eab1bf3447d4d9c61dfc80e6a0299e3785045f368019d2d9d593f95515cf39eR88-R115)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #16745:
URL: https://github.com/apache/pinot/pull/16745#discussion_r2318729595


##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/server.yml:
##########
@@ -85,3 +85,31 @@ rules:
   name: "pinot_$1_$2_$3"
   cache: true
 
+# Kafka Consumer Metrics with Scope-based Approach
+# Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg|records-per-request-avg)"

Review Comment:
   The metric `records-per-request-avg` is duplicated in the regex pattern. Remove the duplicate occurrence.
   ```suggestion
   - pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
   ```



##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -596,6 +596,34 @@ rules:
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+  # Kafka Consumer Metrics with Scope-based Approach
+  # Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg|records-per-request-avg)"

Review Comment:
   The metric `records-per-request-avg` is duplicated in the regex pattern. Remove the duplicate occurrence.
   ```suggestion
   - pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #16745:
URL: https://github.com/apache/pinot/pull/16745#discussion_r2319380381


##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -596,6 +596,34 @@ rules:
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+  # Kafka Consumer Metrics with Scope-based Approach
+  # Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$4"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "consumer"
+  # Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$5"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "topic"
+  # Partition-level metrics (most granular, includes both topic and partition from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^,\"]+), partition=([^\"]+)><>(records-lag-avg|records-lag-max|records-lead-avg|records-lead-min)"

Review Comment:
   The comment indentation is inconsistent with the YAML structure. Comments should align with the YAML element they describe, not be indented further.



##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -596,6 +596,34 @@ rules:
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+  # Kafka Consumer Metrics with Scope-based Approach
+  # Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"

Review Comment:
   The comment indentation is inconsistent with the YAML structure. Comments should align with the YAML element they describe, not be indented further.



##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -596,6 +596,34 @@ rules:
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+  # Kafka Consumer Metrics with Scope-based Approach
+  # Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$4"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "consumer"
+  # Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"

Review Comment:
   The comment indentation is inconsistent with the YAML structure. Comments should align with the YAML element they describe, not be indented further.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #16745:
URL: https://github.com/apache/pinot/pull/16745#discussion_r2319290903


##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -596,6 +596,34 @@ rules:
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+  # Kafka Consumer Metrics with Scope-based Approach
+  # Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg|records-per-request-avg)"
+  name: "kafka_consumer_$4"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "consumer"
+  # Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"

Review Comment:
   what's the database prefix? kafka client-id is `<tableName>_REALTIME-<topic>-<partition>`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "shounakmk219 (via GitHub)" <gi...@apache.org>.
shounakmk219 commented on code in PR #16745:
URL: https://github.com/apache/pinot/pull/16745#discussion_r2321681975


##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -596,6 +596,34 @@ rules:
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+  # Kafka Consumer Metrics with Scope-based Approach
+  # Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg|records-per-request-avg)"
+  name: "kafka_consumer_$4"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "consumer"
+  # Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"

Review Comment:
   the client Id would be something like `db1.table1_REALTIME-abc-0` for a table `db1.table1_REALTIME` under database `db1` right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #16745:
URL: https://github.com/apache/pinot/pull/16745#discussion_r2324612372


##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/server.yml:
##########
@@ -85,3 +85,34 @@ rules:
   name: "pinot_$1_$2_$3"
   cache: true
 
+# Kafka Consumer Metrics with Scope-based Approach
+# Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(([^.]+)\\.)?([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$6"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$3"
+    topic_name: "$4"
+    partition: "$5"
+    scope: "consumer"
+# Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(([^.]+)\\.)?([^,]+)_REALTIME-([^,]+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$7"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$3"
+    topic_name: "$4"
+    partition: "$5"
+    scope: "topic"
+# Partition-level metrics (most granular, includes both topic and partition from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(([^.]+)\\.)?([^,]+)_REALTIME-([^,]+)-(\\d+), topic=([^,\"]+), partition=([^\"]+)><>(records-lag-avg|records-lag-max|records-lead-avg|records-lead-min)"

Review Comment:
   The partition capture group `$5` from the client-id pattern and the partition capture group `$7` from the MBean contain different values. The client-id partition `$5` represents the consumer's partition assignment, while the MBean partition `$7` represents the actual topic partition. Using `$5` for the partition label creates inconsistency since it doesn't match the actual partition being measured by the lag/lead metrics.



##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -592,11 +592,44 @@ rules:
     table: "$1$3"
     tableType: "$4"
     partition: "$5"
-  #grpc related metrics
+# grpc related metrics
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
 
+# Kafka Consumer Metrics with Scope-based Approach
+# Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(([^.]+)\\.)?([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$6"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$3"
+    topic_name: "$4"
+    partition: "$5"
+    scope: "consumer"
+# Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(([^.]+)\\.)?([^,]+)_REALTIME-([^,]+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$7"
+  cache: true
+  labels:
+    database: "$2"
+    table: "$3"
+    topic_name: "$4"
+    partition: "$5"
+    scope: "topic"
+# Partition-level metrics (most granular, includes both topic and partition from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(([^.]+)\\.)?([^,]+)_REALTIME-([^,]+)-(\\d+), topic=([^,\"]+), partition=([^\"]+)><>(records-lag-avg|records-lag-max|records-lead-avg|records-lead-min)"

Review Comment:
   The partition capture group `$5` from the client-id pattern and the partition capture group `$7` from the MBean contain different values. The client-id partition `$5` represents the consumer's partition assignment, while the MBean partition `$7` represents the actual topic partition. Using `$5` for the partition label creates inconsistency since it doesn't match the actual partition being measured by the lag/lead metrics.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #16745:
URL: https://github.com/apache/pinot/pull/16745#discussion_r2319710165


##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -592,10 +592,38 @@ rules:
     table: "$1$3"
     tableType: "$4"
     partition: "$5"
-  #grpc related metrics
+#grpc related metrics
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+# Kafka Consumer Metrics with Scope-based Approach
+# Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$4"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "consumer"
+# Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$5"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"

Review Comment:
   The partition label is incorrectly mapped to capture group $3 from the client-id pattern, but this pattern should use the actual topic partition from the MBean's partition attribute ($5) to ensure accurate partition labeling for topic-level metrics.
   ```suggestion
       partition: "$5"
   ```



##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/server.yml:
##########
@@ -85,3 +85,31 @@ rules:
   name: "pinot_$1_$2_$3"
   cache: true
 
+# Kafka Consumer Metrics with Scope-based Approach
+# Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$4"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "consumer"
+# Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"
+  name: "kafka_consumer_$5"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"

Review Comment:
   The partition label is incorrectly mapped to capture group $3 from the client-id pattern, but this pattern should use the actual topic partition from the MBean's partition attribute ($5) to ensure accurate partition labeling for topic-level metrics.
   ```suggestion
       partition: "$5"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #16745:
URL: https://github.com/apache/pinot/pull/16745#discussion_r2324284058


##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -596,6 +596,34 @@ rules:
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+  # Kafka Consumer Metrics with Scope-based Approach
+  # Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg|records-per-request-avg)"
+  name: "kafka_consumer_$4"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "consumer"
+  # Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "gortiz (via GitHub)" <gi...@apache.org>.
gortiz merged PR #16745:
URL: https://github.com/apache/pinot/pull/16745


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Support more kafka client metrics in jmx exporter templates [pinot]

Posted by "shounakmk219 (via GitHub)" <gi...@apache.org>.
shounakmk219 commented on code in PR #16745:
URL: https://github.com/apache/pinot/pull/16745#discussion_r2318769461


##########
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml:
##########
@@ -596,6 +596,34 @@ rules:
 - pattern: "\"org\\.apache\\.pinot\\.common\\.metrics\"<type=\"ServerMetrics\", name=\"pinot\\.server\\.grpc(.+)\"><>(\\w+)"
   name: "pinot_server_grpc$1_$2"
   cache: true
+  # Kafka Consumer Metrics with Scope-based Approach
+  # Consumer-level metrics (most aggregated, usually most reliable)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=([^,]+)_REALTIME-([^,]+)-(\\d+)><>(fetch-rate|fetch-latency-avg|fetch-throttle-time-avg|bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg|records-per-request-avg)"
+  name: "kafka_consumer_$4"
+  cache: true
+  labels:
+    table: "$1"
+    topic_name: "$2"
+    partition: "$3"
+    scope: "consumer"
+  # Topic-level metrics (includes topic information from MBean)
+- pattern: "kafka\\.consumer<type=consumer-fetch-manager-metrics, client-id=(.+)_REALTIME-(.+)-(\\d+), topic=([^\"]+)><>(bytes-consumed-rate|records-consumed-rate|fetch-size-avg|fetch-size-max|records-per-request-avg)"

Review Comment:
   Will the table name also include the database prefix if it exist? If so please extract that label as well if it makes sense 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org