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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]