Skip to content

Commit

Permalink
feat: add podmonitor (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Jul 29, 2024
1 parent 6a8ea75 commit 64a3107
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/databend-meta/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.9.0
version: 0.9.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
16 changes: 16 additions & 0 deletions charts/databend-meta/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.podMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "databend-meta.fullname" . }}
labels:
{{- include "databend-meta.labels" . | nindent 4 }}
spec:
jobLabel: {{ include "databend-meta.fullname" . }}
selector:
matchLabels:
{{- include "databend-meta.selectorLabels" . | nindent 6 }}
endpoints:
- port: {{ .Values.podMonitor.port }}
path: /v1/metrics
{{- end }}
6 changes: 6 additions & 0 deletions charts/databend-meta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ service:
# Annotations to add to the service
annotations: {}

# mutually exclusive with podMonitor
serviceMonitor:
enabled: false
port: admin

# mutually exclusive with serviceMonitor
podMonitor:
enabled: false
port: admin

# would be ignored if `existingConfigMap` is set
config:
clusterName: databend
Expand Down
2 changes: 1 addition & 1 deletion charts/databend-query/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.10.0
version: 0.10.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
15 changes: 15 additions & 0 deletions charts/databend-query/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.podMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "databend-query.fullname" . }}
labels:
{{- include "databend-query.labels" . | nindent 4 }}
spec:
jobLabel: {{ include "databend-query.fullname" . }}
selector:
matchLabels:
{{- include "databend-query.selectorLabels" . | nindent 6 }}
endpoints:
- port: {{ .Values.podMonitor.port }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/databend-query/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@ envs: []
# - name: SENTRY_TRACES_SAMPLE_RATE
# value: "0.5"


# mutually exclusive with podMonitor
serviceMonitor:
enabled: false
port: metric

# mutually exclusive with serviceMonitor
podMonitor:
enabled: false
port: metric

# Config settings to go into the mounted config.toml
config:
# [query]
Expand Down

0 comments on commit 64a3107

Please sign in to comment.