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

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

                Author: ASF GitHub Bot
            Created on: 20/Feb/19 17:10
            Start Date: 20/Feb/19 17:10
    Worklog Time Spent: 10m 
      Work Description: ryan-williams commented on pull request #7876: 
[BEAM-4775] Clean up metric protos; support integer distributions, gauges
URL: https://github.com/apache/beam/pull/7876#discussion_r258585934
 
 

 ##########
 File path: model/fn-execution/src/main/proto/beam_fn_api.proto
 ##########
 @@ -501,48 +501,9 @@ message MonitoringInfoTypeUrns {
 message Metric {
   // (Required) The data for this metric.
   oneof data {
-    CounterData counter_data = 1;
-    DistributionData distribution_data = 2;
-    ExtremaData extrema_data = 3;
-  }
-}
-
-// Data associated with a Counter or Gauge metric.
-// This is designed to be compatible with metric collection
-// systems such as DropWizard.
-message CounterData {
-  oneof value {
-    int64 int64_value = 1;
-    double double_value = 2;
-    string string_value = 3;
-  }
-}
-
-// Extrema messages are used for calculating
-// Top-N/Bottom-N metrics.
-message ExtremaData {
-  oneof extrema {
-    IntExtremaData int_extrema_data = 1;
-    DoubleExtremaData double_extrema_data = 2;
-  }
-}
-
-message IntExtremaData {
-  repeated int64 int_values = 1;
-}
-
-message DoubleExtremaData {
-  repeated double double_values = 2;
-}
-
-// Data associated with a distribution metric.
-// This is based off of the current DistributionData metric.
-// This is not a stackdriver or dropwizard compatible
-// style of distribution metric.
-message DistributionData {
-  oneof distribution {
-    IntDistributionData int_distribution_data = 1;
-    DoubleDistributionData double_distribution_data = 2;
+    int64 counter = 1;
 
 Review comment:
   Thanks Robert. It seems we're stuck between 3 data models:
   
   1. [existing 
protos](https://github.com/apache/beam/blob/981fb620a1b53d2a564b629f1d1e2d18184f8393/model/fn-execution/src/main/proto/beam_fn_api.proto#L501-L561)
       - {int,double,string} counters
       - {int,double} x {distribution,extrema}
       - unused in SDKs
   2. [deprecated 
protos](https://github.com/apache/beam/blob/981fb620a1b53d2a564b629f1d1e2d18184f8393/model/fn-execution/src/main/proto/beam_fn_api.proto#L687-L714)
       - `int64`-only {counter, distribution, gauge}
       - supported in 
[Java](https://github.com/apache/beam/blob/981fb620a1b53d2a564b629f1d1e2d18184f8393/sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/MetricQueryResults.java#L32-L39),
 
[Python](https://github.com/apache/beam/blob/981fb620a1b53d2a564b629f1d1e2d18184f8393/sdks/python/apache_beam/metrics/cells.py)
 SDKs
   3. opaque bytes-payloads
       - [Robert's suggestion 
above](https://github.com/apache/beam/pull/7876#discussion_r258384748)
       - not implemented anywhere afaik
   
   In this PR, I changed (1)'s protos to match the SDK support that is modeled 
on (2), which is probably wrong!
   
   (3) sgtm but seems like it is not the existing consensus / spec.
   
   I think the larger goal (sending metrics over the job API) requires 
converting between SDK and proto metrics structures (in both directions), so 
they need to match.
   
   Maybe there is a way I can side-step that, or maybe we can just get to the 
real long-term solution 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: 201450)
    Time Spent: 16h 50m  (was: 16h 40m)

> 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: 16h 50m
>  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