Skip to content

Commit

Permalink
Merge pull request #18 from SomeBlackMagic/nginx500s
Browse files Browse the repository at this point in the history
 bump chart version & fixed chart  alerts 500s
  • Loading branch information
wirwolf authored Sep 2, 2024
2 parents 1a5a1d0 + e1be8fd commit c89154e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions charts/ingress-nginx-monitoring/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: ingress-nginx-monitoring
description: Monitor nginx ingress controller
type: application
version: 1.2.7
appVersion: 1.2.7
version: 1.2.8
appVersion: 1.2.8
icon: https://raw.githubusercontent.com/SomeBlackMagic/helm-charts/master/charts/ingress-nginx-monitoring/nginx-prometheus-grafana.png
keywords:
- http
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and $.Values.prometheus.enabled ( $.Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) }}
{{- if and $.Values.prometheus.enabled ( $.Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand Down Expand Up @@ -33,19 +33,19 @@ spec:
labels:
severity: "{{ $.Values.prometheus.rule.alerts.certificateExpiry.severity }}"
annotations:
description: {{`ssl certificate {{$labels.host}} will expire in less than a week`}}
description: {{`ssl certificate {{$labels.host}} will expire in less then a week`}}
summary: renew expiring certificates to avoid downtime
{{- end }}

{{- if $.Values.prometheus.rule.alerts.tooMany500s.enabled }}
- alert: NGINXTooMany500s
expr: 100 * (sum by(ingress, exported_namespace, status,method,path,host) (rate(nginx_ingress_controller_requests{status=~"5.+", controller_class=~"{{ $.Values.prometheus.rule.ingressClass}}"}[2h])) / sum by(ingress, exported_namespace, status,method,path,host) (rate(nginx_ingress_controller_requests{controller_class=~"{{ $.Values.prometheus.rule.ingressClass}}"}[2h]))) > 10
for: {{ $.Values.prometheus.rule.alerts.tooMany500s.for }}
for: 5m
labels:
severity: "{{ $.Values.prometheus.rule.alerts.tooMany500s.severity }}"
annotations:
description: {{`Too many {{$labels.status}} on {{$labels.host}} `}}
summary: {{`{{ $.Values.prometheus.rule.alerts.tooMany500s.summary }}. Metadata -> { namespace="{{$labels.exported_namespace}}", ingress="{{$labels.ingress}}", method="{{$labels.method}}", path="{{$labels.path}})" } `}}
summary: {{` More than 10% of all requests returned {{$labels.status}}. Metadata -> { namespace="{{$labels.exported_namespace}}", ingress="{{$labels.ingress}}", method="{{$labels.method}}", path="{{$labels.path}})" } `}}
{{- end }}

{{- if $.Values.prometheus.rule.alerts.tooMany400s.enabled }}
Expand All @@ -56,9 +56,10 @@ spec:
severity: "{{ $.Values.prometheus.rule.alerts.tooMany400s.severity }}"
annotations:
description: {{`Too many {{$labels.status}} on {{$labels.host}} `}}
summary: {{`More than 5% of all requests returned {{$labels.status}}. Metadata -> { namespace="{{$labels.exported_namespace}}", ingress="{{$labels.ingress}}", method="{{$labels.method}}", path="{{$labels.path}})" } `}}
summary: {{` More than 5% of all requests returned {{$labels.status}}. Metadata -> { namespace="{{$labels.exported_namespace}}", ingress="{{$labels.ingress}}", method="{{$labels.method}}", path="{{$labels.path}})" } `}}
{{- end }}


{{- with $.Values.prometheus.rule.additionalAlerts }}
{{ . | nindent 4 }}
{{- end }}
Expand Down
2 changes: 0 additions & 2 deletions charts/ingress-nginx-monitoring/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ prometheus:
tooMany500s:
enabled: true
severity: warning
for: 5m
summary: More than 10% of all requests returned {{$labels.status}}

tooMany400s:
enabled: true
Expand Down

0 comments on commit c89154e

Please sign in to comment.