You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "dev-lpq (via GitHub)" <gi...@apache.org> on 2023/08/03 08:48:49 UTC

[GitHub] [kyuubi] dev-lpq opened a new pull request, #5132: [K8S][HELM] Kyuubi add server metrics monitor

dev-lpq opened a new pull request, #5132:
URL: https://github.com/apache/kyuubi/pull/5132

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Integrating Prometheus as the metrics collection method in the Kyuubi Helm Chart simplifies the configuration and deployment process, provides a standardized monitoring solution, and makes monitoring in the Kubernetes cluster more convenient and reliable.
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] dev-lpq commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "dev-lpq (via GitHub)" <gi...@apache.org>.
dev-lpq commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1283898411


##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,31 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }}

Review Comment:
   Added monitoring API check. 



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] dnskr commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "dnskr (via GitHub)" <gi...@apache.org>.
dnskr commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1285200422


##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,33 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}
+{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PodMonitor") .Values.podMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: PodMonitor
+metadata:
+  name: {{ $.Release.Name }}
+  labels:
+    {{- include "kyuubi.labels" . | nindent 4 }}
+spec:
+  selector:
+    matchLabels:
+      app: {{ $.Release.Name }}
+  podMetricsEndpoints:
+    {{- toYaml .Values.podMonitor.podMetricsEndpoint | nindent 4 }}
+{{- end }}
+{{- end -}}

Review Comment:
   ```yaml
   {{- end }}
   ```



##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,33 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}
+{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PodMonitor") .Values.podMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: PodMonitor
+metadata:
+  name: {{ $.Release.Name }}

Review Comment:
   `$` sign is not needed here, please change it to the following code as in `PrometheusRule`
   ```yaml
     name: {{ .Release.Name }}
   ```



##########
charts/kyuubi/templates/kyuubi-servicemonitor.yaml:
##########
@@ -0,0 +1,33 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}

Review Comment:
   ```yaml
   {{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") }}
   ```



##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,33 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}

Review Comment:
   ```yaml
   {{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") }}
   ```



##########
charts/kyuubi/templates/kyuubi-alert.yaml:
##########
@@ -0,0 +1,30 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}

Review Comment:
   Last `-` is not needed. It's not required change, but let's keep one common style across the chart
   ```yaml
   {{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") }}
   ```



