mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-17 18:19:04 +02:00
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
34 lines
1.2 KiB
Jsonnet
34 lines
1.2 KiB
Jsonnet
local b = import 'builders.libsonnet';
|
|
local annotation = b.dashboard.spec.annotations;
|
|
|
|
// The Reboots annotation needs the system collector.
|
|
function(on) [annotation for annotation in [
|
|
annotation.withKind()
|
|
+ annotation.spec.withBuiltIn(true)
|
|
+ annotation.spec.withEnable(true)
|
|
+ annotation.spec.withHide(true)
|
|
+ annotation.spec.withIconColor('rgba(0, 211, 255, 1)')
|
|
+ annotation.spec.withLegacyOptions({
|
|
type: 'dashboard',
|
|
})
|
|
+ annotation.spec.withName('Annotations & Alerts')
|
|
+ annotation.spec.withQuery(b.dataQuery({}, 'grafana', '-- Grafana --'))
|
|
,
|
|
if on('system') then (
|
|
annotation.withKind()
|
|
+ annotation.spec.withEnable(true)
|
|
+ annotation.spec.withHide(false)
|
|
+ annotation.spec.withIconColor('orange')
|
|
+ annotation.spec.withLegacyOptions({
|
|
expr: 'windows_system_boot_time_timestamp{job=~"$job", instance="$instance"} * 1000 > $__from < $__to',
|
|
step: '1m',
|
|
tagKeys: 'instance',
|
|
textFormat: '',
|
|
titleFormat: 'Reboot',
|
|
useValueForTime: 'on',
|
|
})
|
|
+ annotation.spec.withName('Reboots')
|
|
+ annotation.spec.withQuery(b.dataQuery({}, 'prometheus', '${datasource}'))
|
|
),
|
|
] if annotation != null]
|