Files
windows_exporter/contrib/mixin/alerts/logical_disk.libsonnet
T
Jan-Otto Kröpke 51a579e031 mixin: one alert file per collector with plain PromQL
Split alerts/alerts.libsonnet into one file per collector under alerts/,
like kubernetes-mixin. Each rule is a plain Prometheus alerting rule with
the PromQL written out in an expr block and %(name)s placeholders for the
_config values; lib/alerts.libsonnet keeps the collector and per-alert
gating and keep_firing_for. The pagefile, diskdrive and license alerts
get groups of their own so that one file is one group. The rendered
default rules are unchanged apart from expr block scalars.

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2026-10-17 14:53:14 +00:00

70 lines
3.1 KiB
Jsonnet
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
local c = self._config,
local a = (import '../lib/alerts.libsonnet')(c),
prometheusAlerts+:: {
groups+: a.group('windows-disk', collectors=['logical_disk'], rules=[
{
alert: 'WindowsDiskReadLatencyHigh',
expr: |||
windows:logical_disk_read_latency:seconds{%(windowsExporterSelector)s, %(volumeSelector)s} > %(diskLatencyThresholdSeconds)g
||| % c,
'for': '15m',
labels: { severity: 'warning' },
annotations: {
summary: 'Windows disk read latency is high',
description: 'Volume {{ $labels.volume }} on {{ $labels.instance }} has averaged more than %(diskLatencyThresholdSeconds)g seconds per read operation for 15 minutes.' % c,
},
},
{
alert: 'WindowsDiskWriteLatencyHigh',
expr: |||
windows:logical_disk_write_latency:seconds{%(windowsExporterSelector)s, %(volumeSelector)s} > %(diskLatencyThresholdSeconds)g
||| % c,
'for': '15m',
labels: { severity: 'warning' },
annotations: {
summary: 'Windows disk write latency is high',
description: 'Volume {{ $labels.volume }} on {{ $labels.instance }} has averaged more than %(diskLatencyThresholdSeconds)g seconds per write operation for 15 minutes.' % c,
},
},
{
alert: 'WindowsDiskAlmostFull',
expr: |||
windows:logical_disk_free:ratio{%(windowsExporterSelector)s, %(volumeSelector)s} * 100 < %(diskFreeWarningThreshold)s
||| % c,
'for': '15m',
labels: { severity: 'warning' },
annotations: {
summary: 'Windows disk space is low',
description: 'Volume {{ $labels.volume }} on {{ $labels.instance }} has less than %(diskFreeWarningThreshold)s%% free space. Windows may delay space metrics by 10–15 minutes.' % c,
},
},
{
alert: 'WindowsDiskAlmostFull',
expr: |||
windows:logical_disk_free:ratio{%(windowsExporterSelector)s, %(volumeSelector)s} * 100 < %(diskFreeCriticalThreshold)s
||| % c,
'for': '15m',
labels: { severity: c.criticalSeverity },
annotations: {
summary: 'Windows disk space is low',
description: 'Volume {{ $labels.volume }} on {{ $labels.instance }} has less than %(diskFreeCriticalThreshold)s%% free space. Windows may delay space metrics by 10–15 minutes.' % c,
},
},
{
alert: 'WindowsDiskFillingUp',
expr: |||
windows:logical_disk_free:ratio{%(windowsExporterSelector)s, %(volumeSelector)s} * 100 < %(diskFreeWarningThreshold)s
and predict_linear(windows_logical_disk_free_bytes{%(windowsExporterSelector)s, %(volumeSelector)s}[%(diskPredictionWindow)s], %(diskPredictionSeconds)s) < 0
||| % c { diskPredictionSeconds: c.diskPredictionHours * 3600 },
'for': '1h',
labels: { severity: 'warning' },
annotations: {
summary: 'Windows disk is predicted to fill up',
description: 'Volume {{ $labels.volume }} on {{ $labels.instance }} is predicted to fill within %(diskPredictionHours)s hours.' % c,
},
},
]),
},
}