Skip to content

Instantly share code, notes, and snippets.

@aditya-konarde
Last active March 3, 2020 10:28
Show Gist options
  • Save aditya-konarde/3808e3d732cc6a2aa368d5b46a521aec to your computer and use it in GitHub Desktop.
Save aditya-konarde/3808e3d732cc6a2aa368d5b46a521aec to your computer and use it in GitHub Desktop.
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
creationTimestamp: null
labels:
prometheus: app-sre
role: alert-rules
name: vault-alertrules
spec:
groups:
- name: vault
rules:
- alert: VaultLeadershipLoss
expr: sum(increase(vault_core_leadership_lost_count{job="vault"}[1h])) > 5
for: 1m
labels:
severity: critical
annotations:
summary: High frequency of Vault leadership losses
description: There have been more than 5 Vault leadership losses in the past 1h
- alert: VaultLeadershipStepDowns
expr: sum(increase(vault_core_step_down_count{job="vault"}[1h])) > 5
for: 1m
labels:
severity: critical
annotations:
summary: High frequency of Vault leadership step downs
description: There have been more than 5 Vault leadership step downs in the past 1h
- alert: VaultLeadershipSetupFailures
expr: sum(increase(vault_core_leadership_setup_failed{job="vault"}[1h])) > 5
for: 1m
labels:
severity: critical
annotations:
summary: High frequency of Vault leadership setup failures
description: There have been more than 5 Vault leadership setup failures in the past 1h
@hparashu
Copy link

hparashu commented Mar 3, 2020

Hi Aditya,

I have configured the below alert rule for vault step-down noftification. Requirement is a warning alert when any of the node in the 3 node vault cluster steps-down.

But when i step-down manually the vault leader, i donot see an alert triggering to alertmanager. Whats wrong in my expression ? Please suggest - Thank you

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment