rionmonster commented on code in PR #27744:
URL: https://github.com/apache/flink/pull/27744#discussion_r2902547588
##########
flink-metrics/flink-metrics-prometheus/src/main/java/org/apache/flink/metrics/prometheus/PrometheusPushGatewayReporter.java:
##########
@@ -96,4 +104,68 @@ public void close() {
}
super.close();
}
+
+ /**
+ * (FLINK-21309) Put "flink_prometheus_push_gateway_reporter_id" as the
last entry of the
+ * grouping keys, so that each taskmanger instance and jobmanager will not
collide their metrics
+ * in the PushGateway.
+ */
+ static class GroupingKeyMap extends AbstractMap<String, String> {
+ private final Map<String, String> customGroupingKeys;
+ private final String reporterId = new AbstractID().toString();
+ private final Set<Entry<String, String>> entrySet = new
GroupingKeySet();
+
+ GroupingKeyMap(Map<String, String> customGroupingKeys) {
+ if (customGroupingKeys.containsKey(REPORTER_ID_GROUPPING_KEY)) {
+ throw new IllegalArgumentException(
Review Comment:
We'll want to add a test here to cover the assertion against the user
supplying "flink_prometheus_push_gateway_reporter_id" as an explicit grouping
(asserting the expected exception).
--
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]