Repository navigation
[BEAM-6181] Reporting user counters via MonitoringInfos in Portable Dataflow Runner. - #7202
Conversation
8cee084 to
53990c0
Compare
53990c0 to
f49ed78
Compare
|
@ajamato Please review. |
|
@swegner (committer) |
Portable Dataflow Java Runner.
f49ed78 to
67dce12
Compare
| // todo: run MonitoringInfo through validation process. | ||
| // refer to https://github.com/apache/beam/pull/6799 | ||
|
|
||
| if (urn.startsWith(BEAM_METRICS_USER_PREFIX)) { |
There was a problem hiding this comment.
Architectural suggestion would be to use polymorphism instead of a switch statement,
Make a class/object responsible for each URN.
Though I think much of it can be common, like label extraction/conversion. Let's come up with something that will support some default behaviour and allow you to override it with specific URN needs
There was a problem hiding this comment.
Agree with this one.
I decided to keep it this way for now. Will implement polymorphism when adding support for another counter type.
| .setOriginNamespace(counterNamespace)) | ||
| .setMetadata(new CounterMetadata().setKind("SUM")); | ||
|
|
||
| return new CounterUpdate() |
There was a problem hiding this comment.
This is okay for now, since you are just unpacking the user counter metric. but I want to see this share more code for different metrics later on.
Any label extraction can be shared for example.
There was a problem hiding this comment.
That is a valid point. But I'd prefer to implement this in next PR when I add other type of counters.
| this.transformIdMapping = transformIdMapping; | ||
| } | ||
|
|
||
| // todo: search code for "beam:metrics"... and replace them with relevant enums from |
There was a problem hiding this comment.
Should this be fixed before merging?
There was a problem hiding this comment.
This depends on #6799
Will be implemented in further PRs.
|
|
||
| String type = monitoringInfo.getType(); | ||
|
|
||
| // todomigryz: run MonitoringInfo through validation process. |
There was a problem hiding this comment.
Should this be fixed before merging?
There was a problem hiding this comment.
This requires PR mentioned on next line to go in. (#6799)
Technically, I can copy data from another PR, but format of counters is still being defined. It will cause more merging and resolving in both PRs as well.
I suggest we keep it as is for this PR and generalize/fix it in following PR.
|
LGTM, will squash and merge. |
|
Thank you Scott. |

Plumb user metrics through Portable Dataflow Runner.
Some constants are defined in code that later should be later changed to values defined in this pr.
Code only supports User counters. Other types of counters will be added in another PRs.
Added component level tests. Unittests require more refactoring that will hide the essense of this change.
Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.It will help us expedite review of your Pull Request if you tag someone (e.g.
@username) to look at it.Post-Commit Tests Status (on master branch)