feat(metrics): add basic prometheus metrics, cluster scraping

This commit is contained in:
2025-10-30 14:42:11 +01:00
parent 7f8dd2e846
commit 2d0d309d2b
2 changed files with 4 additions and 3 deletions

View File

@@ -3,12 +3,12 @@ kind: ServiceMonitor
metadata: metadata:
name: fastapi-servicemonitor name: fastapi-servicemonitor
labels: labels:
release: prometheus release: kube-prometheus-stack
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: {{ .Values.app.name }} app: {{ .Values.app.name }}
endpoints: endpoints:
- port: "8000" - port: http
path: /metrics path: /metrics
interval: 15s interval: 15s

View File

@@ -4,7 +4,8 @@ metadata:
name: {{ .Values.app.name }} name: {{ .Values.app.name }}
spec: spec:
ports: ports:
- port: {{ .Values.service.port }} - name: http
port: {{ .Values.service.port }}
targetPort: {{ .Values.app.port }} targetPort: {{ .Values.app.port }}
selector: selector:
app: {{ .Values.app.name }} app: {{ .Values.app.name }}