Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix promtail alerts for mimir #1046

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand Down Expand Up @@ -86,3 +87,4 @@ spec:
severity: page
team: atlas
topic: logging
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand Down Expand Up @@ -35,3 +36,4 @@ spec:
severity: page
team: atlas
topic: logging
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: PrometheusRule
metadata:
labels:
{{- include "labels.common" . | nindent 4 }}
cluster_type: "management_cluster"
name: promtail.rules
namespace: {{ .Values.namespace }}
spec:
Expand All @@ -14,7 +13,7 @@ spec:
annotations:
description: '{{`Scraping of all promtail pods to check if one failed every 5 minutes.`}}'
opsrecipe: promtail-is-not-running/
expr: count(up{app="promtail"} == 0) > 0
expr: count(up{container="promtail"} == 0) > 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is cluster_type="management_cluster" missing ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No promtail should alert on all clusters

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even for customer promtail if they have one ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do manage them so yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's mostly about those in kube-system

for: 5m
labels:
area: "empowerment"
Expand Down
36 changes: 18 additions & 18 deletions test/tests/providers/global/promtail.rules.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ tests:
- interval: 1m
input_series:
# For the first 60min: test with 1 pod: none, up, down
- series: 'up{app="promtail",cluster_type="management_cluster", cluster_id="gauss", installation="gauss", node="ip-10-0-5-35.eu-west-1.compute.internal"}'
- series: 'up{container="promtail",cluster_type="management_cluster", cluster_id="gauss", installation="gauss", node="ip-10-0-5-35.eu-west-1.compute.internal"}'
values: "_x20 1+0x20 0+0x20"
# From 60min: test with 2 pods: 1 up and 1 down, 2 up, 2 down.
- series: 'up{app="promtail",cluster_type="management_cluster", cluster_id="gauss", installation="gauss", node="ip-10-0-5-145.eu-west-1.compute.internal"}'
- series: 'up{container="promtail",cluster_type="management_cluster", cluster_id="gauss", installation="gauss", node="ip-10-0-5-145.eu-west-1.compute.internal"}'
values: "_x60 1+0x20 1+0x20 0+0x20"
- series: 'up{app="promtail",cluster_type="management_cluster", cluster_id="gauss", installation="gauss", node="ip-10-0-5-76.eu-west-1.compute.internal"}'
- series: 'up{container="promtail",cluster_type="management_cluster", cluster_id="gauss", installation="gauss", node="ip-10-0-5-76.eu-west-1.compute.internal"}'
values: "_x60 0+0x20 1+0x20 0+0x20"
alert_rule_test:
- alertname: PromtailDown
Expand All @@ -23,12 +23,12 @@ tests:
exp_alerts:
- exp_labels:
area: empowerment
severity: page
team: atlas
topic: observability
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
severity: page
team: atlas
topic: observability
exp_annotations:
description: "Scraping of all promtail pods to check if one failed every 5 minutes."
opsrecipe: "promtail-is-not-running/"
Expand All @@ -38,12 +38,12 @@ tests:
exp_alerts:
- exp_labels:
area: empowerment
severity: page
team: atlas
topic: observability
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
severity: page
team: atlas
topic: observability
exp_annotations:
description: "Scraping of all promtail pods to check if one failed every 5 minutes."
opsrecipe: "promtail-is-not-running/"
Expand All @@ -54,12 +54,12 @@ tests:
exp_alerts:
- exp_labels:
area: empowerment
severity: page
team: atlas
topic: observability
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
severity: page
team: atlas
topic: observability
exp_annotations:
description: "Scraping of all promtail pods to check if one failed every 5 minutes."
opsrecipe: "promtail-is-not-running/"
Expand All @@ -84,12 +84,12 @@ tests:
exp_alerts:
- exp_labels:
area: empowerment
severity: page
team: atlas
topic: observability
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
severity: page
team: atlas
topic: observability
exp_annotations:
description: "This alert checks if that the amount of failed requests is below 10% for promtail"
opsrecipe: "promtail-requests-are-failing/"
Expand All @@ -98,12 +98,12 @@ tests:
exp_alerts:
- exp_labels:
area: empowerment
severity: page
team: atlas
topic: observability
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
severity: page
team: atlas
topic: observability
exp_annotations:
description: "This alert checks if that the amount of failed requests is below 10% for promtail"
opsrecipe: "promtail-requests-are-failing/"