[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-23 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r396575954
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -52,38 +55,157 @@ message Annotation {
   string value = 2;
 }
 
-// Populated MonitoringInfoSpecs for specific URNs.
-// Indicating the required fields to be set.
-// SDKs and RunnerHarnesses can load these instances into memory and write a
-// validator or code generator to assist with populating and validating
-// MonitoringInfo protos.
+// A set of well known MonitoringInfo specifications.
 message MonitoringInfoSpecs {
   enum Enum {
-// TODO(BEAM-6926): Add the PTRANSFORM name as a required label after
-// upgrading the python SDK.
-USER_COUNTER = 0 [(monitoring_info_spec) = {
-  urn: "beam:metric:user",
-  type_urn: "beam:metrics:sum_int_64",
+// Represents an integer counter where values are summed across bundles.
+USER_SUM_INT64 = 0 [(monitoring_info_spec) = {
+  urn: "beam:metric:user:v1",
+  type: "beam:metrics:sum_int64:v1",
   required_labels: ["PTRANSFORM", "NAMESPACE", "NAME"],
   annotations: [{
 key: "description",
-value: "URN utilized to report user numeric counters."
+value: "URN utilized to report user metric."
   }]
 }];
 
-ELEMENT_COUNT = 1 [(monitoring_info_spec) = {
+// Represents a double counter where values are summed across bundles.
+USER_SUM_DOUBLE = 1 [(monitoring_info_spec) = {
+  urn: "beam:metric:user:v1",
 
 Review comment:
   The URN represents the unique identifier in the "semantic meaning" space of 
the counter. So saying that this is a user counter and that there are many 
types makes sense to me.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-23 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r396573892
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -229,121 +330,148 @@ message MonitoringInfo {
 NAMESPACE = 5 [(label_props) = { name: "NAMESPACE" }];
 NAME = 6 [(label_props) = { name: "NAME" }];
   }
-  // A set of key+value labels which define the scope of the metric.
+
+  // A set of key and value labels which define the scope of the metric. For
+  // well known URNs, the set of required labels is provided by the associated
+  // MonitoringInfoSpec.
+  //
   // Either a well defined entity id for matching the enum names in
   // the MonitoringInfoLabels enum or any arbitrary label
   // set by a custom metric or user metric.
+  //
   // A monitoring system is expected to be able to aggregate the metrics
   // together for all updates having the same URN and labels. Some systems such
   // as Stackdriver will be able to aggregate the metrics using a subset of the
   // provided labels
-  map labels = 5;
-
-  // The walltime of the most recent update.
-  // Useful for aggregation for latest types such as LatestInt64.
-  google.protobuf.Timestamp timestamp = 6;
+  map labels = 4;
 }
 
+// A set of well known URNs that specify the encoding and aggregation method.
 message MonitoringInfoTypeUrns {
   enum Enum {
+// Represents an integer counter where values are summed across bundles.
+//
+// Encoding: 
+//   - value: beam:coder:varint:v1
 SUM_INT64_TYPE = 0 [(org.apache.beam.model.pipeline.v1.beam_urn) =
-"beam:metrics:sum_int_64"];
-
-DISTRIBUTION_INT64_TYPE = 1 [(org.apache.beam.model.pipeline.v1.beam_urn) =
- "beam:metrics:distribution_int_64"];
-
-LATEST_INT64_TYPE = 2 [(org.apache.beam.model.pipeline.v1.beam_urn) =
-   "beam:metrics:latest_int_64"];
-
-// iterable is encoded with a beam:coder:double:v1 coder for each
-// element.
-LATEST_DOUBLES_TYPE = 3 [(org.apache.beam.model.pipeline.v1.beam_urn) =
- "beam:metrics:latest_doubles"];
-  }
-}
-
-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;
-}
+"beam:metrics:sum_int64:v1"];
+
+// Represents a double counter where values are summed across bundles.
+//
+// Encoding: 
+//   value: beam:coder:double:v1
+SUM_DOUBLE_TYPE = 1 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+"beam:metrics:sum_double:v1"];
+
+// Represents a distribution of an integer value where:
+//   - count: represents the number of values seen across all bundles
+//   - sum: represents the total of the value across all bundles
+//   - min: represents the smallest value seen across all bundles
+//   - max: represents the largest value seen across all bundles
+//
+// Encoding: 
+//   - count: beam:coder:varint:v1
+//   - sum:   beam:coder:varint:v1
+//   - min:   beam:coder:varint:v1
+//   - max:   beam:coder:varint:v1
+DISTRIBUTION_INT64_TYPE = 2 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+ "beam:metrics:distribution_int64:v1"];
+
+// Represents a distribution of a double value where:
+//   - count: represents the number of values seen across all bundles
+//   - sum: represents the total of the value across all bundles
+//   - min: represents the smallest value seen across all bundles
+//   - max: represents the largest value seen across all bundles
+//
+// Encoding: 
+//   - count: beam:coder:varint:v1
+//   - sum:   beam:coder:double:v1
+//   - min:   beam:coder:double:v1
+//   - max:   beam:coder:double:v1
+DISTRIBUTION_DOUBLE_TYPE = 3 [(org.apache.beam.model.pipeline.v1.beam_urn) 
=
+ "beam:metrics:distribution_double:v1"];
+
+// Represents the latest seen integer value. The timestamp is used to
+// provide an "ordering" over multiple values to determine which is the
+// latest.
+//
+// Encoding: 
+//   - timestamp: beam:coder:varint:v1  

[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-23 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r396556158
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -139,7 +137,7 @@ message MonitoringInfoSpecs {
 
 USER_DISTRIBUTION_COUNTER = 6 [(monitoring_info_spec) = {
   urn: "beam:metric:user_distribution",
-  type_urn: "beam:metrics:distribution_int_64",
+  type_urn: "beam:metrics:distribution_int64",
 
 Review comment:
   Done


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-23 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r396556062
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -229,101 +215,127 @@ message MonitoringInfo {
 NAMESPACE = 5 [(label_props) = { name: "NAMESPACE" }];
 NAME = 6 [(label_props) = { name: "NAME" }];
   }
+
   // A set of key+value labels which define the scope of the metric.
   // Either a well defined entity id for matching the enum names in
   // the MonitoringInfoLabels enum or any arbitrary label
   // set by a custom metric or user metric.
+  //
   // A monitoring system is expected to be able to aggregate the metrics
   // together for all updates having the same URN and labels. Some systems such
   // as Stackdriver will be able to aggregate the metrics using a subset of the
   // provided labels
-  map labels = 5;
-
-  // The walltime of the most recent update.
-  // Useful for aggregation for latest types such as LatestInt64.
-  google.protobuf.Timestamp timestamp = 6;
+  map labels = 4;
 }
 
 message MonitoringInfoTypeUrns {
   enum Enum {
+// Represents an integer counter where values are summed across bundles.
+//
+// Encoding: 
+//   - value: beam:coder:varint:v1
 SUM_INT64_TYPE = 0 [(org.apache.beam.model.pipeline.v1.beam_urn) =
 
 Review comment:
   The problematic type is `string`:
   Is `sum` the same as concat? (if so, this will grow to be huge very quickly 
also making distribution pointless)
   Is min/max/top_n/bottom_n based upon lexicographical ordering? (if so, case 
sensitive/insensitive/...)
   
   `string` only makes sense with latest and if we wanted to define any of the 
other ones I think it would be better to use terms like `case_insensitive_max`.
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-20 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r395908901
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -229,101 +215,127 @@ message MonitoringInfo {
 NAMESPACE = 5 [(label_props) = { name: "NAMESPACE" }];
 NAME = 6 [(label_props) = { name: "NAME" }];
   }
+
   // A set of key+value labels which define the scope of the metric.
   // Either a well defined entity id for matching the enum names in
   // the MonitoringInfoLabels enum or any arbitrary label
   // set by a custom metric or user metric.
+  //
   // A monitoring system is expected to be able to aggregate the metrics
   // together for all updates having the same URN and labels. Some systems such
   // as Stackdriver will be able to aggregate the metrics using a subset of the
   // provided labels
-  map labels = 5;
-
-  // The walltime of the most recent update.
-  // Useful for aggregation for latest types such as LatestInt64.
-  google.protobuf.Timestamp timestamp = 6;
+  map labels = 4;
 }
 
 message MonitoringInfoTypeUrns {
   enum Enum {
+// Represents an integer counter where values are summed across bundles.
+//
+// Encoding: 
+//   - value: beam:coder:varint:v1
 SUM_INT64_TYPE = 0 [(org.apache.beam.model.pipeline.v1.beam_urn) =
-"beam:metrics:sum_int_64"];
-
-DISTRIBUTION_INT64_TYPE = 1 [(org.apache.beam.model.pipeline.v1.beam_urn) =
- "beam:metrics:distribution_int_64"];
-
-LATEST_INT64_TYPE = 2 [(org.apache.beam.model.pipeline.v1.beam_urn) =
-   "beam:metrics:latest_int_64"];
+"beam:metrics:sum_int64:v1"];
+
+// Represents a double counter where values are summed across bundles.
+//
+// Encoding: 
+//   value: beam:coder:double:v1
+SUM_DOUBLE_TYPE = 1 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+"beam:metrics:sum_int64:v1"];
+
+// Represents a distribution of an integer value where:
+//   - count: represents the number of values seen across all bundles
+//   - sum: represents the total of the value across all bundles
+//   - min: represents the smallest value seen across all bundles
+//   - max: represents the largest value seen across all bundles
+//
+// Encoding: 
+//   - count: beam:coder:varint:v1
+//   - sum:   beam:coder:varint:v1
+//   - min:   beam:coder:varint:v1
+//   - max:   beam:coder:varint:v1
+DISTRIBUTION_INT64_TYPE = 2 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+ "beam:metrics:distribution_int64:v1"];
+
+// Represents a distribution of a double value where:
+//   - count: represents the number of values seen across all bundles
+//   - sum: represents the total of the value across all bundles
+//   - min: represents the smallest value seen across all bundles
+//   - max: represents the largest value seen across all bundles
+//
+// Encoding: 
+//   - count: beam:coder:varint:v1
+//   - sum:   beam:coder:double:v1
+//   - min:   beam:coder:double:v1
+//   - max:   beam:coder:double:v1
+DISTRIBUTION_DOUBLE_TYPE = 3 [(org.apache.beam.model.pipeline.v1.beam_urn) 
=
+ "beam:metrics:distribution_int64:v1"];
+
+// Represents the latest seen integer value. The timestamp is used to
+// provide an "ordering" over multiple values to determine which is the
+// latest.
+//
+// Encoding: 
+//   - timestamp: beam:coder:varint:v1 (milliseconds since epoch)
+//   - value: beam:coder:varint:v1
+LATEST_INT64_TYPE = 4 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:latest_int64:v1"];
+
+// Represents the latest seen integer value. The timestamp is used to
+// provide an "ordering" over multiple values to determine which is the
+// latest.
+//
+// Encoding: 
+//   - timestamp: beam:coder:varint:v1 (milliseconds since epoch)
+//   - value: beam:coder:double:v1
+LATEST_DOUBLE_TYPE = 5 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:latest_int64:v1"];
+
+// Represents the largest set of integer values seen across bundles.
+//
+// Encoding: ...
+//   - valueX: beam:coder:varint:v1
+TOP_N_INT64_TYPE = 6 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:top_n_int64:v1"];
+
+// Represents the largest set of double values seen across bundles.
+//
+// Encoding: ...
+//   - valueX: beam:coder:double:v1
+TOP_N_DOUBLE_TYPE = 7 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+"beam:metrics:top_n_int64:v1"];
+
+// Represents the smallest set of 

[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-20 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r395908901
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -229,101 +215,127 @@ message MonitoringInfo {
 NAMESPACE = 5 [(label_props) = { name: "NAMESPACE" }];
 NAME = 6 [(label_props) = { name: "NAME" }];
   }
+
   // A set of key+value labels which define the scope of the metric.
   // Either a well defined entity id for matching the enum names in
   // the MonitoringInfoLabels enum or any arbitrary label
   // set by a custom metric or user metric.
+  //
   // A monitoring system is expected to be able to aggregate the metrics
   // together for all updates having the same URN and labels. Some systems such
   // as Stackdriver will be able to aggregate the metrics using a subset of the
   // provided labels
-  map labels = 5;
-
-  // The walltime of the most recent update.
-  // Useful for aggregation for latest types such as LatestInt64.
-  google.protobuf.Timestamp timestamp = 6;
+  map labels = 4;
 }
 
 message MonitoringInfoTypeUrns {
   enum Enum {
+// Represents an integer counter where values are summed across bundles.
+//
+// Encoding: 
+//   - value: beam:coder:varint:v1
 SUM_INT64_TYPE = 0 [(org.apache.beam.model.pipeline.v1.beam_urn) =
-"beam:metrics:sum_int_64"];
-
-DISTRIBUTION_INT64_TYPE = 1 [(org.apache.beam.model.pipeline.v1.beam_urn) =
- "beam:metrics:distribution_int_64"];
-
-LATEST_INT64_TYPE = 2 [(org.apache.beam.model.pipeline.v1.beam_urn) =
-   "beam:metrics:latest_int_64"];
+"beam:metrics:sum_int64:v1"];
+
+// Represents a double counter where values are summed across bundles.
+//
+// Encoding: 
+//   value: beam:coder:double:v1
+SUM_DOUBLE_TYPE = 1 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+"beam:metrics:sum_int64:v1"];
+
+// Represents a distribution of an integer value where:
+//   - count: represents the number of values seen across all bundles
+//   - sum: represents the total of the value across all bundles
+//   - min: represents the smallest value seen across all bundles
+//   - max: represents the largest value seen across all bundles
+//
+// Encoding: 
+//   - count: beam:coder:varint:v1
+//   - sum:   beam:coder:varint:v1
+//   - min:   beam:coder:varint:v1
+//   - max:   beam:coder:varint:v1
+DISTRIBUTION_INT64_TYPE = 2 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+ "beam:metrics:distribution_int64:v1"];
+
+// Represents a distribution of a double value where:
+//   - count: represents the number of values seen across all bundles
+//   - sum: represents the total of the value across all bundles
+//   - min: represents the smallest value seen across all bundles
+//   - max: represents the largest value seen across all bundles
+//
+// Encoding: 
+//   - count: beam:coder:varint:v1
+//   - sum:   beam:coder:double:v1
+//   - min:   beam:coder:double:v1
+//   - max:   beam:coder:double:v1
+DISTRIBUTION_DOUBLE_TYPE = 3 [(org.apache.beam.model.pipeline.v1.beam_urn) 
=
+ "beam:metrics:distribution_int64:v1"];
+
+// Represents the latest seen integer value. The timestamp is used to
+// provide an "ordering" over multiple values to determine which is the
+// latest.
+//
+// Encoding: 
+//   - timestamp: beam:coder:varint:v1 (milliseconds since epoch)
+//   - value: beam:coder:varint:v1
+LATEST_INT64_TYPE = 4 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:latest_int64:v1"];
+
+// Represents the latest seen integer value. The timestamp is used to
+// provide an "ordering" over multiple values to determine which is the
+// latest.
+//
+// Encoding: 
+//   - timestamp: beam:coder:varint:v1 (milliseconds since epoch)
+//   - value: beam:coder:double:v1
+LATEST_DOUBLE_TYPE = 5 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:latest_int64:v1"];
+
+// Represents the largest set of integer values seen across bundles.
+//
+// Encoding: ...
+//   - valueX: beam:coder:varint:v1
+TOP_N_INT64_TYPE = 6 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:top_n_int64:v1"];
+
+// Represents the largest set of double values seen across bundles.
+//
+// Encoding: ...
+//   - valueX: beam:coder:double:v1
+TOP_N_DOUBLE_TYPE = 7 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+"beam:metrics:top_n_int64:v1"];
+
+// Represents the smallest set of 

[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-20 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r395905193
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -229,101 +215,127 @@ message MonitoringInfo {
 NAMESPACE = 5 [(label_props) = { name: "NAMESPACE" }];
 NAME = 6 [(label_props) = { name: "NAME" }];
   }
+
   // A set of key+value labels which define the scope of the metric.
   // Either a well defined entity id for matching the enum names in
   // the MonitoringInfoLabels enum or any arbitrary label
   // set by a custom metric or user metric.
+  //
   // A monitoring system is expected to be able to aggregate the metrics
   // together for all updates having the same URN and labels. Some systems such
   // as Stackdriver will be able to aggregate the metrics using a subset of the
   // provided labels
-  map labels = 5;
-
-  // The walltime of the most recent update.
-  // Useful for aggregation for latest types such as LatestInt64.
-  google.protobuf.Timestamp timestamp = 6;
+  map labels = 4;
 }
 
 message MonitoringInfoTypeUrns {
 
 Review comment:
   Done


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-20 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r395900617
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -194,33 +188,25 @@ extend google.protobuf.EnumValueOptions {
 }
 
 message MonitoringInfo {
-  // The name defining the metric or monitored state.
+  // The name defining the semantic meaning of the metric or monitored state.
+  //
+  // See MonitoringInfoSpecs.Enum for the set of well known metrics/monitored
+  // state.
   string urn = 1;
 
-  // This is specified as a URN that implies:
-  // A message class: (Distribution, Counter, Extrema, MonitoringDataTable).
-  // Sub types like field formats - int64, double, string.
-  // Aggregation methods - SUM, LATEST, TOP-N, BOTTOM-N, DISTRIBUTION
-  // valid values are:
-  // beam:metrics:[sum_int_64|latest_int_64|top_n_int_64|bottom_n_int_64|
-  // sum_double|latest_double|top_n_double|bottom_n_double|
-  // distribution_int_64|distribution_double|monitoring_data_table|
-  // latest_doubles
+  // This is specified as a URN that implies the encoding and aggregation
+  // method. See MonitoringInfoTypeUrns.Enum for the set of well known types.
   string type = 2;
 
-  // The Metric or monitored state.
-  oneof data {
-MonitoringTableData monitoring_table_data = 3;
-Metric metric = 4;
-bytes payload = 7;
-  }
+  // The monitored state encoded as per the specification defined by the type.
+  bytes payload = 3;
 
 Review comment:
   Yup


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update protos related to MonitoringInfo.

2020-03-20 Thread GitBox
lukecwik commented on a change in pull request #11184: [WIP][BEAM-4374] Update 
protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r395900505
 
 

 ##
 File path: model/pipeline/src/main/proto/metrics.proto
 ##
 @@ -229,101 +215,127 @@ message MonitoringInfo {
 NAMESPACE = 5 [(label_props) = { name: "NAMESPACE" }];
 NAME = 6 [(label_props) = { name: "NAME" }];
   }
+
   // A set of key+value labels which define the scope of the metric.
   // Either a well defined entity id for matching the enum names in
   // the MonitoringInfoLabels enum or any arbitrary label
   // set by a custom metric or user metric.
+  //
   // A monitoring system is expected to be able to aggregate the metrics
   // together for all updates having the same URN and labels. Some systems such
   // as Stackdriver will be able to aggregate the metrics using a subset of the
   // provided labels
-  map labels = 5;
-
-  // The walltime of the most recent update.
-  // Useful for aggregation for latest types such as LatestInt64.
-  google.protobuf.Timestamp timestamp = 6;
+  map labels = 4;
 }
 
 message MonitoringInfoTypeUrns {
   enum Enum {
+// Represents an integer counter where values are summed across bundles.
+//
+// Encoding: 
+//   - value: beam:coder:varint:v1
 SUM_INT64_TYPE = 0 [(org.apache.beam.model.pipeline.v1.beam_urn) =
-"beam:metrics:sum_int_64"];
-
-DISTRIBUTION_INT64_TYPE = 1 [(org.apache.beam.model.pipeline.v1.beam_urn) =
- "beam:metrics:distribution_int_64"];
-
-LATEST_INT64_TYPE = 2 [(org.apache.beam.model.pipeline.v1.beam_urn) =
-   "beam:metrics:latest_int_64"];
+"beam:metrics:sum_int64:v1"];
+
+// Represents a double counter where values are summed across bundles.
+//
+// Encoding: 
+//   value: beam:coder:double:v1
+SUM_DOUBLE_TYPE = 1 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+"beam:metrics:sum_int64:v1"];
+
+// Represents a distribution of an integer value where:
+//   - count: represents the number of values seen across all bundles
+//   - sum: represents the total of the value across all bundles
+//   - min: represents the smallest value seen across all bundles
+//   - max: represents the largest value seen across all bundles
+//
+// Encoding: 
+//   - count: beam:coder:varint:v1
+//   - sum:   beam:coder:varint:v1
+//   - min:   beam:coder:varint:v1
+//   - max:   beam:coder:varint:v1
+DISTRIBUTION_INT64_TYPE = 2 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+ "beam:metrics:distribution_int64:v1"];
+
+// Represents a distribution of a double value where:
+//   - count: represents the number of values seen across all bundles
+//   - sum: represents the total of the value across all bundles
+//   - min: represents the smallest value seen across all bundles
+//   - max: represents the largest value seen across all bundles
+//
+// Encoding: 
+//   - count: beam:coder:varint:v1
+//   - sum:   beam:coder:double:v1
+//   - min:   beam:coder:double:v1
+//   - max:   beam:coder:double:v1
+DISTRIBUTION_DOUBLE_TYPE = 3 [(org.apache.beam.model.pipeline.v1.beam_urn) 
=
+ "beam:metrics:distribution_int64:v1"];
+
+// Represents the latest seen integer value. The timestamp is used to
+// provide an "ordering" over multiple values to determine which is the
+// latest.
+//
+// Encoding: 
+//   - timestamp: beam:coder:varint:v1 (milliseconds since epoch)
+//   - value: beam:coder:varint:v1
+LATEST_INT64_TYPE = 4 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:latest_int64:v1"];
+
+// Represents the latest seen integer value. The timestamp is used to
+// provide an "ordering" over multiple values to determine which is the
+// latest.
+//
+// Encoding: 
+//   - timestamp: beam:coder:varint:v1 (milliseconds since epoch)
+//   - value: beam:coder:double:v1
+LATEST_DOUBLE_TYPE = 5 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:latest_int64:v1"];
+
+// Represents the largest set of integer values seen across bundles.
+//
+// Encoding: ...
+//   - valueX: beam:coder:varint:v1
+TOP_N_INT64_TYPE = 6 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+   "beam:metrics:top_n_int64:v1"];
+
+// Represents the largest set of double values seen across bundles.
+//
+// Encoding: ...
+//   - valueX: beam:coder:double:v1
+TOP_N_DOUBLE_TYPE = 7 [(org.apache.beam.model.pipeline.v1.beam_urn) =
+"beam:metrics:top_n_int64:v1"];
+
+// Represents the smallest set of