Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions helm/charts/nats-operator/templates/natscluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ metadata:
labels:
app: nats
nats_cluster: {{ .Values.cluster.name }}
prometheus: {{ .Values.cluster.metrics.servicemonitor.prometheusInstance }}
{{- with .Values.cluster.metrics.servicemonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
jobLabel: nats-{{ .Values.cluster.name }}
selector:
Expand All @@ -65,6 +67,20 @@ spec:
nats_cluster: {{ .Values.cluster.name }}
endpoints:
- port: metrics
interval: 60s
path: {{ .Values.cluster.metrics.serviceMonitor.path }}
{{- with .Values.cluster.metrics.servicemonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.cluster.metrics.servicemonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- if .Values.cluster.metrics.servicemonitor.metricRelabelings }}
metricRelabelings:
{{ toYaml .Values.cluster.metrics.servicemonitor.metricRelabelings | indent 4 }}
{{- end }}
{{- if .Values.cluster.metrics.servicemonitor.relabelings }}
relabelings:
{{ toYaml .Values.cluster.metrics.servicemonitor.relabelings | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
15 changes: 14 additions & 1 deletion helm/charts/nats-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,17 @@ cluster:
##
servicemonitor:
enabled: false
prometheusInstance: default
# -- Set of labels to transfer from the Kubernetes Service onto the target
additionalLabels: {}
# -- Set how frequently Prometheus should scrape
interval: 60s
# -- Set timeout for scrape
scrapeTimeout: 10s
# -- Set path to metrics path
path: /metrics
# -- Set of labels to transfer from the Kubernetes Service onto the target
targetLabels: []
# -- MetricRelabelConfigs to apply to samples before ingestion
metricRelabelings: []
# -- Set relabel_configs as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
relabelings: []