apache / apache/beam

De-javafy the Python Metrics API

Open
#18,597 0 comments 0 reactions 0 assignees View on GitHub
community-onboarding core good first issue improvement P3 python
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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.