apache / apache/beam

Better API for querying metrics

Open
#18,341 0 comments 0 reactions 0 assignees View on GitHub
core improvement java P3
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.