diff --git a/helm/api-testing/templates/servicemonitor.yaml b/helm/api-testing/templates/servicemonitor.yaml new file mode 100644 index 000000000..cfaf59ebf --- /dev/null +++ b/helm/api-testing/templates/servicemonitor.yaml @@ -0,0 +1,16 @@ +{{- if .Values.serviceMonitor.enabled }} +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: {{ .Values.serviceMonitor.interval }} + path: /metrics +{{- end }} \ No newline at end of file diff --git a/helm/api-testing/values.yaml b/helm/api-testing/values.yaml index c6391573b..0be34f41d 100644 --- a/helm/api-testing/values.yaml +++ b/helm/api-testing/values.yaml @@ -109,3 +109,7 @@ affinity: {} mongodb: enabled: false + +serviceMonitor: + enabled: false + interval: 15s