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

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

                Author: ASF GitHub Bot
            Created on: 19/Feb/19 22:28
            Start Date: 19/Feb/19 22:28
    Worklog Time Spent: 10m 
      Work Description: ryan-williams commented on pull request #7868: 
[BEAM-4775] MonitoringInfo URN tweaks
URL: https://github.com/apache/beam/pull/7868#discussion_r258257940
 
 

 ##########
 File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MetricUrns.java
 ##########
 @@ -29,14 +30,17 @@
    *
    * <p>Should be consistent with {@code parse_namespace_and_name} in 
monitoring_infos.py.
    */
+  @Nullable
   public static MetricName parseUrn(String urn) {
-    if (urn.startsWith(USER_COUNTER_URN_PREFIX)) {
-      urn = urn.substring(USER_COUNTER_URN_PREFIX.length());
+    if (urn.startsWith(USER_METRIC_URN_PREFIX)) {
+      urn = urn.substring(USER_METRIC_URN_PREFIX.length());
+    } else {
+      return null;
 
 Review comment:
   As of this PR, this helper is called in two places:
   - 
[`MonitoringInfoMetricName.parseUrn`](https://github.com/apache/beam/pull/7868/files#diff-ba1b936a7d4c8d43789e81a816b9bb90R55):
     - use the parsed user-`MetricName`, if possible
     - `throw` if it's not a user-metric (signaled by `null` return here)
   - 
[`FlinkMetricContainer.updateMetrics`](https://github.com/apache/beam/pull/7868/files#diff-bd906385f3e3ff74094985af80da5a41R108):
     - use the parsed user-`MetricName`, if possible
     - skip the metric if it's not a user-metric (again, signaled by `null` 
return)
       - in later PRs I make Flink support system-metrics as well.
   
   This was the most direct way to support those uses. The Flink metrics do 
actually see system metrics, and should gracefully skip them instead of 
`throw`ing (for now).
 
----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 200946)
    Time Spent: 10h 40m  (was: 10.5h)

> JobService should support returning metrics
> -------------------------------------------
>
>                 Key: BEAM-4775
>                 URL: https://issues.apache.org/jira/browse/BEAM-4775
>             Project: Beam
>          Issue Type: Bug
>          Components: beam-model
>            Reporter: Eugene Kirpichov
>            Assignee: Ryan Williams
>            Priority: Major
>              Labels: triaged
>          Time Spent: 10h 40m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/beam/blob/master/model/job-management/src/main/proto/beam_job_api.proto]
>  currently doesn't appear to have a way for JobService to return metrics to a 
> user, even though 
> [https://github.com/apache/beam/blob/master/model/fn-execution/src/main/proto/beam_fn_api.proto]
>  includes support for reporting SDK metrics to the runner harness.
>  
> Metrics are apparently necessary to run any ValidatesRunner tests because 
> PAssert needs to validate that the assertions succeeded. However, this 
> statement should be double-checked: perhaps it's possible to somehow work 
> with PAssert without metrics support.



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

Reply via email to