-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-3563] Adding User metric proto to PTransform metrics proto. #4544
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
Conversation
| metrics.cells.DistributionData.from_runner_api( | ||
| proto.distribution_data)) | ||
| for step, step_metric in step_metrics.items(): | ||
| print step |
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.
debugging
| message User { | ||
|
|
||
| // A key for identifying a metric at the most granular level. | ||
| message MetricKey { |
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.
We should probably be calling this a MetricName to avoid confusion with the MetricKey class in Java/Python that contains a step id.
| metrics.cells.DistributionData.from_runner_api( | ||
| proto.distribution_data)) | ||
| for step, step_metric in step_metrics.items(): | ||
| print step |
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.
robertwb wrote:
debugging
Uff. Sorry about that. Removed.
| message User { | ||
|
|
||
| // A key for identifying a metric at the most granular level. | ||
| message MetricKey { |
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.
robertwb wrote:
We should probably be calling this a MetricName to avoid confusion with the MetricKey class in Java/Python that contains a step id.
In that case, I've moved the runner translations to the MetricName class. Let me know what you think. I named it metric_name, because within it there's another name field.
| } | ||
|
|
||
| // Data associated with a counter metric. | ||
| message CounterData { |
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.
Incidentally, these make sense at the top level and I have a slight preference for keeping as many things toplevel as possible unless these is a compelling reason to do otherwise. There is usually no downside.
Here it is a particular readability problem:
Useris very misleading if not fully qualified, versus e.g.MetricData- great distance between the start of the message and the fields
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.
(and is MetricData the same as the existing MetricUpdate? Luke and I chatted and I came away unsure)
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.
Moving stuff to not be nested is an independent change to what was asked. @kennknowles, if you would like to take on that change, feel free to do so.
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 might, depending on how much this proto enters my life. But we should fix the misleading name either way.
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.
BTW I don't know of a public discussion where I could gain context on this change. Can you link to that and/or public design doc on user-defined metrics in portability?
Anyhow I'm just providing drive-by feedback on the protos since I tried to use them and it isn't really clear why they are the way they are. I'm sure I can power through and make it work, but it isn't great for people not in our office.
|
|
||
| def to_runner_api(self): | ||
| return beam_fn_api_pb2.Metrics.User.DistributionData( | ||
| return beam_fn_api_pb2.Metrics.PTransform.User.DistributionData( |
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'm just the peanut gallery, of course, but this doesn't seem clearer at all than beam_fn_api_pb2.DistributionData(...)
robertwb
left a comment
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.
LGTM. Could you squash your commits?
| [beam_fn_api_pb2.Metrics.User( | ||
| key=beam_fn_api_pb2.Metrics.User.MetricKey( | ||
| step=self.step_name, namespace=k.namespace, name=k.name), | ||
| metric_name=beam_fn_api_pb2.Metrics.User.MetricName( |
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.
Perhaps use k.to_runner_api() here?
a1e06aa to
2de70ff
Compare
|
Thanks Robert. Done. |
|
Retest this please. |
|
Ready to merge : ) |
|
Known flake in gradle build. I don't think we should hold up the proto changes for that. |
Let me know if this looks good!
r: @robertwb
cc: @lukecwik @kennknowles