Better API for querying metrics
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
I just want to read a metric :-).
Can we have a better API than this:
Iterable\> seenMetrics = job.metrics()
.queryMetrics(
MetricsFilter.builder()
.addNameFilter(MetricNameFilter.named("XX", "YY"))
.build())
.counters();
long seenSentinels = Iterables.isEmpty(seenMetrics) ? 0
: Iterables.getFirst(seenMetrics, null).committed();
This is very clunky :-P.
Ideally I'd like to read a metric with a name, and provide a default value if the metric is not there.
Imported from Jira [BEAM-2046](https://issues.apache.org/jira/browse/BEAM-2046). Original Jira may contain additional context.
Reported by: malo@google.com.
Contributor guide
Research direction
The issue names no repository files, tests, or entry points. Start by locating the Java metrics API behind job.metrics() and queryMetrics(), then review existing metric access patterns; done means an agreed API can read a named metric and return a default when it is absent.
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
- 25/100