[
https://issues.apache.org/jira/browse/FLINK-4563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15615476#comment-15615476
]
ASF GitHub Bot commented on FLINK-4563:
---------------------------------------
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/2650#discussion_r85533501
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/AbstractMetricGroup.java
---
@@ -169,19 +176,7 @@ public String getMetricIdentifier(String metricName) {
* @return fully qualified metric name
*/
public String getMetricIdentifier(String metricName, CharacterFilter
filter) {
- if (scopeString == null) {
- if (filter != null) {
- scopeString = ScopeFormat.concat(filter,
registry.getDelimiter(), scopeComponents);
- } else {
- scopeString =
ScopeFormat.concat(registry.getDelimiter(), scopeComponents);
- }
- }
-
- if (filter != null) {
- return scopeString + registry.getDelimiter() +
filter.filterCharacters(metricName);
- } else {
- return scopeString + registry.getDelimiter() +
metricName;
- }
+ return getMetricIdentifier(metricName, filter, -1);
--- End diff --
If you call `getMetricIdentifier(...)` the reporter index will be passed to
`MetricRegistry#getDelimiter()`. For a negative index this function logs a
warning, assuming that some error has occurred that caused the index to be
negative. Since you pass `-1` as the reporter index you will thus always
trigger a warning.
> [metrics] scope caching not adjusted for multiple reporters
> -----------------------------------------------------------
>
> Key: FLINK-4563
> URL: https://issues.apache.org/jira/browse/FLINK-4563
> Project: Flink
> Issue Type: Bug
> Components: Metrics
> Affects Versions: 1.1.0
> Reporter: Chesnay Schepler
> Assignee: Anton Mushin
>
> Every metric group contains a scope string, representing what entities
> (job/task/etc.) a given metric belongs to, which is calculated on demand.
> Before this string is cached a CharacterFilter is applied to it, which is
> provided by the callee, usually a reporter. This was done since different
> reporters have different requirements in regards to valid characters. The
> filtered string is cached so that we don't have to refilter the string every
> time.
> This all works fine with a single reporter; with multiple however it is
> completely broken as only the first filter is ever applied.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)