Skip to content

Commit

Permalink
feat: add serviceMonitor in the helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
SamYSF committed Jun 13, 2024
1 parent d6162c7 commit c499476
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions helm/api-testing/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "api-testing.fullname" . }}-servicemonitor
labels:
{{- include "api-testing.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "api-testing.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
interval: 15s
path: /metrics
12 changes: 12 additions & 0 deletions helm/api-testing/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,15 @@ affinity: {}

mongodb:
enabled: false

serviceMonitor:
enabled: true
interval: 15s
path: /metrics
additionalLabels: {}

# ref: https://www.ga0x.com/blog/2024/04/04/helm-prometheus-operator-servicemonitor-podmonitor-not-work
prometheus:
prometheusSpec:
podMonitorSelectorNilUsesHelmValues: false
serviceMonitorSelectorNilUsesHelmValues: false

0 comments on commit c499476

Please sign in to comment.