fix(autopush): add first prometheus rules

This commit is contained in:
WrenIX 2025-01-16 15:38:52 +01:00
parent 4e6de7e2bb
commit e5099620cd
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5
4 changed files with 52 additions and 2 deletions

View file

@ -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:

View file

@ -7,7 +7,7 @@ description: "A Helm chart for Kubernetes"
# autopush
![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.72.2](https://img.shields.io/badge/AppVersion-1.72.2-informational?style=flat-square)
![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.72.2](https://img.shields.io/badge/AppVersion-1.72.2-informational?style=flat-square)
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 | `{}` | |

View 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 }}

View file

@ -30,6 +30,13 @@ prometheus:
servicemonitor:
enabled: false
labels: {}
rules:
enabled: false
labels: {}
default:
enabled: true
alertLabels: {}
additionalRules: []
image:
registry: docker.io