mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-19 02:59:04 +02:00
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>
45 lines
1.6 KiB
Jsonnet
45 lines
1.6 KiB
Jsonnet
{
|
|
local c = self._config,
|
|
local a = (import '../lib/alerts.libsonnet')(c),
|
|
prometheusAlerts+:: {
|
|
groups+: a.group('windows-memory', collectors=['memory'], rules=[
|
|
{
|
|
alert: 'WindowsMemoryHighUsage',
|
|
expr: |||
|
|
windows:memory_usage:ratio{%(windowsExporterSelector)s} * 100 > %(memoryHighUsageThreshold)s
|
|
||| % c,
|
|
'for': '15m',
|
|
labels: { severity: 'warning' },
|
|
annotations: {
|
|
summary: 'Windows memory usage is high',
|
|
description: 'Physical memory usage on {{ $labels.instance }} has exceeded %(memoryHighUsageThreshold)s%% for 15 minutes.' % c,
|
|
},
|
|
},
|
|
{
|
|
alert: 'WindowsMemoryCommitHighUsage',
|
|
expr: |||
|
|
windows:memory_committed:ratio{%(windowsExporterSelector)s} * 100 > %(memoryCommitHighUsageThreshold)s
|
|
||| % c,
|
|
'for': '15m',
|
|
labels: { severity: 'warning' },
|
|
annotations: {
|
|
summary: 'Windows memory commit usage is high',
|
|
description: 'Committed memory on {{ $labels.instance }} has exceeded %(memoryCommitHighUsageThreshold)s%% of the commit limit for 15 minutes.' % c,
|
|
},
|
|
},
|
|
{
|
|
alert: 'WindowsMemoryPagingHigh',
|
|
expr: |||
|
|
windows:memory_swap_page_operations:rate{%(windowsExporterSelector)s} > %(memoryPagingThreshold)s
|
|
||| % c,
|
|
'for': '15m',
|
|
labels: { severity: 'warning' },
|
|
annotations: {
|
|
summary: 'Windows memory paging is high',
|
|
description: 'Paging on {{ $labels.instance }} has exceeded %(memoryPagingThreshold)s pages per second for 15 minutes.' % c,
|
|
},
|
|
},
|
|
]),
|
|
},
|
|
}
|