apache / apache/beam

Consider adding MetricFiltering classes for metrics names with urns and labels.

Open
#20,852 0 comments 0 reactions 0 assignees View on GitHub
P3 sdk-ideas tests
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

These classes today can only filter metrics with user metric names. Which are defined with a namespace and name string.

But does not allow filtering metrics defined with a URN **** labels.

I.e. those defined with the MonitoringInfoMetricName class instead of the MetricName class.

Having this sort of MetricName filtering class would be useful for some SDK/runner use cases such as the metric filtering in MetricContainerImpl.matchMetric.

We could consider updating the MetricFiltering, MetricNameFilter, MetricFilter, etc. classes with a way to filter metrics defined by URN and laels.

The problem with doing this though, is that those classes were originally intended to be a public set of methods for querying metrics within your pipeline code. So a better solution would be to have a layer for the public API to do filtering, and an internal layer which can filter based on any MetricName type, including MonitoringInfoMetric name.

And allow building it based on specific rules, such as hasUrn, hasLabelKey, hasLabelKeyValuePair, etc.)

 

 

Imported from Jira [BEAM-12116](https://issues.apache.org/jira/browse/BEAM-12116). Original Jira may contain additional context.
Reported by: ajamato@google.com.

Contributor guide

Open the contributing guide

Research direction

Start by reading MetricFiltering, MetricNameFilter, MetricFilter, MonitoringInfoMetricName, and MetricContainerImpl.matchMetric to understand the existing filtering boundary. Done means defining how URN- and label-based metrics can be filtered while distinguishing the public API from internal filtering needs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.