Skip to content

Commit

Permalink
[KYUUBI apache#6845] Support additional labels for PodMonitor to be d…
Browse files Browse the repository at this point in the history
…iscovered by Prometheus

### Why are the changes needed?
the prometheus can not discover the podMonitor created by kyuubi helm chart.

### How was this patch tested?
1. enable pod monitor:
```
metrics:
  # Enable metrics system, used for 'kyuubi.metrics.enabled' property
  enabled: true
  # A comma-separated list of metrics reporters, used for 'kyuubi.metrics.reporters' property
  reporters: PROMETHEUS
  # Prometheus port, used for 'kyuubi.metrics.prometheus.port' property
  prometheusPort: 10019

  # PodMonitor by Prometheus Operator
  podMonitor:
    # Enable PodMonitor creation
    enabled: true
    # List of pod endpoints serving metrics to be scraped by Prometheus, see Prometheus Operator docs for more details
    #podMetricsEndpoints: []
    podMetricsEndpoints:
      - path: /metrics
        port: prometheus
```
2. Helm install kyuubi .
3. check prometheus web ui.

### Was this patch authored or co-authored using generative AI tooling?
No

Closes apache#6845 from eric9204/add-lab-to-pm.

Closes apache#6845

4d713a0 [Cheng Pan] Update charts/kyuubi/values.yaml
f8fa51f [dongsj] resolve conflicts with master

Lead-authored-by: dongsj <[email protected]>
Co-authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
eric9204 and pan3793 committed Dec 10, 2024
1 parent 99e27d4 commit ee7e234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/kyuubi/templates/kyuubi-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ metadata:
name: {{ .Release.Name }}
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
{{- if .Values.metrics.podMonitor.labels }}
{{- toYaml .Values.metrics.podMonitor.labels | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
2 changes: 2 additions & 0 deletions charts/kyuubi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ metrics:
# podMetricsEndpoints:
# - path: /metrics
# port: prometheus
# Additional labels for PodMonitor to be discovered by Prometheus
labels: {}

# ServiceMonitor by Prometheus Operator
serviceMonitor:
Expand Down

0 comments on commit ee7e234

Please sign in to comment.