Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/4757#discussion_r143710507
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandler.java
---
@@ -18,26 +18,48 @@
package org.apache.flink.runtime.rest.handler.legacy.metrics;
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.runtime.dispatcher.DispatcherGateway;
+import org.apache.flink.runtime.rest.handler.HandlerRequest;
+import org.apache.flink.runtime.rest.handler.LegacyRestHandler;
+import
org.apache.flink.runtime.rest.handler.legacy.messages.JobMetricEntry;
+import
org.apache.flink.runtime.rest.handler.legacy.messages.JobMetricEntryList;
+import
org.apache.flink.runtime.rest.handler.legacy.messages.JobMetricIdList;
+import
org.apache.flink.runtime.rest.handler.legacy.messages.JobMetricsOverview;
+import org.apache.flink.runtime.rest.messages.EmptyRequestBody;
+import org.apache.flink.runtime.rest.messages.JobIDPathParameter;
+import org.apache.flink.runtime.rest.messages.JobIDQueryParameter;
+import org.apache.flink.runtime.rest.messages.JobMetricsMessageParameters;
+
+import java.util.Arrays;
+import java.util.List;
import java.util.Map;
+import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
+import java.util.stream.Collectors;
/**
* Request handler that returns for a given job a list of all available
metrics or the values for a set of metrics.
*
* <p>If the query parameters do not contain a "get" parameter the list of
all metrics is returned.
* {@code {"available": [ { "name" : "X", "id" : "X" } ] } }
*
- * <p>If the query parameters do contain a "get" parameter a
comma-separate list of metric names is expected as a value.
- * {@code /get?X,Y}
+ * <p>If the query parameters do contain a "get" parameter, a
comma-separate list of metric names is expected as a value.
+ * {@code ?get=X,Y}
* The handler will then return a list containing the values of the
requested metrics.
* {@code [ { "id" : "X", "value" : "S" }, { "id" : "Y", "value" : "T" } ]
}
*/
-public class JobMetricsHandler extends AbstractMetricsHandler {
+public class JobMetricsHandler extends AbstractMetricsHandler
--- End diff --
I think we should change the handler such that it always returns a
`JobMetricsEntryList` and that you can add filter conditions via
`:jobid/metrics?filter=X,Y` or with get. If you don't specify the get/filter
query parameter, then you get the full list of metrics, otherwise you get the
filtered list. That way we don't have two different return types which we have
to distinguish.
---