You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/11/27 12:14:13 UTC

[GitHub] [flink] qingwei91 commented on a diff in pull request #21403: [FLINK-29984][flink-metrics] Prometheus histogram minmax

qingwei91 commented on code in PR #21403:
URL: https://github.com/apache/flink/pull/21403#discussion_r1032920245


##########
flink-metrics/flink-metrics-prometheus/src/main/java/org/apache/flink/metrics/prometheus/AbstractPrometheusReporter.java:
##########
@@ -378,6 +390,22 @@ private void addSamples(
                                 addToList(labelValues, quantile.toString()),
                                 statistics.getQuantile(quantile)));
             }
+            if (this.histogramMaxEnabled) {
+                samples.add(
+                        new MetricFamilySamples.Sample(
+                                metricName,
+                                labelNamesWithQuantile,
+                                addToList(labelValues, "1.0"),
+                                statistics.getMax()));
+            }
+            if (this.histogramMinEnabled) {
+                samples.add(
+                        new MetricFamilySamples.Sample(
+                                metricName,
+                                labelNamesWithQuantile,
+                                addToList(labelValues, "0.0"),
+                                statistics.getMin()));
+            }

Review Comment:
   Core of the changes, emit max as 1.0 and min as 0.0 when reporting to prometheus



-- 
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: issues-unsubscribe@flink.apache.org

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