Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
MetricGroup#getAllVariables returns all variables associated with the metric, for example:
<job_id> = abcde <subtask_index> = 0
The keys are surrounded by brackets for no particular reason.
In virtually every use-case for this method the user is stripping the brackets from keys, as done in:
- our datadog reporter: https://github.com/apache/flink/blob/9c3c8afbd9325b5df8291bd831da2d9f8785b30a/flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpReporter.java#L244
- our prometheus reporter (implicitly via a character filter): https://github.com/apache/flink/blob/9c3c8afbd9325b5df8291bd831da2d9f8785b30a/flink-metrics/flink-metrics-prometheus/src/main/java/org/apache/flink/metrics/prometheus/AbstractPrometheusReporter.java#L236
- our JMX reporter: https://github.com/apache/flink/blob/9c3c8afbd9325b5df8291bd831da2d9f8785b30a/flink-metrics/flink-metrics-jmx/src/main/java/org/apache/flink/metrics/jmx/JMXReporter.java#L223
Public Interfaces
MetricGroup#getAllVariables
Proposed Changes
Change the method spec and implementation to remove the brackets around keys.
For migration purposes it may make sense to add a new method with the new behavior (getVariables()
) and deprecate the old method.
Compatibility, Deprecation, and Migration Plan
- What impact (if any) will there be on existing users?
- Existing users need to adjust their code to no longer strip the first and last character (e.g., what the datadog reporter does). Filter-based approaches will not be impacted.
- If we are changing behavior how will we phase out the older behavior?
- We don't have a well-defined process for breaking behavioral changes. We could consider adding a new method with a different name.