You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by di...@apache.org on 2022/03/25 01:25:59 UTC

[flink] branch release-1.15 updated: [FLINK-26846][python] Fix the gauge metric

This is an automated email from the ASF dual-hosted git repository.

dianfu pushed a commit to branch release-1.15
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.15 by this push:
     new 94c679e  [FLINK-26846][python] Fix the gauge metric
94c679e is described below

commit 94c679ef99357a66fc7609ff6f2f0a91caa4476a
Author: Dian Fu <di...@apache.org>
AuthorDate: Thu Mar 24 20:34:09 2022 +0800

    [FLINK-26846][python] Fix the gauge metric
    
    This closes #19226.
---
 .../java/org/apache/flink/python/metric/FlinkMetricContainer.java   | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/flink-python/src/main/java/org/apache/flink/python/metric/FlinkMetricContainer.java b/flink-python/src/main/java/org/apache/flink/python/metric/FlinkMetricContainer.java
index 96e127f..a184c39 100644
--- a/flink-python/src/main/java/org/apache/flink/python/metric/FlinkMetricContainer.java
+++ b/flink-python/src/main/java/org/apache/flink/python/metric/FlinkMetricContainer.java
@@ -33,7 +33,6 @@ import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMap
 import org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo;
 import org.apache.beam.runners.core.metrics.MetricsContainerImpl;
 import org.apache.beam.runners.core.metrics.MetricsContainerStepMap;
-import org.apache.beam.runners.core.metrics.MonitoringInfoConstants;
 import org.apache.beam.runners.core.metrics.MonitoringInfoMetricName;
 import org.apache.beam.sdk.metrics.DistributionResult;
 import org.apache.beam.sdk.metrics.GaugeResult;
@@ -106,10 +105,7 @@ public final class FlinkMetricContainer {
         MetricName metricName = metricResult.getKey().metricName();
         if (metricName instanceof MonitoringInfoMetricName) {
             String urn = ((MonitoringInfoMetricName) metricName).getUrn();
-            return urn.contains(MonitoringInfoConstants.Urns.USER_SUM_INT64)
-                    || urn.contains(MonitoringInfoConstants.Urns.USER_SUM_DOUBLE)
-                    || urn.contains(MonitoringInfoConstants.Urns.USER_DISTRIBUTION_DOUBLE)
-                    || urn.contains(MonitoringInfoConstants.Urns.USER_DISTRIBUTION_INT64);
+            return urn.startsWith("beam:metric:user");
         }
         return false;
     }