Skip to content

Commit

Permalink
Add prometheus service monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
kalmant committed Nov 9, 2020
1 parent 34a94d1 commit 68088f0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions helm-chart/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.prometheus.serviceMonitor.enable }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "marketstore.fullname" . }}
labels:
{{- include "marketstore.labels" . | nindent 4 }}
{{- range $key, $value := .Values.prometheus.serviceMonitor.additionalLabels }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
spec:
endpoints:
- path: /metrics
port: rpc
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "marketstore.selectorLabels" . | nindent 6 }}
{{- end }}
5 changes: 5 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ service:
type: ClusterIP
port: 5993 # Change to 5995 when running with grpc

prometheus:
serviceMonitor:
enable: false
additionalLabels: {}

replicaCount: 1

persistence:
Expand Down

0 comments on commit 68088f0

Please sign in to comment.