feat(grafana): alert on read-only btrfs filesystems

Assisted-by: pi (gpt-5.6-sol)
This commit is contained in:
Gabriel Fontes
2026-08-24 11:19:16 -03:00
parent 0756c21c6e
commit a4bfacee5b
@@ -159,6 +159,65 @@
}
];
}
{
title = "Read-only Btrfs filesystem";
uid = "btrfs-read-only";
notification_settings.receiver = "default";
annotations = {
summary = "{{ $labels.instance }} has a read-only Btrfs filesystem";
description = "{{ $labels.device }} at {{ $labels.instance }} has been read-only for at least one minute.";
};
condition = "B";
execErrState = "KeepLast";
noDataState = "KeepLast";
for = "1m";
data = [
{
refId = "A";
datasourceUid = "prometheus-default";
model = {
refId = "A";
intervalMs = 1000;
expr = ''max by (job, instance, device) (node_filesystem_readonly{job="hosts",fstype="btrfs"})'';
instant = true;
range = false;
legendFormat = "__auto";
maxDataPoints = 43200;
};
relativeTimeRange = {
from = 600;
to = 0;
};
}
{
refId = "B";
datasourceUid = "__expr__";
model = {
refId = "B";
intervalMs = 1000;
maxDataPoints = 43200;
type = "threshold";
expression = "A";
datasource = {
type = "__expr__";
uid = "__expr__";
};
conditions = [
{
type = "query";
query.params = ["B"];
evaluator = {
type = "gt";
params = [0];
};
operator.type = "and";
reducer.type = "last";
}
];
};
}
];
}
{
title = "Service down";
uid = "service-down";