Skip to content

Commit

Permalink
acceptance - add a podmonitor (#27)
Browse files Browse the repository at this point in the history
* acceptance - add a podmonitor

This allows to publish metrics to prometheus about the testsuite

---------

Co-authored-by: Emilien Devos <[email protected]>
  • Loading branch information
pmauduit and edevosc2c authored Dec 5, 2024
1 parent e89df5b commit 9800eea
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
18 changes: 18 additions & 0 deletions acceptance-tests/templates/prometheus-pm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.podMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
labels:
{{- include "acceptance-tests.labels" . | nindent 4 }}
name: {{ include "acceptance-tests.fullname" . }}-pm
spec:
podMetricsEndpoints:
- interval: {{ .Values.podMonitor.frequency }}
path: {{ .Values.podMonitor.httpPath }}
port: {{ .Values.podMonitor.httpPort }}
selector:
matchLabels:
{{- with .Values.podMonitor.matchLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions acceptance-tests/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,16 @@ configuration:
localAccount:
username: myusername
password: mypassword

# If enabled, this will create a PodMonitor object in order
# to gather metrics on the tests, as allure provides a prometheus compatible
# file which can be scrapped.
podMonitor:
enabled: false
# match the pod where prometheusData.txt is hosted
matchLabels:
app.kubernetes.io/name: apache-nas
httpPath: /public/non-regression/report/export/prometheusData.txt
httpPort: "80"
# Should be set to a value coherent with the `job.schedule` parameter above.
frequency: 1d

0 comments on commit 9800eea

Please sign in to comment.