##########
charts/kyuubi/templates/kyuubi-servicemonitor.yaml:
##########
@@ -0,0 +1,33 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}
+{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") .Values.serviceMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+  name: {{ $.Release.Name }}
+  labels:
+    {{- include "kyuubi.labels" . | nindent 4 }}
+spec:
+  selector:
+    matchLabels:
+      app: {{ $.Release.Name }}
+  endpoints:
+    {{- toYaml .Values.serviceMonitor.endpoints | nindent 4 }}
+{{- end }}
+{{- end -}}

Review Comment:
   ```yaml
   {{- end }}
   ```



##########
charts/kyuubi/templates/kyuubi-servicemonitor.yaml:
##########
@@ -0,0 +1,33 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}
+{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") .Values.serviceMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+  name: {{ $.Release.Name }}

Review Comment:
   `$` sign is not needed here, please change it to the following code as in `PrometheusRule`
   ```yaml
     name: {{ .Release.Name }}
   ```



##########
charts/kyuubi/templates/kyuubi-alert.yaml:
##########
@@ -0,0 +1,30 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}
+{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") .Values.prometheusRule.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: PrometheusRule
+metadata:
+  name: {{ .Release.Name }}
+  labels:
+    {{- include "kyuubi.labels" . | nindent 4 }}
+spec:
+  groups:
+    {{- toYaml .Values.prometheusRule.groups | nindent 4 }}
+{{- end }}
+{{- end -}}

Review Comment:
   Please change it `{{- end }}` to follow one common style.



##########
charts/kyuubi/values.yaml:
##########
@@ -116,6 +116,16 @@ server:
       nodePort: ~
       annotations: {}
 
+  # Exposes metrics in Prometheus format
+  prometheus:
+    enabled: true
+    port: 10019
+    service:
+      type: ClusterIP
+      port: "{{ .Values.server.prometheus.port }}"
+      nodePort: ~
+      annotations: {}

Review Comment:
   I cannot find how these values are used. Did you missed something in the commit?



##########
charts/kyuubi/templates/kyuubi-servicemonitor.yaml:
##########
@@ -0,0 +1,33 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}
+{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") .Values.serviceMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+  name: {{ $.Release.Name }}
+  labels:
+    {{- include "kyuubi.labels" . | nindent 4 }}
+spec:
+  selector:
+    matchLabels:
+      app: {{ $.Release.Name }}

Review Comment:
   `$` sign is not needed here, please change it to the following code as in `PrometheusRule`
   ```yaml
     name: {{ .Release.Name }}
   ```



##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,33 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}
+{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PodMonitor") .Values.podMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: PodMonitor
+metadata:
+  name: {{ $.Release.Name }}
+  labels:
+    {{- include "kyuubi.labels" . | nindent 4 }}
+spec:
+  selector:
+    matchLabels:
+      app: {{ $.Release.Name }}

Review Comment:
   `$` sign is not needed here, please change it to the following code as in `PrometheusRule`
   ```yaml
     name: {{ .Release.Name }}
   ```



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] zwangsheng commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "zwangsheng (via GitHub)" <gi...@apache.org>.
zwangsheng commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1283057677


##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,31 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }}

Review Comment:
   How about we add some api check, like `if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PodMonitor"`. You can find this is helm doc.
   
   https://helm.sh/docs/chart_template_guide/builtin_objects/#:~:text=Capabilities.APIVersions%20is%20a%20set%20of%20versions.%20Capabilities.APIVersions.Has%20%24version,resource%20%28e.g.%2C%20apps%2Fv1%2FDeployment%29%20is%20available%20on%20the%20cluster.
   
   > Capabilities.APIVersions.Has $version indicates whether a version (e.g., batch/v1) or resource (e.g., apps/v1/Deployment) is available on the cluster.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] dev-lpq commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "dev-lpq (via GitHub)" <gi...@apache.org>.
dev-lpq commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1285327713


##########
charts/kyuubi/templates/kyuubi-alert.yaml:
##########
@@ -0,0 +1,30 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") -}}

Review Comment:
   I think this is needed, Prometheus monitoring is built under `(eq .Values.metricsReporters "PROMETHEUS")`. And the port `10019` is the Prometheus metrics HTTP server port. As mentioned in `Why are the changes needed?`, Integrating Prometheus as the metrics collection method in the Kyuubi Helm Chart simplifies the configuration and deployment process, provides a standardized monitoring solution, and makes monitoring in the Kubernetes cluster more convenient and reliable.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] zwangsheng commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "zwangsheng (via GitHub)" <gi...@apache.org>.
zwangsheng commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1285328086


##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,31 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }}

Review Comment:
   I'm fine with default disabled create Prometheus Operator related CRDs and remove api check.
   
   Sounds reasonable, the user should enable this feature in the case that  Prometheus Operator related CRDs already exists, and if it does not match, throws an obvious error.
   
   WDYT? @pan3793 



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 closed pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor
URL: https://github.com/apache/kyuubi/pull/5132


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] dnskr commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "dnskr (via GitHub)" <gi...@apache.org>.
dnskr commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1286106362


##########
charts/kyuubi/values.yaml:
##########
@@ -116,6 +116,16 @@ server:
       nodePort: ~
       annotations: {}
 
+  # Exposes metrics in Prometheus format
+  prometheus:
+    enabled: true
+    port: 10019
+    service:
+      type: ClusterIP
+      port: "{{ .Values.server.prometheus.port }}"
+      nodePort: ~
+      annotations: {}

Review Comment:
   Great! I missed that, sorry.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] dev-lpq commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "dev-lpq (via GitHub)" <gi...@apache.org>.
