[ 
https://issues.apache.org/jira/browse/BEAM-6022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16680006#comment-16680006
 ] 

Lukasz Gajowy commented on BEAM-6022:
-------------------------------------

Even more context: https://github.com/apache/beam/pull/6987

> Metrics of the same name and type are created multiple times
> ------------------------------------------------------------
>
>                 Key: BEAM-6022
>                 URL: https://issues.apache.org/jira/browse/BEAM-6022
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Lukasz Gajowy
>            Assignee: Kenneth Knowles
>            Priority: Major
>
> I noticed that when the below (or any other metric type) is called multiple 
> times:
> {code:java}
> Metrics.counter("namespace", "name");{code}
> metrics of the same name and type are created. So when such metrics are 
> queried by name:
> {code:java}
> MetricQueryResults metrics =
>     result
>         .metrics()
>         .queryMetrics(
>             MetricsFilter.builder()
>                 .addNameFilter(MetricNameFilter.named(namespace, name))
>                 .build());
> Iterable<MetricResult<Long>> counters = metrics.getCounters();{code}
> there is ambiguity which MetricResult should be chosen. 
> Should api users obtain one metric result here?
> Should api users  merge the counter results if there are multiple returned?
> I noticed that all of the results contain the same value (not sure if this is 
> always the case). Should api users read only one of the multiple results to 
> get correct metric?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to