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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]