dev-lpq commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1285330549


##########
charts/kyuubi/values.yaml:
##########
@@ -116,6 +116,16 @@ server:
       nodePort: ~
       annotations: {}
 
+  # Exposes metrics in Prometheus format
+  prometheus:
+    enabled: true
+    port: 10019
+    service:
+      type: ClusterIP
+      port: "{{ .Values.server.prometheus.port }}"
+      nodePort: ~
+      annotations: {}

Review Comment:
   <img width="1170" alt="Screenshot 2023-08-07 at 10 45 50" src="https://github.com/apache/kyuubi/assets/43336508/f3e1d136-181d-4b19-ad30-746006eb8072">
   it is wrapped in a loop



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#issuecomment-1663795895

   cc @zwangsheng 


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#issuecomment-1680023859

   Thanks, merged to master


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] dnskr commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "dnskr (via GitHub)" <gi...@apache.org>.
dnskr commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1285199542


##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,31 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }}

Review Comment:
   Am I right that Prometheus Operator and related CRDs are required to be installed for `PrometheusRule`, `PodMonitor` and `ServiceMonitor` to be used?
   If so, it makes sense and is enough to just disable resource creation by default instead of making API check, i.e. set the following default values and revert API checks:
   ```yaml
   podMonitor:
     enabled: false
     ...
   
   serviceMonitor:
     enabled: false
     ...
   
   prometheusRule:
     enabled: false
     ...
   ```
   It is more preferable behavior to create the resource if `enabled=true`, even if the resource cannot be used in the Kubernetes cluster. For example, a user can deploy Kyuubi helm chart with enabled `ServiceMonitor` (ServiceMonitor resource will be created) to the cluster without Prometheus Operator, add Prometheus Operator later and everything will work as expected. In the current implementation with API checks a user will need to run `helm upgrade` command explicitly to trigger ServiceMonitor resource creation.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] dev-lpq commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "dev-lpq (via GitHub)" <gi...@apache.org>.
dev-lpq commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1285324280


##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,31 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }}

Review Comment:
   Yeah, I believe that disabling resource creation by default instead of creating API checks is better. Because `(.Capability.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor")` cannot be locally rendered. What do you think? @zwangsheng 



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] zwangsheng commented on a diff in pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "zwangsheng (via GitHub)" <gi...@apache.org>.
zwangsheng commented on code in PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#discussion_r1283057677


##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -0,0 +1,31 @@
+{{/*
+  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.
+*/}}
+
+{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }}

Review Comment:
   How about we add some api check, like `if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PodMonitor"`. You can find this in [helm doc](https://helm.sh/docs/chart_template_guide/builtin_objects/#:~:text=Capabilities.APIVersions%20is%20a%20set%20of%20versions.%20Capabilities.APIVersions.Has%20%24version,resource%20%28e.g.%2C%20apps%2Fv1%2FDeployment%29%20is%20available%20on%20the%20cluster.).
   
   > Capabilities.APIVersions.Has $version indicates whether a version (e.g., batch/v1) or resource (e.g., apps/v1/Deployment) is available on the cluster.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] codecov-commenter commented on pull request #5132: [K8S][HELM] Kyuubi add server metrics monitor

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #5132:
URL: https://github.com/apache/kyuubi/pull/5132#issuecomment-1663803355

   ## [Codecov](https://app.codecov.io/gh/apache/kyuubi/pull/5132?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#5132](https://app.codecov.io/gh/apache/kyuubi/pull/5132?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (7362aaf) into [master](https://app.codecov.io/gh/apache/kyuubi/commit/224ae7cc4f1617f9afb69452ba05f09837e5e42b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (224ae7c) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   ```diff
   @@          Coverage Diff           @@
   ##           master   #5132   +/-   ##
   ======================================
     Coverage    0.00%   0.00%           
   ======================================
     Files         566     566           
     Lines       31530   31530           
     Branches     4116    4116           
   ======================================
     Misses      31530   31530           
   ```
   
   
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org