Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
FLIP-274: Introduce metric group for OperatorCoordinator introduced a new metric group for source enumerators to emit metrics. However, there is no way from the Flink REST API to fetch these metrics.
The current metric related REST APIs are the following:
/jobmanager/metrics /taskmanagers/<taskmanagerid>/metrics /jobs/<jobid>/metrics /jobs/<jobid>/vertices/<vertexid>/subtasks/<subtaskindex> Request metrics aggregated across all entities of the respective type: /taskmanagers/metrics /jobs/metrics /jobs/<jobid>/vertices/<vertexid>/subtasks/metrics
For example, these APIs allow external services to fetch subtask metrics.
Public Interfaces
The REST API needs to change to support this.
Proposed Changes
Thus, I propose a new REST API
/jobs/<jobid>/vertices/<vertexid>/operators/<operatorid>/metrics
with the query parameter get
that accepts comma separated metric names, like the other APIs. This path is based on https://github.com/apache/flink/blob/7bebd2d9fac517c28afc24c0c034d77cfe2b43a6/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/QueryScopeInfo.java#L234.
Compatibility, Deprecation, and Migration Plan
No compatibility concerns as this is introducing a new API without modifying older APIs.
Test Plan
Unit tests.
Rejected Alternatives
None.