From 491bb0de73ce04ec6423796eb189e502899abefb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sun, 11 Oct 2026 23:03:30 +0200 Subject: [PATCH] memory: rename commit_limit, drop free system PTEs, add standby cache lifetime (#2694) Co-authored-by: Claude Signed-off-by: Claude --- UPGRADE.md | 9 ++- contrib/mixin/dashboards/fleet.libsonnet | 2 +- contrib/mixin/dashboards/memory.libsonnet | 4 +- contrib/mixin/dashboards/overview.libsonnet | 2 +- contrib/mixin/lib/queries.libsonnet | 2 +- contrib/mixin/tests/alerts.test.yaml | 4 +- contrib/mixin/tests/custom.test.yaml | 4 +- contrib/mixin/tests/resources.test.yaml | 6 +- dashboard/windows-exporter-dashboard.json | 8 +-- dashboard/windows-exporter-fleet.json | 2 +- dashboard/windows-exporter-memory.json | 4 +- dashboard/windows-exporter-overview.json | 2 +- docs/collector.memory.md | 4 +- docs/runbooks/windowsmemorycommithighusage.md | 2 +- internal/collector/memory/memory.go | 31 +++++---- internal/collector/memory/types.go | 68 +++++++++---------- tools/e2e-output.txt | 8 +-- 17 files changed, 85 insertions(+), 77 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index c4c7ab3c..a32ae37e 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -17,7 +17,7 @@ Most installations need no changes. Go through the checklist below and read the | You use the `container` collector | Replace `containerd-state-dir` with `cri-endpoint` | [container collector](#container-collector) | | You query `windows_gpu_info` | Replace the `phys` label with `device_number` | [GPU collector](#gpu-collector) | | You alert on BitLocker status | Replace `status="disabled"` with `status="off"` | [BitLocker status](#bitlocker-status) | -| You query Hyper-V, logical disk queue, cache, IIS output cache, scheduled task or terminal services metrics | Update queries | [Renamed, deprecated and retyped metrics](#renamed-deprecated-and-retyped-metrics) | +| You query Hyper-V, logical disk queue, cache, IIS output cache, memory, scheduled task or terminal services metrics | Update queries | [Renamed, deprecated and retyped metrics](#renamed-deprecated-and-retyped-metrics) | | You chart SQL Server latencies, SQL Server lock counts or DHCP denials | Expect corrected values | [Corrected values](#corrected-values) | | You enable the `hyperv` or `mscluster` collector | Check the new default sub-collectors | [New default sub-collectors](#new-default-sub-collectors) | | You set scrape timeouts above 5 minutes or below the timeout margin | Review the new limits | [Scrape timeouts](#scrape-timeouts) | @@ -200,6 +200,13 @@ Renamed: |------------------------------------------------------|----------------------------------------------------------------|------------------------------------| | `windows_hyperv_virtual_storage_device_throughput` | `windows_hyperv_virtual_storage_device_throughput_total` | Now a counter, use `rate()` | | `windows_filetime_mtime_timestamp_seconds` | `windows_file_mtime_timestamp_seconds` | See [filetime](#filetime-collector-removed) | +| `windows_memory_commit_limit` | `windows_memory_commit_limit_bytes` | Unit suffix added, same value | + +Removed: + +| Metric | Reason | +|---------------------------------------------------|------------------------------------------------------------------------| +| `windows_memory_free_system_page_table_entries` | Saturates near 2^32 on 64-bit Windows, where system PTEs are not a scarce resource | Deprecated. These are still exported in 0.32 and will be removed in a later release: diff --git a/contrib/mixin/dashboards/fleet.libsonnet b/contrib/mixin/dashboards/fleet.libsonnet index 2c56abfa..43c01d60 100644 --- a/contrib/mixin/dashboards/fleet.libsonnet +++ b/contrib/mixin/dashboards/fleet.libsonnet @@ -58,7 +58,7 @@ function(on, config, overview=null) b.query.new('(max by (instance) (100 * (1 - windows_memory_physical_free_bytes{job=~"$job"} / windows_memory_physical_total_bytes{job=~"$job"}))) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'G') + b.query.withInstant() + b.query.withFormat('table'), - b.query.new('(max by (instance) (100 * windows_memory_committed_bytes{job=~"$job"} / windows_memory_commit_limit{job=~"$job"})) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'H') + b.query.new('(max by (instance) (100 * windows_memory_committed_bytes{job=~"$job"} / windows_memory_commit_limit_bytes{job=~"$job"})) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'H') + b.query.withInstant() + b.query.withFormat('table'), b.query.new('(max by (instance) (100 * (1 - windows_logical_disk_free_bytes{job=~"$job", volume!~"HarddiskVolume.*"} / windows_logical_disk_size_bytes{job=~"$job", volume!~"HarddiskVolume.*"}))) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'I') diff --git a/contrib/mixin/dashboards/memory.libsonnet b/contrib/mixin/dashboards/memory.libsonnet index a3af6f67..66220854 100644 --- a/contrib/mixin/dashboards/memory.libsonnet +++ b/contrib/mixin/dashboards/memory.libsonnet @@ -14,7 +14,7 @@ function(on) + b.panel.withDefaults({ decimals: 1, max: 1, min: 0 }), b.stat(167, 'Available', 'Physical memory available to processes: the standby, free and zero page lists.', metric('physical_free_bytes'), 'bytes') + b.panel.withDefaults({ decimals: 1 }), - b.stat(168, 'Commit used', 'Committed virtual memory as a share of the commit limit. Allocations fail at 100%.', metric('committed_bytes') + ' / ' + metric('commit_limit'), 'percentunit', steps=b.levels(0.8, 0.9)) + b.stat(168, 'Commit used', 'Committed virtual memory as a share of the commit limit. Allocations fail at 100%.', metric('committed_bytes') + ' / ' + metric('commit_limit_bytes'), 'percentunit', steps=b.levels(0.8, 0.9)) + b.panel.withDefaults({ decimals: 1, max: 1, min: 0 }), b.stat(169, 'Page reads', 'Hard page faults read from disk per second. Sustained page reads indicate memory pressure.', 'rate(' + metric('swap_page_reads_total') + '[$__rate_interval])', 'ops'), b.stat(170, 'Nonpaged pool', 'Kernel memory that cannot be paged out. Steady growth can indicate a driver leak.', metric('pool_nonpaged_bytes'), 'bytes') @@ -78,7 +78,7 @@ function(on) + b.panel.withQueries([ b.query.new('windows_memory_committed_bytes{job=~"$job", instance="$instance"}', 'A') + b.query.withLegendFormat('committed'), - b.query.new('windows_memory_commit_limit{job=~"$job", instance="$instance"}', 'B') + b.query.new('windows_memory_commit_limit_bytes{job=~"$job", instance="$instance"}', 'B') + b.query.withLegendFormat('limit'), ]) + b.panel.withDefaults({ diff --git a/contrib/mixin/dashboards/overview.libsonnet b/contrib/mixin/dashboards/overview.libsonnet index 659f9d92..27e7704b 100644 --- a/contrib/mixin/dashboards/overview.libsonnet +++ b/contrib/mixin/dashboards/overview.libsonnet @@ -132,7 +132,7 @@ function(on) b.panel.new(16, 'Commit used', 'stat') + b.panel.withDescription('Committed virtual memory as a share of the commit limit (physical memory + page files). Allocations fail at 100%.') + b.panel.withQueries([ - b.query.new('100 * windows_memory_committed_bytes{job=~"$job", instance="$instance"} / windows_memory_commit_limit{job=~"$job", instance="$instance"}', 'A'), + b.query.new('100 * windows_memory_committed_bytes{job=~"$job", instance="$instance"} / windows_memory_commit_limit_bytes{job=~"$job", instance="$instance"}', 'A'), ]) + b.panel.withDefaults({ decimals: 1, diff --git a/contrib/mixin/lib/queries.libsonnet b/contrib/mixin/lib/queries.libsonnet index 15bc0418..146baa26 100644 --- a/contrib/mixin/lib/queries.libsonnet +++ b/contrib/mixin/lib/queries.libsonnet @@ -18,7 +18,7 @@ function(c) self.metric('windows_logical_disk_size_bytes', [c.volumeSelector]) ), memoryCommitted: - self.ratio(self.metric('windows_memory_committed_bytes'), self.metric('windows_memory_commit_limit')), + self.ratio(self.metric('windows_memory_committed_bytes'), self.metric('windows_memory_commit_limit_bytes')), diskLatency(direction): self.ratio( self.rate('windows_logical_disk_%s_seconds_total' % direction, [c.volumeSelector]), diff --git a/contrib/mixin/tests/alerts.test.yaml b/contrib/mixin/tests/alerts.test.yaml index 9e356867..85025473 100644 --- a/contrib/mixin/tests/alerts.test.yaml +++ b/contrib/mixin/tests/alerts.test.yaml @@ -12,7 +12,7 @@ tests: input_series: - series: 'windows_memory_committed_bytes{job="windows_exporter", instance="host:9182", cluster="a"}' values: '95x20 50x10' - - series: 'windows_memory_commit_limit{job="windows_exporter", instance="host:9182", cluster="a"}' + - series: 'windows_memory_commit_limit_bytes{job="windows_exporter", instance="host:9182", cluster="a"}' values: '100x31' - series: 'windows_logical_disk_read_seconds_total{job="windows_exporter", instance="host:9182", cluster="a", volume="C:"}' values: '0+12x20 252x10' @@ -87,7 +87,7 @@ tests: input_series: - series: 'windows_memory_committed_bytes{job="windows_exporter", instance="host:9182"}' values: '90x20' - - series: 'windows_memory_commit_limit{job="windows_exporter", instance="host:9182"}' + - series: 'windows_memory_commit_limit_bytes{job="windows_exporter", instance="host:9182"}' values: '100x20' - series: 'windows_logical_disk_read_seconds_total{job="windows_exporter", instance="host:9182", volume="C:"}' values: '0+6x20' diff --git a/contrib/mixin/tests/custom.test.yaml b/contrib/mixin/tests/custom.test.yaml index 1b16b5e6..c5f5134c 100644 --- a/contrib/mixin/tests/custom.test.yaml +++ b/contrib/mixin/tests/custom.test.yaml @@ -14,11 +14,11 @@ tests: input_series: - series: 'windows_memory_committed_bytes{job="windows-custom", instance="host:9182", cluster="test"}' values: '85x20' - - series: 'windows_memory_commit_limit{job="windows-custom", instance="host:9182", cluster="test"}' + - series: 'windows_memory_commit_limit_bytes{job="windows-custom", instance="host:9182", cluster="test"}' values: '100x20' - series: 'windows_memory_committed_bytes{job="windows-custom", instance="host:9182", cluster="prod"}' values: '99x20' - - series: 'windows_memory_commit_limit{job="windows-custom", instance="host:9182", cluster="prod"}' + - series: 'windows_memory_commit_limit_bytes{job="windows-custom", instance="host:9182", cluster="prod"}' values: '100x20' - series: 'windows_logical_disk_read_seconds_total{job="windows-custom", instance="host:9182", cluster="test", volume="C:"}' values: '0+3.6x20' diff --git a/contrib/mixin/tests/resources.test.yaml b/contrib/mixin/tests/resources.test.yaml index 53472952..27a8d1f0 100644 --- a/contrib/mixin/tests/resources.test.yaml +++ b/contrib/mixin/tests/resources.test.yaml @@ -22,13 +22,13 @@ tests: values: '50x10' - series: 'windows_memory_committed_bytes{job="windows_exporter", instance="host:9182", cluster="a"}' values: '80x10' - - series: 'windows_memory_commit_limit{job="windows_exporter", instance="host:9182", cluster="a"}' + - series: 'windows_memory_commit_limit_bytes{job="windows_exporter", instance="host:9182", cluster="a"}' values: '100x10' - series: 'windows_memory_swap_page_operations_total{job="windows_exporter", instance="host:9182", cluster="a"}' values: '0+120x10' - series: 'windows_memory_committed_bytes{job="other", instance="host:9182"}' values: '95x10' - - series: 'windows_memory_commit_limit{job="other", instance="host:9182"}' + - series: 'windows_memory_commit_limit_bytes{job="other", instance="host:9182"}' values: '100x10' promql_expr_test: - expr: windows:memory_cached:bytes @@ -153,7 +153,7 @@ tests: values: '0x20' - series: 'windows_memory_committed_bytes{job="windows_exporter", instance="host:9182"}' values: '1x20' - - series: 'windows_memory_commit_limit{job="windows_exporter", instance="host:9182"}' + - series: 'windows_memory_commit_limit_bytes{job="windows_exporter", instance="host:9182"}' values: '0x20' - series: 'windows_logical_disk_read_seconds_total{job="windows_exporter", instance="host:9182", volume="C:"}' values: '0x20' diff --git a/dashboard/windows-exporter-dashboard.json b/dashboard/windows-exporter-dashboard.json index 642b63a7..d33ffae0 100644 --- a/dashboard/windows-exporter-dashboard.json +++ b/dashboard/windows-exporter-dashboard.json @@ -6040,7 +6040,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "100 * windows_memory_committed_bytes{job=~\"$job\", instance=\"$instance\"} / windows_memory_commit_limit{job=~\"$job\", instance=\"$instance\"}", + "expr": "100 * windows_memory_committed_bytes{job=~\"$job\", instance=\"$instance\"} / windows_memory_commit_limit_bytes{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -6847,7 +6847,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_memory_committed_bytes{job=~\"$job\", instance=\"$instance\"} / windows_memory_commit_limit{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_memory_committed_bytes{job=~\"$job\", instance=\"$instance\"} / windows_memory_commit_limit_bytes{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -10312,7 +10312,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(max by (instance) (100 * windows_memory_committed_bytes{job=~\"$job\"} / windows_memory_commit_limit{job=~\"$job\"})) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", + "expr": "(max by (instance) (100 * windows_memory_committed_bytes{job=~\"$job\"} / windows_memory_commit_limit_bytes{job=~\"$job\"})) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", "format": "table", "instant": true, "legendFormat": "__auto", @@ -18641,7 +18641,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_memory_commit_limit{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_memory_commit_limit_bytes{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "limit", "range": true diff --git a/dashboard/windows-exporter-fleet.json b/dashboard/windows-exporter-fleet.json index 846aa491..59a77ce7 100644 --- a/dashboard/windows-exporter-fleet.json +++ b/dashboard/windows-exporter-fleet.json @@ -213,7 +213,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(max by (instance) (100 * windows_memory_committed_bytes{job=~\"$job\"} / windows_memory_commit_limit{job=~\"$job\"})) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", + "expr": "(max by (instance) (100 * windows_memory_committed_bytes{job=~\"$job\"} / windows_memory_commit_limit_bytes{job=~\"$job\"})) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", "format": "table", "instant": true, "legendFormat": "__auto", diff --git a/dashboard/windows-exporter-memory.json b/dashboard/windows-exporter-memory.json index 9d74ee5c..2b627f20 100644 --- a/dashboard/windows-exporter-memory.json +++ b/dashboard/windows-exporter-memory.json @@ -259,7 +259,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_memory_committed_bytes{job=~\"$job\", instance=\"$instance\"} / windows_memory_commit_limit{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_memory_committed_bytes{job=~\"$job\", instance=\"$instance\"} / windows_memory_commit_limit_bytes{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -801,7 +801,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_memory_commit_limit{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_memory_commit_limit_bytes{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "limit", "range": true diff --git a/dashboard/windows-exporter-overview.json b/dashboard/windows-exporter-overview.json index 9cf701ff..a2457f67 100644 --- a/dashboard/windows-exporter-overview.json +++ b/dashboard/windows-exporter-overview.json @@ -598,7 +598,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "100 * windows_memory_committed_bytes{job=~\"$job\", instance=\"$instance\"} / windows_memory_commit_limit{job=~\"$job\", instance=\"$instance\"}", + "expr": "100 * windows_memory_committed_bytes{job=~\"$job\", instance=\"$instance\"} / windows_memory_commit_limit_bytes{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true diff --git a/docs/collector.memory.md b/docs/collector.memory.md index bf3101a9..7c783b44 100644 --- a/docs/collector.memory.md +++ b/docs/collector.memory.md @@ -21,11 +21,10 @@ None | `windows_memory_cache_bytes` | Number of bytes currently being used by the file system cache | gauge | None | | `windows_memory_cache_bytes_peak` | Maximum number of CacheBytes after the system was last restarted | gauge | None | | `windows_memory_cache_faults_total` | Number of faults which occur when a page sought in the file system cache is not found there and must be retrieved from elsewhere in memory (soft fault) or from disk (hard fault) | counter | None | -| `windows_memory_commit_limit` | Amount of virtual memory, in bytes, that can be committed without having to extend the paging file(s) | gauge | None | +| `windows_memory_commit_limit_bytes` | Amount of virtual memory, in bytes, that can be committed without having to extend the paging file(s) | gauge | None | | `windows_memory_committed_bytes` | Amount of committed virtual memory, in bytes | gauge | None | | `windows_memory_demand_zero_faults_total` | The number of zeroed pages required to satisfy faults. Zeroed pages, pages emptied of previously stored data and filled with zeros, are a security feature of Windows that prevent processes from seeing data stored by earlier processes that used the memory space | counter | None | | `windows_memory_free_and_zero_page_list_bytes` | The amount of physical memory, in bytes, that is assigned to the free and zero page lists. This memory does not contain cached data. It is immediately available for allocation to a process or for system use | gauge | None | -| `windows_memory_free_system_page_table_entries` | Number of page table entries not being used by the system | gauge | None | | `windows_memory_modified_page_list_bytes` | The amount of physical memory, in bytes, that is assigned to the modified page list. This memory contains cached data and code that is not actively in use by processes, the system and the system cache. This memory needs to be written out before it will be available for allocation to a process or for system use | gauge | None | | `windows_memory_page_faults_total` | Overall rate at which faulted pages are handled by the processor | counter | None | | `windows_memory_swap_page_reads_total` | Number of disk page reads (a single read operation reading several pages is still only counted once) | counter | None | @@ -42,6 +41,7 @@ None | `windows_memory_pool_paged_resident_bytes` | The size, in bytes, of the portion of the paged pool that is currently resident and active in physical memory. The paged pool is an area of the system virtual memory that is used for objects that can be written to disk when they are not being used | gauge | None | | `windows_memory_process_memory_limit_bytes` | Maximum number of bytes of memory that can be allocated to a process | gauge | None | | `windows_memory_standby_cache_core_bytes` | The amount of physical memory, in bytes, that is assigned to the core standby cache page lists. This memory contains cached data and code that is not actively in use by processes, the system and the system cache. It is immediately available for allocation to a process or for system use. If the system runs out of available free and zero memory, memory on lower priority standby cache page lists will be repurposed before memory on higher priority standby cache page lists | gauge | None | +| `windows_memory_standby_cache_lifetime_seconds` | The long-term average time, in seconds, that a page stays on the standby cache page lists before it is repurposed. Low values indicate memory pressure | gauge | None | | `windows_memory_standby_cache_normal_priority_bytes` | The amount of physical memory, in bytes, that is assigned to the normal priority standby cache page lists. This memory contains cached data and code that is not actively in use by processes, the system and the system cache. It is immediately available for allocation to a process or for system use. If the system runs out of available free and zero memory, memory on lower priority standby cache page lists will be repurposed before memory on higher priority standby cache page lists | gauge | None | | `windows_memory_standby_cache_reserve_bytes` | The amount of physical memory, in bytes, that is assigned to the reserve standby cache page lists. This memory contains cached data and code that is not actively in use by processes, the system and the system cache. It is immediately available for allocation to a process or for system use. If the system runs out of available free and zero memory, memory on lower priority standby cache page lists will be repurposed before memory on higher priority standby cache page lists | gauge | None | | `windows_memory_system_cache_resident_bytes` | The size, in bytes, of the portion of the system file cache which is currently resident and active in physical memory | gauge | None | diff --git a/docs/runbooks/windowsmemorycommithighusage.md b/docs/runbooks/windowsmemorycommithighusage.md index 72dda84d..48a331e5 100644 --- a/docs/runbooks/windowsmemorycommithighusage.md +++ b/docs/runbooks/windowsmemorycommithighusage.md @@ -16,7 +16,7 @@ when some physical memory remains available. ## Diagnosis 1. Inspect `windows:memory_committed:ratio`, `windows_memory_committed_bytes`, - and `windows_memory_commit_limit`. Determine whether committed bytes increased + and `windows_memory_commit_limit_bytes`. Determine whether committed bytes increased or the limit decreased. 2. In Task Manager or Resource Monitor, inspect per-process commit size and look for persistent growth. Check recent workload and deployment changes. diff --git a/internal/collector/memory/memory.go b/internal/collector/memory/memory.go index d76283c2..37838d05 100644 --- a/internal/collector/memory/memory.go +++ b/internal/collector/memory/memory.go @@ -57,7 +57,6 @@ type Collector struct { committedBytes *prometheus.Desc demandZeroFaultsTotal *prometheus.Desc freeAndZeroPageListBytes *prometheus.Desc - freeSystemPageTableEntries *prometheus.Desc modifiedPageListBytes *prometheus.Desc pageFaultsTotal *prometheus.Desc swapPageReadsTotal *prometheus.Desc @@ -71,6 +70,7 @@ type Collector struct { poolPagedBytes *prometheus.Desc poolPagedResidentBytes *prometheus.Desc standbyCacheCoreBytes *prometheus.Desc + standbyCacheLifetimeSeconds *prometheus.Desc standbyCacheNormalPriorityBytes *prometheus.Desc standbyCacheReserveBytes *prometheus.Desc systemCacheResidentBytes *prometheus.Desc @@ -142,8 +142,8 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, ) c.commitLimit = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "commit_limit"), - "(CommitLimit)", + prometheus.BuildFQName(types.Namespace, Name, "commit_limit_bytes"), + "Amount of virtual memory, in bytes, that can be committed without having to extend the paging file(s) (CommitLimit)", nil, nil, ) @@ -167,12 +167,6 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, nil, ) - c.freeSystemPageTableEntries = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "free_system_page_table_entries"), - "(FreeSystemPageTableEntries)", - nil, - nil, - ) c.modifiedPageListBytes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "modified_page_list_bytes"), "The amount of physical memory, in bytes, that is assigned to the modified page list. This memory contains cached data and code that is not actively in "+ @@ -256,6 +250,13 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, nil, ) + c.standbyCacheLifetimeSeconds = prometheus.NewDesc( + prometheus.BuildFQName(types.Namespace, Name, "standby_cache_lifetime_seconds"), + "The long-term average time, in seconds, that a page stays on the standby cache page lists before it is repurposed. "+ + "Low values indicate memory pressure (LongTermAverageStandbyCacheLifetime)", + nil, + nil, + ) c.standbyCacheNormalPriorityBytes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "standby_cache_normal_priority_bytes"), "The amount of physical memory, in bytes, that is assigned to the normal priority standby cache page lists. This memory contains cached data and "+ @@ -447,12 +448,6 @@ func (c *Collector) collectPDH(ch chan<- prometheus.Metric) error { c.perfDataObject[0].FreeAndZeroPageListBytes, ) - ch <- prometheus.MustNewConstMetric( - c.freeSystemPageTableEntries, - prometheus.GaugeValue, - c.perfDataObject[0].FreeSystemPageTableEntries, - ) - ch <- prometheus.MustNewConstMetric( c.modifiedPageListBytes, prometheus.GaugeValue, @@ -531,6 +526,12 @@ func (c *Collector) collectPDH(ch chan<- prometheus.Metric) error { c.perfDataObject[0].StandbyCacheCoreBytes, ) + ch <- prometheus.MustNewConstMetric( + c.standbyCacheLifetimeSeconds, + prometheus.GaugeValue, + c.perfDataObject[0].LongTermAverageStandbyCacheLifetime, + ) + ch <- prometheus.MustNewConstMetric( c.standbyCacheNormalPriorityBytes, prometheus.GaugeValue, diff --git a/internal/collector/memory/types.go b/internal/collector/memory/types.go index 85d79300..00311950 100644 --- a/internal/collector/memory/types.go +++ b/internal/collector/memory/types.go @@ -18,38 +18,38 @@ package memory type perfDataCounterValues struct { - AvailableBytes float64 `perfdata:"Available Bytes"` - AvailableKBytes float64 `perfdata:"Available KBytes"` - AvailableMBytes float64 `perfdata:"Available MBytes"` - CacheBytes float64 `perfdata:"Cache Bytes"` - CacheBytesPeak float64 `perfdata:"Cache Bytes Peak"` - CacheFaultsPerSec float64 `perfdata:"Cache Faults/sec"` - CommitLimit float64 `perfdata:"Commit Limit"` - CommittedBytes float64 `perfdata:"Committed Bytes"` - DemandZeroFaultsPerSec float64 `perfdata:"Demand Zero Faults/sec"` - FreeAndZeroPageListBytes float64 `perfdata:"Free & Zero Page List Bytes"` - FreeSystemPageTableEntries float64 `perfdata:"Free System Page Table Entries"` - ModifiedPageListBytes float64 `perfdata:"Modified Page List Bytes"` - PageFaultsPerSec float64 `perfdata:"Page Faults/sec"` - PageReadsPerSec float64 `perfdata:"Page Reads/sec"` - PagesInputPerSec float64 `perfdata:"Pages Input/sec"` - PagesOutputPerSec float64 `perfdata:"Pages Output/sec"` - PagesPerSec float64 `perfdata:"Pages/sec"` - PageWritesPerSec float64 `perfdata:"Page Writes/sec"` - PoolNonpagedAllocs float64 `perfdata:"Pool Nonpaged Allocs"` - PoolNonpagedBytes float64 `perfdata:"Pool Nonpaged Bytes"` - PoolPagedAllocs float64 `perfdata:"Pool Paged Allocs"` - PoolPagedBytes float64 `perfdata:"Pool Paged Bytes"` - PoolPagedResidentBytes float64 `perfdata:"Pool Paged Resident Bytes"` - StandbyCacheCoreBytes float64 `perfdata:"Standby Cache Core Bytes"` - StandbyCacheNormalPriorityBytes float64 `perfdata:"Standby Cache Normal Priority Bytes"` - StandbyCacheReserveBytes float64 `perfdata:"Standby Cache Reserve Bytes"` - SystemCacheResidentBytes float64 `perfdata:"System Cache Resident Bytes"` - SystemCodeResidentBytes float64 `perfdata:"System Code Resident Bytes"` - SystemCodeTotalBytes float64 `perfdata:"System Code Total Bytes"` - SystemDriverResidentBytes float64 `perfdata:"System Driver Resident Bytes"` - SystemDriverTotalBytes float64 `perfdata:"System Driver Total Bytes"` - TransitionFaultsPerSec float64 `perfdata:"Transition Faults/sec"` - TransitionPagesRePurposedPerSec float64 `perfdata:"Transition Pages RePurposed/sec"` - WriteCopiesPerSec float64 `perfdata:"Write Copies/sec"` + AvailableBytes float64 `perfdata:"Available Bytes"` + AvailableKBytes float64 `perfdata:"Available KBytes"` + AvailableMBytes float64 `perfdata:"Available MBytes"` + CacheBytes float64 `perfdata:"Cache Bytes"` + CacheBytesPeak float64 `perfdata:"Cache Bytes Peak"` + CacheFaultsPerSec float64 `perfdata:"Cache Faults/sec"` + CommitLimit float64 `perfdata:"Commit Limit"` + CommittedBytes float64 `perfdata:"Committed Bytes"` + DemandZeroFaultsPerSec float64 `perfdata:"Demand Zero Faults/sec"` + FreeAndZeroPageListBytes float64 `perfdata:"Free & Zero Page List Bytes"` + LongTermAverageStandbyCacheLifetime float64 `perfdata:"Long-Term Average Standby Cache Lifetime (s)"` + ModifiedPageListBytes float64 `perfdata:"Modified Page List Bytes"` + PageFaultsPerSec float64 `perfdata:"Page Faults/sec"` + PageReadsPerSec float64 `perfdata:"Page Reads/sec"` + PagesInputPerSec float64 `perfdata:"Pages Input/sec"` + PagesOutputPerSec float64 `perfdata:"Pages Output/sec"` + PagesPerSec float64 `perfdata:"Pages/sec"` + PageWritesPerSec float64 `perfdata:"Page Writes/sec"` + PoolNonpagedAllocs float64 `perfdata:"Pool Nonpaged Allocs"` + PoolNonpagedBytes float64 `perfdata:"Pool Nonpaged Bytes"` + PoolPagedAllocs float64 `perfdata:"Pool Paged Allocs"` + PoolPagedBytes float64 `perfdata:"Pool Paged Bytes"` + PoolPagedResidentBytes float64 `perfdata:"Pool Paged Resident Bytes"` + StandbyCacheCoreBytes float64 `perfdata:"Standby Cache Core Bytes"` + StandbyCacheNormalPriorityBytes float64 `perfdata:"Standby Cache Normal Priority Bytes"` + StandbyCacheReserveBytes float64 `perfdata:"Standby Cache Reserve Bytes"` + SystemCacheResidentBytes float64 `perfdata:"System Cache Resident Bytes"` + SystemCodeResidentBytes float64 `perfdata:"System Code Resident Bytes"` + SystemCodeTotalBytes float64 `perfdata:"System Code Total Bytes"` + SystemDriverResidentBytes float64 `perfdata:"System Driver Resident Bytes"` + SystemDriverTotalBytes float64 `perfdata:"System Driver Total Bytes"` + TransitionFaultsPerSec float64 `perfdata:"Transition Faults/sec"` + TransitionPagesRePurposedPerSec float64 `perfdata:"Transition Pages RePurposed/sec"` + WriteCopiesPerSec float64 `perfdata:"Write Copies/sec"` } diff --git a/tools/e2e-output.txt b/tools/e2e-output.txt index dea124ab..44836db2 100644 --- a/tools/e2e-output.txt +++ b/tools/e2e-output.txt @@ -189,16 +189,14 @@ windows_exporter_collector_timeout{collector="udp"} 0 # TYPE windows_memory_cache_bytes_peak gauge # HELP windows_memory_cache_faults_total Number of faults which occur when a page sought in the file system cache is not found there and must be retrieved from elsewhere in memory (soft fault) or from disk (hard fault) (Cache Faults/sec) # TYPE windows_memory_cache_faults_total counter -# HELP windows_memory_commit_limit (CommitLimit) -# TYPE windows_memory_commit_limit gauge +# HELP windows_memory_commit_limit_bytes Amount of virtual memory, in bytes, that can be committed without having to extend the paging file(s) (CommitLimit) +# TYPE windows_memory_commit_limit_bytes gauge # HELP windows_memory_committed_bytes (CommittedBytes) # TYPE windows_memory_committed_bytes gauge # HELP windows_memory_demand_zero_faults_total The number of zeroed pages required to satisfy faults. Zeroed pages, pages emptied of previously stored data and filled with zeros, are a security feature of Windows that prevent processes from seeing data stored by earlier processes that used the memory space (Demand Zero Faults/sec) # TYPE windows_memory_demand_zero_faults_total counter # HELP windows_memory_free_and_zero_page_list_bytes The amount of physical memory, in bytes, that is assigned to the free and zero page lists. This memory does not contain cached data. It is immediately available for allocation to a process or for system use (FreeAndZeroPageListBytes) # TYPE windows_memory_free_and_zero_page_list_bytes gauge -# HELP windows_memory_free_system_page_table_entries (FreeSystemPageTableEntries) -# TYPE windows_memory_free_system_page_table_entries gauge # HELP windows_memory_modified_page_list_bytes The amount of physical memory, in bytes, that is assigned to the modified page list. This memory contains cached data and code that is not actively in use by processes, the system and the system cache (ModifiedPageListBytes) # TYPE windows_memory_modified_page_list_bytes gauge # HELP windows_memory_page_faults_total Overall rate at which faulted pages are handled by the processor (Page Faults/sec) @@ -221,6 +219,8 @@ windows_exporter_collector_timeout{collector="udp"} 0 # TYPE windows_memory_process_memory_limit_bytes gauge # HELP windows_memory_standby_cache_core_bytes The amount of physical memory, in bytes, that is assigned to the core standby cache page lists. This memory contains cached data and code that is not actively in use by processes, the system and the system cache (StandbyCacheCoreBytes) # TYPE windows_memory_standby_cache_core_bytes gauge +# HELP windows_memory_standby_cache_lifetime_seconds The long-term average time, in seconds, that a page stays on the standby cache page lists before it is repurposed. Low values indicate memory pressure (LongTermAverageStandbyCacheLifetime) +# TYPE windows_memory_standby_cache_lifetime_seconds gauge # HELP windows_memory_standby_cache_normal_priority_bytes The amount of physical memory, in bytes, that is assigned to the normal priority standby cache page lists. This memory contains cached data and code that is not actively in use by processes, the system and the system cache (StandbyCacheNormalPriorityBytes) # TYPE windows_memory_standby_cache_normal_priority_bytes gauge # HELP windows_memory_standby_cache_reserve_bytes The amount of physical memory, in bytes, that is assigned to the reserve standby cache page lists. This memory contains cached data and code that is not actively in use by processes, the system and the system cache (StandbyCacheReserveBytes)