Skip to content
Snippets Groups Projects
Commit 807d1e79 authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

Merge branch 'ignore_failed_sso_jobs' into 'master'

Prometheus: Ignore failed SSO jobs (see single-sign-on#26)

Closes #499

See merge request openappstack/openappstack!216
parents 782cbe2a 487cc597
No related branches found
No related tags found
No related merge requests found
import json
import pytest
import re
@pytest.mark.prometheus
......@@ -49,27 +50,48 @@ def ignore_alert(alert):
Returns true if an alert should be ignored. This is when the "severity"
equals "none", or in some application specific cases.
"""
if alert["labels"]["severity"] == "none":
return True
# Ignore `KubeAPILatencyHigh` fom high load during installation
# phase
if alert["labels"]["alertname"] == "KubeAPILatencyHigh":
return True
# Filter out failing Nextcloud installation jobs since a lot of
# them fail until they succeed during installation
if "nextcloud" in alert["labels"]["pod"]:
if alert["labels"]["alertname"] in [
"KubeJobFailed",
"KubeJobCompletion",
"KubePodNotReady"]:
return True
# Filter out when RocketChat pods take very long to start
if "rocketchat" in alert["labels"]["pod"]:
if alert["labels"]["alertname"] in [
"KubePodNotReady",
"KubeDeploymentReplicasMismatch",
"KubeStatefulSetReplicasMismatch"]:
return True
if 'pod' in alert["labels"]:
# Filter out failing Nextcloud installation jobs since a lot of
# them fail until they succeed during installation
if "nextcloud" in alert["labels"]["pod"]:
if alert["labels"]["alertname"] in [
"KubeJobFailed",
"KubeJobCompletion",
"KubePodNotReady"]:
return True
# Filter out when some apps take too long to start
if re.search("(rocketchat|wordpress)", alert["labels"]["pod"]):
if alert["labels"]["alertname"] in [
"KubePodNotReady",
"KubeDeploymentReplicasMismatch",
"KubeStatefulSetReplicasMismatch"]:
return True
# Filter out failed signgle-sign-on pods until we fix
# https://open.greenhost.net/openappstack/single-sign-on/issues/26
if "single-sign-on-create-" in alert["labels"]["pod"]:
if alert["labels"]["alertname"] in ["KubePodNotReady"]:
return True
if 'job_name' in alert["labels"]:
# Filter out failed signgle-sign-on jobs until we fix
# https://open.greenhost.net/openappstack/single-sign-on/issues/26
if "single-sign-on-create-" in alert["labels"]["job_name"]:
if alert["labels"]["alertname"] in [
"KubeJobFailed",
"KubeJobCompletion"]:
return True
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment