Skip to content

[BEAM-4775] Add GetJobMetrics RPC. - #8018

Merged
robertwb merged 1 commit into
apache:masterfrom
robertwb:get-metrics
Mar 8, 2019
Merged

robertwb merged 1 commit into
apache:masterfrom
robertwb:get-metrics

Conversation

@robertwb

@robertwb robertwb commented Mar 8, 2019

Copy link
Copy Markdown
Contributor

This just adds the RPC to the Jobs API.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Python Build Status
Build Status
--- Build Status
Build Status
Build Status --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@robertwb

robertwb commented Mar 8, 2019

Copy link
Copy Markdown
Contributor Author

R: @ryan-williams @ajamato

@ryan-williams ryan-williams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think making it clear that GetJobMetricsResponse is a proto representation of SDKs' MetricResults is preferable, but I'll defer to you.

}

// All metrics for a given job. Runners may support one or the other or both.
message GetJobMetricsResponse {

Copy link
Copy Markdown
Contributor

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.java was originally GetJobMetricsResponseUtils.java:

public class GetJobMetricsResponseUtils {
  public static GetJobMetricsResponse   toProto(        MetricResults metricResults) { … }
  public static         MetricResults fromProto(GetJobMetricsResponse          resp) { … }
}

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.

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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.proto though?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

MetricsResults metrics = 1;
}

// All metrics for a given job. Runners may support one or the other or both.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's acceptable to populate committed only as well.

}

// All metrics for a given job. Runners may support one or the other or both.
message GetJobMetricsResponse {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

@robertwb
robertwb merged commit 4d20f37 into apache:master Mar 8, 2019

// All metrics for a given job. Runners may support one or the other or both.
message MetricsResults {
org.apache.beam.model.pipeline.v1.MonitoringInfo attempted = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh, these were supposed to be repeated, I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants