Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions windows-observ-lib/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
dashboardNamePrefix: '',

// 'prometheus_pre_0_30' points to old metrics schema prior to breaking changes in windows_exporter v0.30.0,
// 'prometheus' points to current metrics schema.
// Use any of the above or both.
metricsSource: ['prometheus', 'prometheus_pre_0_30'],
// 'prometheus_pre_0_31' points to metrics schema from v0.30.0 to v0.31.0,
// 'prometheus' points to current metrics schema (v0.31.0+, Alloy v1.11+).
// Use any of the above or combination based on your exporter version.
metricsSource: ['prometheus', 'prometheus_pre_0_31', 'prometheus_pre_0_30'],

// optional
ignoreVolumes: 'HarddiskVolume.*',
Expand Down
2 changes: 1 addition & 1 deletion windows-observ-lib/dashboards_out/disks
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"uid": "${prometheus_datasource}"
},
"enable": true,
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_boot_time_timestamp{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"hide": true,
"iconColor": "light-yellow",
"name": "Reboot",
Expand Down
4 changes: 2 additions & 2 deletions windows-observ-lib/dashboards_out/fleet
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"uid": "${prometheus_datasource}"
},
"enable": true,
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_boot_time_timestamp{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"hide": true,
"iconColor": "light-yellow",
"name": "Reboot",
Expand Down Expand Up @@ -429,7 +429,7 @@
"type": "prometheus",
"uid": "${prometheus_datasource}"
},
"expr": "time() - windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\ntime() - windows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}",
"expr": "time() - windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\ntime() - windows_system_boot_time_timestamp{job=~\"$job\",instance=~\"$instance\"}\nor\ntime() - windows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}",
"format": "table",
"instant": true,
"legendFormat": "{{instance}}: Uptime",
Expand Down
2 changes: 1 addition & 1 deletion windows-observ-lib/dashboards_out/logs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"uid": "${prometheus_datasource}"
},
"enable": true,
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_boot_time_timestamp{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"hide": true,
"iconColor": "light-yellow",
"name": "Reboot",
Expand Down
4 changes: 2 additions & 2 deletions windows-observ-lib/dashboards_out/overview
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"uid": "${prometheus_datasource}"
},
"enable": true,
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_boot_time_timestamp{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"hide": true,
"iconColor": "light-yellow",
"name": "Reboot",
Expand Down Expand Up @@ -128,7 +128,7 @@
"type": "prometheus",
"uid": "${prometheus_datasource}"
},
"expr": "time() - windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\ntime() - windows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}",
"expr": "time() - windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\ntime() - windows_system_boot_time_timestamp{job=~\"$job\",instance=~\"$instance\"}\nor\ntime() - windows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}",
"format": "time_series",
"instant": false,
"legendFormat": "{{instance}}: Uptime",
Expand Down
2 changes: 1 addition & 1 deletion windows-observ-lib/dashboards_out/system
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"uid": "${prometheus_datasource}"
},
"enable": true,
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"expr": "windows_system_boot_time_timestamp_seconds{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_boot_time_timestamp{job=~\"$job\",instance=~\"$instance\"}\nor\nwindows_system_system_up_time{job=~\"$job\",instance=~\"$instance\"}*1000 > $__from < $__to",
"hide": true,
"iconColor": "light-yellow",
"name": "Reboot",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 27 additions & 12 deletions windows-observ-lib/signals/memory.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function(this)
aggFunction: 'avg',
discoveryMetric: {
prometheus: 'windows_memory_physical_total_bytes',
prometheus_pre_0_31: 'windows_cs_physical_memory_bytes',
prometheus_pre_0_30: 'windows_cs_physical_memory_bytes',
},
signals: {
Expand All @@ -20,12 +21,16 @@ function(this)
description: 'Total physical memory in bytes',
unit: 'bytes',
sources: {
prometheus_pre_0_30: {
prometheus: {
expr: 'windows_memory_physical_total_bytes{%(queriesSelector)s}',
legendCustomTemplate: 'Memory total',
},
prometheus_pre_0_31: {
expr: 'windows_cs_physical_memory_bytes{%(queriesSelector)s}',
legendCustomTemplate: 'Memory total',
},
prometheus: {
expr: 'windows_memory_physical_total_bytes{%(queriesSelector)s}',
prometheus_pre_0_30: {
expr: 'windows_cs_physical_memory_bytes{%(queriesSelector)s}',
legendCustomTemplate: 'Memory total',
},
},
Expand All @@ -37,12 +42,15 @@ function(this)
description: 'Free physical memory in bytes',
unit: 'bytes',
sources: {
prometheus_pre_0_30: {
expr: 'windows_os_physical_memory_free_bytes{%(queriesSelector)s}',
},
prometheus: {
expr: 'windows_memory_physical_free_bytes{%(queriesSelector)s}',
},
prometheus_pre_0_31: {
expr: 'windows_os_physical_memory_free_bytes{%(queriesSelector)s}',
},
prometheus_pre_0_30: {
expr: 'windows_os_physical_memory_free_bytes{%(queriesSelector)s}',
},
},
},
memoryUsed: {
Expand All @@ -52,12 +60,16 @@ function(this)
description: 'Used physical memory in bytes',
unit: 'bytes',
sources: {
prometheus_pre_0_30: {
prometheus: {
expr: 'windows_memory_physical_total_bytes{%(queriesSelector)s} - windows_memory_physical_free_bytes{%(queriesSelector)s}',
legendCustomTemplate: 'Memory used',
},
prometheus_pre_0_31: {
expr: 'windows_cs_physical_memory_bytes{%(queriesSelector)s} - windows_os_physical_memory_free_bytes{%(queriesSelector)s}',
legendCustomTemplate: 'Memory used',
},
prometheus: {
expr: 'windows_memory_physical_total_bytes{%(queriesSelector)s} - windows_memory_physical_free_bytes{%(queriesSelector)s}',
prometheus_pre_0_30: {
expr: 'windows_cs_physical_memory_bytes{%(queriesSelector)s} - windows_os_physical_memory_free_bytes{%(queriesSelector)s}',
legendCustomTemplate: 'Memory used',
},

Expand All @@ -70,12 +82,15 @@ function(this)
description: 'Memory usage percentage',
unit: 'percent',
sources: {
prometheus_pre_0_30: {
expr: '100 - windows_os_physical_memory_free_bytes{%(queriesSelector)s} / windows_cs_physical_memory_bytes{%(queriesSelector)s} * 100',
},
prometheus: {
expr: '100 - windows_memory_physical_free_bytes{%(queriesSelector)s} / windows_memory_physical_total_bytes{%(queriesSelector)s} * 100',
},
prometheus_pre_0_31: {
expr: '100 - windows_os_physical_memory_free_bytes{%(queriesSelector)s} / windows_cs_physical_memory_bytes{%(queriesSelector)s} * 100',
},
prometheus_pre_0_30: {
expr: '100 - windows_os_physical_memory_free_bytes{%(queriesSelector)s} / windows_cs_physical_memory_bytes{%(queriesSelector)s} * 100',
},
},
},
memoryPageTotal: {
Expand Down
19 changes: 14 additions & 5 deletions windows-observ-lib/signals/system.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function(this)
unit: 's',
sources: {
prometheus: {
expr: 'time() - windows_system_boot_time_timestamp{%(queriesSelector)s}',
},
prometheus_pre_0_31: {
expr: 'time() - windows_system_boot_time_timestamp_seconds{%(queriesSelector)s}',
},
prometheus_pre_0_30: {
Expand All @@ -48,13 +51,15 @@ function(this)
description: 'System boot time',
unit: 's',
sources: {
prometheus_pre_0_30: {
expr: 'windows_system_system_up_time{%(queriesSelector)s}',
},
// https://github.com/prometheus-community/windows_exporter/releases/tag/v0.30.0
prometheus: {
expr: 'windows_system_boot_time_timestamp{%(queriesSelector)s}',
},
prometheus_pre_0_31: {
expr: 'windows_system_boot_time_timestamp_seconds{%(queriesSelector)s}',
},
prometheus_pre_0_30: {
expr: 'windows_system_system_up_time{%(queriesSelector)s}',
},
},
},
cpuCount: {
Expand Down Expand Up @@ -186,7 +191,7 @@ function(this)
legendCustomTemplate: 'Time adjustments',
},
// https://github.com/prometheus-community/windows_exporter/pull/1910
prometheus_pre_0_30: {
prometheus_pre_0_31: {
expr: 'windows_time_clock_frequency_adjustment_ppb_total{%(queriesSelector)s}',
legendCustomTemplate: 'Time adjustments',
},
Expand All @@ -203,6 +208,10 @@ function(this)
expr: 'windows_time_timezone{%(queriesSelector)s}',
infoLabel: 'timezone',
},
prometheus_pre_0_31: {
expr: 'windows_os_timezone{%(queriesSelector)s}',
infoLabel: 'timezone',
},
prometheus_pre_0_30: {
expr: 'windows_os_timezone{%(queriesSelector)s}',
infoLabel: 'timezone',
Expand Down
Loading