Record per-host memory corruption log events from VictoriaLogs (#596)
Hosts have no ECC RAM, so failing memory raises no EDAC/MCE signal; it only shows up as scattered log lines (kernel segfaults/GPFs, ceph checksum and rocksdb key-order errors). Recording a per-host count of these symptoms makes bad RAM visible in VictoriaMetrics. - add vmalert `logs` in logging, querying VictoriaLogs and writing to vminsert-main - add VMRule recording `host:corruption_log_events:count` by host from LogsQL - select vlogs rules by the `vmalert.unkin.net/datasource` label and exclude them from vmalert `main` Reviewed-on: #596 Co-authored-by: unkin-agent <unkin-agent@unkin.net> Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #596.
This commit is contained in:
@@ -7,5 +7,7 @@ resources:
|
||||
- vaultauth.yaml
|
||||
- vlcluster.yaml
|
||||
- vlagent.yaml
|
||||
- vmalert.yaml
|
||||
- vmrule-corruption.yaml
|
||||
- gateway.yaml
|
||||
- httproute.yaml
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
apiVersion: operator.victoriametrics.com/v1beta1
|
||||
kind: VMAlert
|
||||
metadata:
|
||||
name: logs
|
||||
namespace: logging
|
||||
spec:
|
||||
replicaCount: 2
|
||||
ruleSelector:
|
||||
matchLabels:
|
||||
vmalert.unkin.net/datasource: vlogs
|
||||
evaluationInterval: 1m
|
||||
datasource:
|
||||
url: http://vlselect-logs.logging.svc.cluster.local:9471
|
||||
remoteWrite:
|
||||
url: http://vminsert-main.observability.svc.cluster.local:8480/insert/0/prometheus/
|
||||
extraArgs:
|
||||
loggerFormat: json
|
||||
notifier.blackhole: "true"
|
||||
podDisruptionBudget:
|
||||
maxUnavailable: 1
|
||||
topologySpreadConstraints:
|
||||
- maxSkew: 1
|
||||
topologyKey: kubernetes.io/hostname
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: vmalert
|
||||
app.kubernetes.io/instance: logs
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
apiVersion: operator.victoriametrics.com/v1beta1
|
||||
kind: VMRule
|
||||
metadata:
|
||||
name: corruption
|
||||
namespace: logging
|
||||
labels:
|
||||
vmalert.unkin.net/datasource: vlogs
|
||||
spec:
|
||||
groups:
|
||||
- name: corruption
|
||||
type: vlogs
|
||||
interval: 1m
|
||||
rules:
|
||||
# Hosts lack ECC, so log symptoms are the only signal of bad RAM.
|
||||
- record: host:corruption_log_events:count
|
||||
expr: |
|
||||
("segfault at" or "general protection fault" or "_verify_csum bad" or "block checksum mismatch" or "out-of-order keys")
|
||||
| rename _HOSTNAME as host
|
||||
| format if (host:"") "<kubernetes.pod_node_name>" as host
|
||||
| stats by (host) count() as events
|
||||
@@ -7,6 +7,11 @@ metadata:
|
||||
spec:
|
||||
replicaCount: 1
|
||||
selectAllByDefault: true
|
||||
ruleNamespaceSelector: {}
|
||||
ruleSelector:
|
||||
matchExpressions:
|
||||
- key: vmalert.unkin.net/datasource
|
||||
operator: DoesNotExist
|
||||
evaluationInterval: 30s
|
||||
datasource:
|
||||
url: http://vmselect-main.observability.svc.cluster.local:8481/select/0/prometheus/
|
||||
|
||||
Reference in New Issue
Block a user