[ 
https://issues.apache.org/jira/browse/BEAM-6361?focusedWorklogId=180893&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-180893
 ]

ASF GitHub Bot logged work on BEAM-6361:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Jan/19 23:09
            Start Date: 03/Jan/19 23:09
    Worklog Time Spent: 10m 
      Work Description: ryan-williams commented on pull request #7408: 
[BEAM-6361] fix user-metric-prefix checking in Flink portable metrics update
URL: https://github.com/apache/beam/pull/7408#discussion_r245162869
 
 

 ##########
 File path: 
runners/flink/src/test/java/org/apache/beam/runners/flink/metrics/FlinkMetricContainerTest.java
 ##########
 @@ -106,6 +110,39 @@ public void testGauge() {
     assertThat(flinkGauge.getValue().getValue(), is(42L));
   }
 
+  @Test
+  public void testMonitoringInfoUpdate() {
+    FlinkMetricContainer container = new FlinkMetricContainer(runtimeContext);
+    MetricsContainer step = container.getMetricsContainer("step");
+
+    SimpleCounter userCounter = new SimpleCounter();
+    when(metricGroup.counter("ns1.metric1")).thenReturn(userCounter);
+
+    SimpleCounter elemCounter = new SimpleCounter();
+    
when(metricGroup.counter("beam.metric:element_count:v1")).thenReturn(elemCounter);
 
 Review comment:
   The current namespace parsing logic 
[above](https://github.com/apache/beam/pull/7408/files#diff-bd906385f3e3ff74094985af80da5a41R109)
 just takes the everything after the first `:` as the "name", so this name is 
`metric:element_count:v1`.
   
   I don't see any reason that having additional `:`s in the "name" is a 
problem, but I saw [a note about it (only related to user metrics, though) in 
SimpleMonitoringInfoBuilder](https://github.com/apache/beam/blob/5716dba6d10f32dfa8ab807ffacc2e68f9267225/runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/SimpleMonitoringInfoBuilder.java#L114-L115),
 so open to whether there's a better way to think about it here.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 180893)
    Time Spent: 20m  (was: 10m)

> Fix user-metric prefix detection for portable Flink metrics
> -----------------------------------------------------------
>
>                 Key: BEAM-6361
>                 URL: https://issues.apache.org/jira/browse/BEAM-6361
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-flink
>    Affects Versions: 2.9.0
>            Reporter: Ryan Williams
>            Assignee: Ryan Williams
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> [~ajam...@google.com] [noticed a 
> bug|https://github.com/apache/beam/pull/7183/files#r243402155] in classifying 
> portable Flink metrics as user-namespaced vs not.
> I think it's only currently affecting how metrics get displayed downstream in 
> Flink, but it should be fixed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to