fix(autopush): add first prometheus rules
This commit is contained in:
parent
4e6de7e2bb
commit
e5099620cd
4 changed files with 52 additions and 2 deletions
|
@ -3,7 +3,7 @@ name: autopush
|
|||
description: A Helm chart for Kubernetes
|
||||
icon:
|
||||
type: application
|
||||
version: 0.0.4
|
||||
version: 0.0.5
|
||||
# renovate: image=docker.io/mozilla-services/autopush-rs
|
||||
appVersion: "1.72.2"
|
||||
maintainers:
|
||||
|
|
|
@ -7,7 +7,7 @@ description: "A Helm chart for Kubernetes"
|
|||
|
||||
# autopush
|
||||
|
||||
  
|
||||
  
|
||||
|
||||
A Helm chart for Kubernetes
|
||||
|
||||
|
@ -123,6 +123,11 @@ helm uninstall autopush-release
|
|||
| prometheus.readinessProbe.httpGet.path | string | `"/"` | |
|
||||
| prometheus.readinessProbe.httpGet.port | string | `"metrics"` | |
|
||||
| prometheus.resources | object | `{}` | We usually recommend not to specify default resources and to leave this as a conscious choice for the user. This also increases chances charts run on environments with little resources, such as Minikube. If you do want to specify resources, uncomment the following lines, adjust them as necessary, and remove the curly braces after 'resources:'. limits: cpu: 100m memory: 128Mi requests: cpu: 100m memory: 128Mi |
|
||||
| prometheus.rules.additionalRules | list | `[]` | |
|
||||
| prometheus.rules.default.alertLabels | object | `{}` | |
|
||||
| prometheus.rules.default.enabled | bool | `true` | |
|
||||
| prometheus.rules.enabled | bool | `false` | |
|
||||
| prometheus.rules.labels | object | `{}` | |
|
||||
| prometheus.securityContext | object | `{}` | securityContext capabilities: drop: - ALL readOnlyRootFilesystem: true runAsNonRoot: true runAsUser: 1000 |
|
||||
| prometheus.servicemonitor.enabled | bool | `false` | |
|
||||
| prometheus.servicemonitor.labels | object | `{}` | |
|
||||
|
|
38
autopush/templates/prometheus-rules.yaml
Normal file
38
autopush/templates/prometheus-rules.yaml
Normal file
|
@ -0,0 +1,38 @@
|
|||
{{- if and .Values.prometheus.rules.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: {{ include "autopush.fullname" . }}
|
||||
labels:
|
||||
{{- include "autopush.labels" . | nindent 4 }}
|
||||
{{- with .Values.prometheus.rules.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
groups:
|
||||
{{- if .Values.prometheus.rules.default.enabled }}
|
||||
- name: {{ template "autopush.fullname" . }}-Endpoint
|
||||
rules:
|
||||
- alert: "autopush: No Subscription API Error"
|
||||
expr: 'sum(increase(autoendpoint_api_error_no_subscription{}[1h])) without (container,endpoint,pod,instance) > 0'
|
||||
for: 5m
|
||||
labels:
|
||||
severity: critical
|
||||
{{- with .Values.prometheus.rules.default.alertLabels }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{`
|
||||
summary: "autoendpoint: No Subscription API Error in {{ $labels.namespace }}/{{ $labels.job }} increate in the last hour"
|
||||
`}}
|
||||
{{/*
|
||||
- name: {{ template "autopush.fullname" . }}-Push
|
||||
rules:
|
||||
*/}}
|
||||
{{- end }}
|
||||
{{- with .Values.prometheus.rules.additionalRules }}
|
||||
- name: {{ template "autopush.fullname" $ }}-Additional
|
||||
rules:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
|
@ -30,6 +30,13 @@ prometheus:
|
|||
servicemonitor:
|
||||
enabled: false
|
||||
labels: {}
|
||||
rules:
|
||||
enabled: false
|
||||
labels: {}
|
||||
default:
|
||||
enabled: true
|
||||
alertLabels: {}
|
||||
additionalRules: []
|
||||
|
||||
image:
|
||||
registry: docker.io
|
||||
|
|
Loading…
Add table
Reference in a new issue