mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-18 18:49:05 +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>
33 lines
1.3 KiB
Jsonnet
33 lines
1.3 KiB
Jsonnet
{
|
|
local c = self._config,
|
|
local a = (import '../lib/alerts.libsonnet')(c),
|
|
prometheusAlerts+:: {
|
|
groups+: a.group('windows-active-directory', collectors=['ad'], rules=[
|
|
{
|
|
alert: 'WindowsADPendingReplication',
|
|
expr: |||
|
|
windows_ad_replication_pending_operations{%(windowsExporterSelector)s} > %(adPendingReplicationThreshold)s
|
|
||| % c,
|
|
'for': '15m',
|
|
labels: { severity: 'warning' },
|
|
annotations: {
|
|
summary: 'Active Directory replication queue is high',
|
|
description: 'Pending replication operations on {{ $labels.instance }} have exceeded %(adPendingReplicationThreshold)s for 15 minutes.' % c,
|
|
},
|
|
},
|
|
{
|
|
alert: 'WindowsADReplicationFailures',
|
|
expr: |||
|
|
(rate(windows_ad_replication_sync_requests_total{%(windowsExporterSelector)s}[%(rateInterval)s]) - rate(windows_ad_replication_sync_requests_success_total{%(windowsExporterSelector)s}[%(rateInterval)s])) > %(adReplicationFailureRateThreshold)s
|
|
||| % c,
|
|
'for': '15m',
|
|
labels: { severity: 'warning' },
|
|
annotations: {
|
|
summary: 'Active Directory replication requests are failing',
|
|
description: 'Replication synchronization requests on {{ $labels.instance }} have been failing for 15 minutes.',
|
|
},
|
|
},
|
|
]),
|
|
},
|
|
}
|