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: [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]