Skip to content

Commit

Permalink
Add serviceMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
djjudas21 committed Aug 28, 2024
1 parent fbc40fd commit e1ddbc7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
28 changes: 28 additions & 0 deletions dist/charts/ping-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "ping_exporter.fullname" . }}
labels:
{{- include "ping_exporter.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "ping_exporter.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
interval: 60s
relabelings:
- action: labeldrop
regex: pod
sourceLabels: []
- action: labeldrop
regex: namespace
sourceLabels: []
- action: labeldrop
regex: instance
sourceLabels: []
- action: labeldrop
regex: job
sourceLabels: []
{{- end }}
4 changes: 4 additions & 0 deletions dist/charts/ping-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ config:
timeout: 3s
history-size: 42
payload-size: 120

# Create a serviceMonitor resource to be consumed by Prometheus Operator
serviceMonitor:
enabled: false

0 comments on commit e1ddbc7

Please sign in to comment.