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:
19
helm/taskplaner/templates/servicemonitor.yaml
Normal file
19
helm/taskplaner/templates/servicemonitor.yaml
Normal 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 }}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user