Code of Conduct
Search before asking
What would you like to be improved?
Current monitoring configuration in the Helm chart seems to be inconsistent and not convenient to use.
Inconsistency
Property monitoring.prometheus.enabled is used for kyuubi.metrics.enabled which seems to be confusing, because metrics can be enabled without PROMETHEUS reporter. Also using monitoring.prometheus.enabled in PrometheusRule, ServiceMonitor and PodMonitor conditions is redundant, because having PROMETHEUS in metricsReporters is enough for the check.
Bug
The following conditions check if metricsReporters equal to PROMETHEUS:
|
{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.prometheusRule.enabled }} |
|
{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }} |
|
{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.serviceMonitor.enabled }} |
However,
metricsReporters is used to initialize
kyuubi.metrics.reporters which is
a comma-separated list for all metrics reporters. I.e.
metricsReporters can be also
PROMETHEUS,CONSOLE,
JMX,PROMETHEUS,CONSOLE etc.
The implementation should consider such cases in the conditions and check if
PROMETHEUS included into the comma-separated list.
The command renders PrometheusRule:
helm template kyuubi charts/kyuubi --set prometheusRule.enabled=true --set metricsReporters="PROMETHEUS" --show-only templates/kyuubi-alert.yaml
These commands also should render PrometheusRule:
helm template kyuubi charts/kyuubi --set prometheusRule.enabled=true --set metricsReporters="JMX\,PROMETHEUS" --show-only templates/kyuubi-alert.yaml
helm template kyuubi charts/kyuubi --set prometheusRule.enabled=true --set metricsReporters="PROMETHEUS\,CONSOLE" --show-only templates/kyuubi-alert.yaml
helm template kyuubi charts/kyuubi --set prometheusRule.enabled=true --set metricsReporters="JMX\,PROMETHEUS\,CONSOLE" --show-only templates/kyuubi-alert.yaml
How should we improve?
Fix the bug and change values structure, for instance to the following:
metrics:
# Use for kyuubi.metrics.enabled value
enabled: true
# Use for kyuubi.metrics.reporters value
reporters: PROMETHEUS
# Use for kyuubi.metrics.prometheus.port value and for the chart templates
prometheusPort: 10019
# Move inside "metrics" tree to keep monitoring related configs together
podMonitor:
enabled: false
...
# Move inside "metrics" tree to keep monitoring related configs together
serviceMonitor:
enabled: false
...
# Move inside "metrics" tree to keep monitoring related configs together
prometheusRule:
enabled: false
...
Are you willing to submit PR?
Code of Conduct
Search before asking
What would you like to be improved?
Current monitoring configuration in the Helm chart seems to be inconsistent and not convenient to use.
Inconsistency
Property
monitoring.prometheus.enabledis used forkyuubi.metrics.enabledwhich seems to be confusing, because metrics can be enabled withoutPROMETHEUSreporter. Also usingmonitoring.prometheus.enabledinPrometheusRule,ServiceMonitorandPodMonitorconditions is redundant, because havingPROMETHEUSinmetricsReportersis enough for the check.Bug
The following conditions check if
metricsReportersequal toPROMETHEUS:kyuubi/charts/kyuubi/templates/kyuubi-alert.yaml
Line 18 in 8f37390
kyuubi/charts/kyuubi/templates/kyuubi-podmonitor.yaml
Line 18 in 8f37390
kyuubi/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
Line 18 in 8f37390
However,
metricsReportersis used to initializekyuubi.metrics.reporterswhich is a comma-separated list for all metrics reporters. I.e.metricsReporterscan be alsoPROMETHEUS,CONSOLE,JMX,PROMETHEUS,CONSOLEetc.The implementation should consider such cases in the conditions and check if
PROMETHEUSincluded into the comma-separated list.The command renders
PrometheusRule:helm template kyuubi charts/kyuubi --set prometheusRule.enabled=true --set metricsReporters="PROMETHEUS" --show-only templates/kyuubi-alert.yamlThese commands also should render
PrometheusRule:How should we improve?
Fix the bug and change values structure, for instance to the following:
Are you willing to submit PR?