[
https://issues.apache.org/jira/browse/FLINK-9789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16538446#comment-16538446
]
ASF GitHub Bot commented on FLINK-9789:
---------------------------------------
GitHub user zentol opened a pull request:
https://github.com/apache/flink/pull/6292
[FLINK-9789][metrics] Ensure uniqueness of watermark metrics
## What is the purpose of the change
This PR ensures that all registered watermark metric objects are only
registered once; shared gauges must be wrapped and registered separately to
avoid collisions in reporters which generally assume that metric objects are
unique.
## Brief change log
* ensure uniqueness by wrapping re-used metrics in
`[One|Two]InputStreamTask` and `OperatorChain`
* add `InterceptingTaskMetricGroup` to gather registered metrics
* modify `[One|Two]InputStreamTask#testWatermarkMetrics` to check
uniqueness of registered objects, and cover re-use for tasks
## Verifying this change
* run `[One|Two]InputStreamTask#testWatermarkMetrics`
* run any streaming job and check existence of all watermark metrics for
task and operator
* (via REST API: /job/<job_id>/vertices/<vertex_id>/metrics)
* see the [metrics
documentation](https://ci.apache.org/projects/flink/flink-docs-master/monitoring/metrics.html#io)
for a list of expected metrics
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zentol/flink 9789
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/6292.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #6292
----
commit 4a7a0c6114893250e625dc36d953209de22ce57e
Author: zentol <chesnay@...>
Date: 2018-07-10T11:27:34Z
[FLINK-9789][metrics] Ensure uniqueness of watermark metrics
----
> Watermark metrics for an operator&task shadow each other
> --------------------------------------------------------
>
> Key: FLINK-9789
> URL: https://issues.apache.org/jira/browse/FLINK-9789
> Project: Flink
> Issue Type: Bug
> Components: Metrics
> Affects Versions: 1.5.0, 1.6.0
> Reporter: Chesnay Schepler
> Assignee: Chesnay Schepler
> Priority: Blocker
> Labels: pull-request-available
> Fix For: 1.5.2, 1.6.0
>
>
> In FLINK-4812 we reworked the watermark metrics to be exposed for each
> operator.
> In FLINK-9467 we made further modifications to also expose these metrics
> again for tasks.
> In both JIRAs we register a single metric multiple times, for example the
> input watermark metric is registered for both the first operator in the task,
> and the task itself.
> Unfortunately, the metric system assumes metric objects to be unique, as can
> be seen in virtually all reporter implementations as well as the
> MetricQueryService.
> As a result the watermark metrics override each other in the reporter,
> causing only one to be reported, whichever was registered last.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)