Skip to content

Commit

Permalink
feat: INFRA-828 Remove uncessary records for now
Browse files Browse the repository at this point in the history
  • Loading branch information
ihannache committed Dec 20, 2024
1 parent 88563d9 commit f822d1a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 42 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ Currently, the two kinds of boilerplate that are supported:
- **vault_exporter_jobs**: List of Vault telemetry jobs to generate boilerplate for. Each entry should take the following keys:
- **tag**: Tag for the Vault telemetry job. It should correspond to the job name.
- **expected_unsealed_count**: Expected number of unsealed Vault nodes in the cluster. An alert will be triggered if the number of unsealed nodes drops below this value.
- **active_request_threshold**: Maximum allowed number of active requests. An alert will be triggered if this threshold is crossed for 10 minutes or more.
- **lease_threshold**: Minimum expected number of leases. An alert will be triggered if the lease count drops below this value for 10 minutes or more.
- **alert_labels**: Map of string keys and values corresponding to labels to add to all the jobs' alerts.

# Example
Expand Down
39 changes: 1 addition & 38 deletions templates/vault.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,4 @@ groups:
%{ endif ~}
annotations:
summary: "${title(replace(job.tag, "-", " "))} Vault Node(s) Sealed"
description: "Number of unsealed nodes in Vault cluster *{{ $labels.job }}* has dropped to *{{ $value }}*."

# ${replace(job.tag, "-", " ")} Active requests
- record: ${replace(job.tag, "-", "_")}:vault_active_requests:count
expr: max by (job, cluster) (sum(vault_core_in_flight_requests{job="${job.tag}-vault-exporter"}))

# Alert if active requests exceed threshold
- alert: ${replace(title(replace(job.tag, "-", " ")), " ", "")}VaultHighActiveRequests
expr: ${replace(job.tag, "-", "_")}:vault_active_requests:count > ${job.active_request_threshold}
for: 10m
%{ if length(job.alert_labels) > 0 ~}
labels:
%{ for key, val in job.alert_labels ~}
${key}: "${val}"
%{ endfor ~}
%{ endif ~}
annotations:
summary: "${title(replace(job.tag, "-", " "))} Vault High Active Requests"
description: "Vault cluster *{{ $labels.job }}* has too many active requests: *{{ $value }}*."

# ${replace(job.tag, "-", " ")} Lease metrics
- record: ${replace(job.tag, "-", "_")}:vault_lease_count:current
expr: min by (job, cluster) (sum(vault_expire_num_leases{job="${job.tag}-vault-exporter"}))

# Alert if lease count is too low
- alert: ${replace(title(replace(job.tag, "-", " ")), " ", "")}VaultLowLeaseCount
expr: ${replace(job.tag, "-", "_")}:vault_lease_count:current < ${job.lease_threshold}
for: 10m
%{ if length(job.alert_labels) > 0 ~}
labels:
%{ for key, val in job.alert_labels ~}
${key}: "${val}"
%{ endfor ~}
%{ endif ~}
annotations:
summary: "${title(replace(job.tag, "-", " "))} Vault Lease Count Low"
description: "Lease count in Vault cluster *{{ $labels.job }}* is too low: *{{ $value }}*."

description: "Number of unsealed nodes in Vault cluster *{{ $labels.job }}* has dropped to *{{ $value }}*."
2 changes: 0 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ variable "vault_exporter_jobs" {
type = list(object({
tag = string
expected_unsealed_count = number
active_request_threshold = number
lease_threshold = number
alert_labels = map(string)
}))
default = []
Expand Down

0 comments on commit f822d1a

Please sign in to comment.