De-javafy the Python Metrics API
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 205
Description
For example, though Java forces one to put all stand-alone functions as static methods on a class (like Metrics) in Python one would just have standard module-level functions.
Also, the MetricsFilter builder pattern is very Java-esque (and verbose). In Python, one would simply let result.metrics() take keyword arguments.
We should seriously consider aggregating rather than returning lists of results, at least by default. E.g. in https://github.com/apache/beam/blob/master/sdks/python/apache_beam/examples/wordcount.py it assumes that there's no other metric with the given name in any subtransform (otherwise it may deterministically grab the "wrong" one.)
Imported from Jira [BEAM-3046](https://issues.apache.org/jira/browse/BEAM-3046). Original Jira may contain additional context.
Reported by: robertwb.
Contributor guide
Research direction
Start by reading the Python Metrics API and the example at sdks/python/apache_beam/examples/wordcount.py, then trace MetricsFilter and result.metrics(). The issue does not define a settled API shape or acceptance criteria; completion would require agreeing on the Python-style interface and aggregation behavior before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data-engineering
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100