Skip to content

Commit

Permalink
feat: add metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras committed Aug 2, 2024
1 parent c36e7db commit f31420e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
12 changes: 12 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ spec:
{{- end }}
{{- if .Values.env_secrets }}
checksum/{{ template "app.fullname" $ }}-env: {{ include (print $.Template.BasePath "/secret-env.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.metrics.enabled }}
{{- if .Values.metrics.prometheus.enabled }}
prometheus.io/scrape: '{{ .Values.metrics.prometheus.scrape }}'
prometheus.io/path: '{{ .Values.metrics.prometheus.path | default .Values.metrics.path }}'
prometheus.io/port: '{{ .Values.metrics.prometheus.pod | default .Values.pod.port }}'
{{- if .Values.metrics.prometheus.health.enabled }}
prometheus.io/health: '{{ .Values.metrics.prometheus.health.enabled }}'
prometheus.io/health_path: '{{ .Values.metrics.prometheus.health.path | default .Values.livenessProbe.url }}'
prometheus.io/health_port: '{{ .Values.metrics.prometheus.health.port | default .Values.pod.port }}'
{{- end }}
{{- end }}
{{- end }}
spec:
{{- if .Values.serviceAccount.enabled }}
Expand Down
2 changes: 2 additions & 0 deletions tests/metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
metrics:
enabled: true
25 changes: 25 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,31 @@ serviceAccountSuffix:
# Inject config maps
inject_maps: []

# service metrics configuration
metrics:
# enable or disable metrics
enabled: false
# service metrics path
path: /q/metrics
# metrics prometheus configuration
prometheus:
# enable or disable prometheus configuration
enabled: true
# prometheus metrics default metrics.path
path:
# scrape prometheus metrics
scrape: true
# prometheus metrics pod port, default pod.port
pod:
# promehtues health metrics
health:
# enable or disable prometheus helth metrics
enabled: true
# service health path for prometheus default livenessProbe.url
path:
# service health port for prometheus default pod.port
port:

# Database configuration
db:
# Enable or disable database connection
Expand Down

0 comments on commit f31420e

Please sign in to comment.