Files
windows_exporter/contrib/mixin/alerts/exporter.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

61 lines
2.0 KiB
Jsonnet

{
local c = self._config,
local a = (import '../lib/alerts.libsonnet')(c),
prometheusAlerts+:: {
groups+: a.group('windows-exporter', collectors=[], rules=[
{
alert: 'WindowsExporterDown',
expr: |||
up{%(windowsExporterSelector)s} == 0
||| % c,
'for': '5m',
labels: { severity: c.criticalSeverity },
annotations: {
summary: 'Windows exporter is unreachable',
description: 'Prometheus cannot scrape Windows exporter on {{ $labels.instance }} (job {{ $labels.job }}).',
},
state:: true,
},
{
alert: 'WindowsCollectorFailed',
expr: |||
windows_exporter_collector_success{%(windowsExporterSelector)s} == 0
||| % c,
'for': '5m',
labels: { severity: 'warning' },
annotations: {
summary: 'Windows collector failed',
description: 'Collector {{ $labels.collector }} on {{ $labels.instance }} has failed for at least 5 minutes.',
},
state:: true,
},
{
alert: 'WindowsCollectorTimeout',
expr: |||
windows_exporter_collector_timeout{%(windowsExporterSelector)s} == 1
||| % c,
'for': '10m',
labels: { severity: 'warning' },
annotations: {
summary: 'Windows collector exceeds the scrape timeout',
description: 'Collector {{ $labels.collector }} on {{ $labels.instance }} has not finished within the scrape timeout for 10 minutes.',
},
state:: true,
},
{
alert: 'WindowsScrapeQueueTimeout',
expr: |||
windows_exporter_scrape_queue_timeout{%(windowsExporterSelector)s} == 1
||| % c,
'for': '10m',
labels: { severity: 'warning' },
annotations: {
summary: 'Windows exporter scrapes time out in the queue',
description: 'Scrapes of {{ $labels.instance }} have timed out waiting for an earlier scrape to finish for 10 minutes.',
},
state:: true,
},
]),
},
}