Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Public Interfaces

The REST API needs to change to support thisadd an endpoint and add a new field to an existing response body.

Proposed Changes

Thus, I propose a new REST API

...

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.

In addition, this needs to expose way for users to discover all the operator ids for the path parameter. Following the convention of vertex id and subtask index, the way to discover such information is the job graph that is returned by `/jobs/<jobid>/plan`.

Thus, I propose to add a new field in the response of the form

Code Block
/jobs/<jobid>/plan Response
{
	...
	"operators": [
		{
			"id": "1"
		},
		{
			"id": "2"
		},
		...
	]
}


In addition, the internal JobManagerOperatorQueryScopeInfo  will need to support indexing by operator id, instead of operator name. The operator id uniquely identifies an operator and on the contrary, the operator name does not (it may be empty or repeated between operators by the user).

Compatibility, Deprecation, and Migration Plan

No compatibility concerns as this is introducing a new API without modifying older APIs. The code modifications are otherwise to internal code.

Test Plan

Unit tests.

Rejected Alternatives

...