You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by GitBox <gi...@apache.org> on 2022/02/17 16:13:53 UTC

[GitHub] [flink-kubernetes-operator] Aitozi commented on a change in pull request #6: [FLINK-26183] Support metrics using the Flink metric system

Aitozi commented on a change in pull request #6:
URL: https://github.com/apache/flink-kubernetes-operator/pull/6#discussion_r809219319



##########
File path: flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/metrics/KubernetesOperatorMetricGroup.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.metrics;
+
+import org.apache.flink.metrics.CharacterFilter;
+import org.apache.flink.runtime.metrics.MetricRegistry;
+import org.apache.flink.runtime.metrics.dump.QueryScopeInfo;
+import org.apache.flink.runtime.metrics.groups.AbstractMetricGroup;
+
+/** Flink based operator metric group. */
+public class KubernetesOperatorMetricGroup extends AbstractMetricGroup<AbstractMetricGroup<?>> {
+
+    private static final String GROUP_NAME = "kubernetes-operator";
+
+    private KubernetesOperatorMetricGroup(MetricRegistry registry, String hostname) {
+        super(registry, new String[] {hostname, GROUP_NAME}, null);

Review comment:
       Do we need to inject other more specific information about the operator like: namespace/podName/cluster and so on. I think here can be extendable so that we can distinguish the different operator's metrics. 
   Besides, I suggest to implement the `putVariables` method like other metricGroup do, So that we can extract the variables in metricReporter.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org