Skip to content

Commit

Permalink
feat: Add serviceMonitor resource
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Gupta <[email protected]>
  • Loading branch information
Shubham Gupta committed Apr 24, 2024
1 parent 0e215f0 commit 437c915
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions charts/opensearch/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "opensearch.uname" . }}-service-monitor
namespace: {{ .Release.Namespace }}
labels:
{{- include "opensearch.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "opensearch.labels" . | nindent 4 }}
endpoints:
- port: {{ .Values.metricsPort }}
interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,8 @@ extraObjects: []
# selector:
# matchLabels:
# {{- include "opensearch.selectorLabels" . | nindent 6 }}

serviceMonitor:
enabled: false
path: /metrics
interval: 10s

0 comments on commit 437c915

Please sign in to comment.