Repository navigation
[DO NOT MERGE] [BEAM-4775] Portable metrics over the job-server API #7641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f05bd39
ef44fa2
b4b5495
ea14497
8049119
875ce2f
11e67f3
3367b34
d406df6
b94d070
745ae62
f5bc350
76e1f31
6525491
8d37535
9c89a03
d8dbc49
a245f38
417341e
d7a3b6a
3c097fd
8b0074d
46bb652
43c4e36
94abd52
75e15bd
85e066e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| /* | ||
| * Protocol Buffers for sending metrics over the Job API, between a runner and job server | ||
| */ | ||
|
|
||
| syntax = "proto3"; | ||
|
|
||
| package org.apache.beam.model.job_management.v1; | ||
|
|
||
| option go_package = "jobmanagement_v1"; | ||
| option java_package = "org.apache.beam.model.jobmanagement.v1"; | ||
| option java_outer_classname = "JobApiMetrics"; | ||
|
|
||
| import "beam_pipeline_metrics.proto"; | ||
|
|
||
| message CounterResult { | ||
| int64 attempted = 1; | ||
| int64 committed = 2; | ||
| } | ||
|
|
||
| message DistributionResult { | ||
| org.apache.beam.model.pipeline.v1.IntDistributionData attempted = 1; | ||
| org.apache.beam.model.pipeline.v1.IntDistributionData committed = 2; | ||
| } | ||
|
|
||
| message MetricResult { | ||
| oneof result { | ||
| CounterResult counter_result = 1; | ||
| DistributionResult distribution_result = 2; | ||
| } | ||
| } | ||
|
|
||
| message MetricStatus { | ||
| org.apache.beam.model.pipeline.v1.MetricKey metric_key = 1; | ||
| MetricResult metric_result = 2; | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| /* | ||
| * Protocol Buffers describing the Runner API, which is the runner-independent, | ||
| * SDK-independent definition of the Beam model. | ||
| */ | ||
|
|
||
| syntax = "proto3"; | ||
|
|
||
| package org.apache.beam.model.pipeline.v1; | ||
|
|
||
| option go_package = "pipeline_v1"; | ||
| option java_package = "org.apache.beam.model.pipeline.v1"; | ||
| option java_outer_classname = "PipelineMetrics"; | ||
|
|
||
| message MetricKey { | ||
| string step = 1; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This TODO: use these to replace the SDK-specific classes? @ajamato's new scheme (in #7624) identifies PCollection-scoped metrics by a TODO: should they be abandoned over the wire (and in SDKs?) in favor of URNs? |
||
| MetricName metric_name = 2; | ||
| } | ||
|
|
||
| message MetricName { | ||
| string namespace = 1; | ||
| string name = 2; | ||
| } | ||
|
|
||
| message Metric { | ||
| // (Required) The data for this metric. | ||
| oneof data { | ||
| CounterData counter_data = 1; | ||
| DistributionData distribution_data = 2; | ||
| ExtremaData extrema_data = 3; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: ExtremaData isn't populated or consumed in the SDKs (afaik) |
||
| } | ||
| } | ||
|
|
||
| // Data associated with a Counter or Gauge metric. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: support gauges being sent as |
||
| // 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; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: per discussion with @ajamato, I think we were leaning toward only supporting the |
||
| } | ||
| } | ||
|
|
||
| message IntDistributionData { | ||
| int64 count = 1; | ||
| int64 sum = 2; | ||
| int64 min = 3; | ||
| int64 max = 4; | ||
| } | ||
|
|
||
| message DoubleDistributionData { | ||
| int64 count = 1; | ||
| double sum = 2; | ||
| double min = 3; | ||
| double max = 4; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: I moved these into the
model/pipelinemodule, where they are depended on bymodel/fn-executionandmodel/job-managementmodules.They are in their own file there,
beam_pipeline_metrics.proto.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, I was about to suggest exactly this.
Could you perhaps break that out as a separate PR that we can get in while we are still working on the rest?