Skip to main content
APA
Sponsored by CAST AI — Kubernetes cost optimization Better Stack — Uptime monitoring and log management
⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

Hashicorp Vault Prometheus Alert Rules

4 Prometheus alerting rules for Hashicorp Vault. Exported via Embedded exporter. These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

9.7. Embedded exporter (4 rules)

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/hashicorp-vault/embedded-exporter.yml
critical

9.7.1. Vault sealed

Vault instance is sealed on {{ $labels.instance }}

- alert: VaultSealed
  expr: vault_core_unsealed == 0
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: Vault sealed (instance {{ $labels.instance }})
    description: "Vault instance is sealed on {{ $labels.instance }}\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

9.7.2. Vault too many pending tokens

Too many pending tokens on {{ $labels.instance }}: {{ $value }} tokens created but not yet stored.

- alert: VaultTooManyPendingTokens
  expr: avg(vault_token_create_count - vault_token_store_count) > 0
  for: 5m
  labels:
    severity: warning
  annotations:
    summary: Vault too many pending tokens (instance {{ $labels.instance }})
    description: "Too many pending tokens on {{ $labels.instance }}: {{ $value }} tokens created but not yet stored.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

9.7.3. Vault too many infinity tokens

Too many non-expiring tokens on {{ $labels.instance }}: {{ $value }} tokens with infinite TTL.

- alert: VaultTooManyInfinityTokens
  expr: vault_token_count_by_ttl{creation_ttl="+Inf"} > 3
  for: 5m
  labels:
    severity: warning
  annotations:
    summary: Vault too many infinity tokens (instance {{ $labels.instance }})
    description: "Too many non-expiring tokens on {{ $labels.instance }}: {{ $value }} tokens with infinite TTL.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

9.7.4. Vault cluster health

Vault cluster is not healthy: only {{ $value | humanizePercentage }} of nodes are active.

- alert: VaultClusterHealth
  expr: sum(vault_core_active) / count(vault_core_active) <= 0.5 and count(vault_core_active) > 0
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: Vault cluster health (instance {{ $labels.instance }})
    description: "Vault cluster is not healthy: only {{ $value | humanizePercentage }} of nodes are active.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"