Repository navigation
[BEAM-4775] Add GetJobMetrics RPC. #8018
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
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 |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ option java_outer_classname = "JobApi"; | |
| import "beam_runner_api.proto"; | ||
| import "endpoints.proto"; | ||
| import "google/protobuf/struct.proto"; | ||
| import "metrics.proto"; | ||
|
|
||
| // Job Service for running RunnerAPI pipelines | ||
| service JobService { | ||
|
|
@@ -54,6 +55,9 @@ service JobService { | |
| // Subscribe to a stream of state changes and messages from the job | ||
| rpc GetMessageStream (JobMessagesRequest) returns (stream JobMessagesResponse); | ||
|
|
||
| // Fetch metrics for a given job | ||
| rpc GetJobMetrics (GetJobMetricsRequest) returns (GetJobMetricsResponse); | ||
|
|
||
| // Get the supported pipeline options of the runner | ||
| rpc DescribePipelineOptions (DescribePipelineOptionsRequest) returns (DescribePipelineOptionsResponse); | ||
| } | ||
|
|
@@ -179,6 +183,21 @@ message JobState { | |
| } | ||
|
|
||
|
|
||
| message GetJobMetricsRequest { | ||
| string job_id = 1; // (required) | ||
| } | ||
|
|
||
| message GetJobMetricsResponse { | ||
| MetricsResults metrics = 1; | ||
| } | ||
|
|
||
| // All metrics for a given job. Runners may support one or the other or both. | ||
|
Contributor
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. Today, runners either populate ["attempted" only] or both; dunno if worth clarifying here.
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. It's acceptable to populate committed only as well. |
||
| message MetricsResults { | ||
| org.apache.beam.model.pipeline.v1.MonitoringInfo attempted = 1; | ||
|
Contributor
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. eh, these were supposed to be |
||
| org.apache.beam.model.pipeline.v1.MonitoringInfo committed = 2; | ||
| } | ||
|
|
||
|
|
||
| // DescribePipelineOptions provides metadata about the options supported by a runner. | ||
| // It will be used by the SDK client to validate the options specified by or | ||
| // list available options to the user. | ||
|
|
||
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.
I started with this, per https://s.apache.org/get-metrics-api.
Converting between this proto and the SDK reprs (Java, Python) made it clear that we were actually introducing a proto representation of SDKs'
MetricResults.For example,
MetricResultsProtos.javawas originallyGetJobMetricsResponseUtils.java:The signatures (and implementations) implied a broader purpose in ongoing discussions around metrics structures in the protos and SDKs.
Framing it as just part of this RPC obfuscated that role, to me.
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.
OK, re-introduced the 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.
Thanks. Should it live in
metrics.protothough?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.
It is really specific to a particular job, but I don't feel that strongly.
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.
sounds good