y1chi commented on a change in pull request #12570:
URL: https://github.com/apache/beam/pull/12570#discussion_r470203515
##########
File path: sdks/python/apache_beam/metrics/metric.py
##########
@@ -130,10 +130,16 @@ def _matches_name(filter, metric_key):
if not filter.names and not filter.namespaces:
return True
- if ((filter.namespaces and metric_key.metric.namespace in
filter.namespaces)
- or (filter.names and metric_key.metric.name in filter.names)):
- return True
- return False
+ if filter.names and filter.namespaces:
Review comment:
I think the condition is probably better expressed as
if ((filter.namespaces and metric_key.metric.namespace not in
filter.namespaces) or (filter.names and metric_key.metric.name not in
filter.names)):
return False
else:
return True
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]