feat(08-01): add ServiceMonitor for Prometheus scraping

- Create ServiceMonitor template for Prometheus Operator discovery
- Add metrics.enabled and metrics.interval to values.yaml
- ServiceMonitor selects TaskPlanner pods via selectorLabels
- Scrapes /metrics endpoint every 30s by default

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Thomas Richter
2026-02-03 22:06:14 +01:00
parent f60aad2864
commit f2a289355d
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
{{- if .Values.metrics.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "taskplaner.fullname" . }}
labels:
{{- include "taskplaner.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "taskplaner.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
path: /metrics
interval: {{ .Values.metrics.interval | default "30s" }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- end }}

View File

@@ -111,6 +111,11 @@ basicAuth:
# Example: "admin:$apr1$xyz..."
htpasswd: ""
# Prometheus metrics
metrics:
enabled: true
interval: 30s
# Application-specific configuration
config:
# The external URL where the app is accessible (required for CSRF protection)