From 667200f757daa5d6a0061c7efe06b0601997d1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 16 Oct 2026 11:07:04 +0200 Subject: [PATCH] collector: name instance labels after the entity they identify (#2744) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke --- .github/workflows/mixin.yml | 2 + AGENTS.md | 8 + UPGRADE.md | 56 +- contrib/mixin/dashboards/disk.libsonnet | 32 +- contrib/mixin/dashboards/fleet.libsonnet | 4 +- contrib/mixin/dashboards/overview.libsonnet | 2 +- contrib/mixin/dashboards/services.libsonnet | 12 +- contrib/mixin/mise.toml | 2 +- .../mixin/tests/compatibility_rules.test.yaml | 37 + dashboard/windows-exporter-dashboard.json | 80 +- dashboard/windows-exporter-disk.json | 62 +- dashboard/windows-exporter-fleet.json | 4 +- dashboard/windows-exporter-overview.json | 2 +- dashboard/windows-exporter-services.json | 12 +- docs/collector.dfsr.md | 82 +- docs/collector.dhcp.md | 8 +- docs/collector.diskdrive.md | 12 +- docs/collector.dns.md | 34 +- docs/collector.exchange.md | 76 +- docs/collector.hyperv.md | 36 +- docs/collector.mscluster.md | 266 +++--- docs/collector.msmq.md | 8 +- docs/collector.performancecounter.md | 2 +- docs/collector.registry.md | 12 +- docs/collector.service.md | 76 +- docs/collector.storage_spaces.md | 32 +- docs/collector.wmi.md | 16 +- ...le-0.32-compatibility-rules-new-to-old.yml | 780 ++++++++++++++++++ internal/collector/dfsr/dfsr.go | 82 +- internal/collector/dhcp/dhcp.go | 2 +- internal/collector/dhcp/dhcp_test.go | 2 +- internal/collector/diskdrive/diskdrive.go | 25 +- internal/collector/dns/dns.go | 2 +- .../exchange/exchange_ad_access_processes.go | 16 +- .../collector/exchange/exchange_http_proxy.go | 12 +- .../exchange/exchange_transport_queues.go | 38 +- .../exchange/exchange_workload_management.go | 10 +- .../collector/hyperv/hyperv_virtual_smb.go | 34 +- .../collector/mscluster/mscluster_cluster.go | 150 ++-- .../mscluster_cluster_native_test.go | 2 +- .../collector/mscluster/mscluster_network.go | 10 +- .../mscluster_network_native_test.go | 2 +- .../collector/mscluster/mscluster_node.go | 28 +- .../mscluster/mscluster_node_native_test.go | 4 +- .../collector/mscluster/mscluster_resource.go | 36 +- .../mscluster_resource_native_test.go | 10 +- .../mscluster/mscluster_resourcegroup.go | 28 +- .../mscluster_resourcegroup_native_test.go | 8 +- .../mscluster/mscluster_shared_volumes.go | 6 +- .../mscluster_shared_volumes_native_test.go | 4 +- .../collector/mscluster/mscluster_test.go | 2 +- internal/collector/msmq/AGENTS.md | 2 +- internal/collector/msmq/msmq.go | 8 +- .../performancecounter/performancecounter.go | 2 +- .../performancecounter_test_test.go | 4 +- internal/collector/registry/registry.go | 2 +- .../registry/registry_output_test.go | 4 +- internal/collector/service/service.go | 8 +- .../service/service_internal_test.go | 2 +- .../storage_spaces/storage_spaces_pool.go | 12 +- .../storage_spaces/storage_spaces_test.go | 6 +- .../storage_spaces_virtual_disk.go | 12 +- internal/collector/wmi/wmi.go | 4 +- internal/collector/wmi/wmi_output_test.go | 20 +- .../compatibility_rules_test.go | 325 ++++++++ internal/metriccontract/metrics_test.go | 6 + tools/e2e-output.txt | 26 +- 67 files changed, 1960 insertions(+), 751 deletions(-) create mode 100644 contrib/mixin/tests/compatibility_rules.test.yaml create mode 100644 docs/example-0.32-compatibility-rules-new-to-old.yml create mode 100644 internal/metriccontract/compatibility_rules_test.go diff --git a/.github/workflows/mixin.yml b/.github/workflows/mixin.yml index 3700cd9c..c9d5bda8 100644 --- a/.github/workflows/mixin.yml +++ b/.github/workflows/mixin.yml @@ -9,6 +9,7 @@ on: - dashboard/*.json - docs/collector.*.md - docs/runbooks/** + - docs/example-*.yml - docs/README.md - README.md - internal/metriccontract/** @@ -23,6 +24,7 @@ on: - dashboard/*.json - docs/collector.*.md - docs/runbooks/** + - docs/example-*.yml - docs/README.md - README.md - internal/metriccontract/** diff --git a/AGENTS.md b/AGENTS.md index c893a530..70393e32 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -115,6 +115,14 @@ exercised a live Windows role. `_milliseconds`, `_microseconds`, `_kb` or an `_in_` infix. Convert Windows values explicitly (MHz, percent, KiB, ms). Counters end in `_total`; gauges never do. List renamed metrics in `UPGRADE.md`. +- Name the label that identifies a PDH or WMI instance after the entity it + identifies: `service`, `process`, `queue`, `disk`, `volume`, `nic`, `core`, + `vm`, `site`, `app`, `database`, `node`, `resource`, `resource_group`, + `cluster`, `network`, `pool`, `virtual_disk`, `connection`, `folder` and so + on. Never use the generic `name`, and never `instance`: it collides with the + target label that Prometheus adds. Reuse the key that other collectors use for + the same concept. Descriptive attributes of an info metric (for example the + processor model in `windows_cpu_info{name}`) are not instance keys. - Determine metric types per counter, using `pdh.Collector.MetricType` where appropriate. Raw PDH values can be cumulative numerators, ticks or counts, even when the Windows counter name says average, percentage or seconds. diff --git a/UPGRADE.md b/UPGRADE.md index 6acfca8b..21968341 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -19,6 +19,7 @@ Most installations need no changes. Go through the checklist below and read the | You alert on BitLocker status | Replace `status="disabled"` with `status="off"` | [BitLocker status](#bitlocker-status) | | You query Active Directory latency or security descriptor propagation, DFSR, DNS dynamic update, Hyper-V, logical disk queue, cache, IIS, memory, RemoteFX, SQL Server, scheduled task, SMB server share or terminal services metrics | Update queries | [Renamed, removed and retyped metrics](#renamed-removed-and-retyped-metrics) | | You query metrics in MHz, percent, minutes, milliseconds, microseconds, kilobytes, megabytes or parts per billion, counters without a `_total` suffix, or Exchange, Hyper-V DataStore and Virtual SMB, IIS application pool, mscluster, NPS or SQL Server counters | Update queries | [Base units and counter names](#base-units-and-counter-names) | +| You query `dfsr`, `dhcp` scope, `diskdrive`, `dns` WMI, `exchange`, Hyper-V Virtual SMB, `mscluster`, `msmq`, `registry`, `service`, `storage_spaces` or `wmi` metrics by their `name` or `instance` label, or `performancecounter` objects without `instance_label` | Rename the label in queries and alerts | [Instance label names](#instance-label-names) | | You enable the `scheduled_task` collector and use tasks below `\Microsoft\` or missed runs | Set `--collector.scheduled_task.exclude` or `missed-runs` | [scheduled_task collector](#scheduled_task-collector) | | You chart SQL Server latencies, lock counts or replica queues, DHCP denials, AD LSA writes, AD computer creations, AD FS database query times, DNS zone transfers or RemoteFX skipped frames | 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) | @@ -86,7 +87,7 @@ collector: metric: windows_thermalzone_throttle_reasons ``` -`instance_label: name` keeps the `name` label of 0.31. Without it, the label is called `instance`, which collides with the target label that Prometheus adds. +`instance_label: name` keeps the `name` label of 0.31. Without it, the label is called `object_instance`. In 0.31 the default label was `instance`, which Prometheus stored as `exported_instance` (or, with `honor_labels: true`, as `instance`, replacing the target label); replace it with `object_instance` in queries. `windows_thermalzone_percent_passive_limit` and `windows_thermalzone_throttle_reasons` keep their names. The temperature is exported in Kelvin, because `performancecounter` doesn't convert units. Replace `windows_thermalzone_temperature_celsius` in queries with: @@ -353,6 +354,14 @@ Retired: `windows_net_route_info` was documented but never exported. It was remo windows_exporter 0.32 follows the Prometheus naming conventions for every metric: values are in base units (seconds, bytes, hertz, ratios from 0 to 1), the unit is part of the name, and counters end in `_total`. The metrics below were renamed. **The old names are no longer exported, there are no aliases.** Update queries, recording rules, alerts and dashboards; the sample dashboards in [`dashboard/`](dashboard/README.md) and the rules in [`contrib/mixin`](contrib/mixin) already use the new names. +### Compatibility recording rules + +To migrate step by step, load [`docs/example-0.32-compatibility-rules-new-to-old.yml`](docs/example-0.32-compatibility-rules-new-to-old.yml) into Prometheus. +Its recording rules publish the metrics of 0.32 under their 0.31 names, with the 0.31 units and [instance labels](#instance-label-names), so existing dashboards and alerts keep working while you update them. +A 0.31 `instance` label comes back as `exported_instance`, the name under which Prometheus stored it. +The rules don't cover metrics that only renamed their instance label, such as `windows_service_*`, because a rule with the same name would duplicate every series, nor metrics whose 0.31 value can't be computed from 0.32. +Remove the rules once your queries use the new names. + ### Unit changes These metrics changed their value, not only their name. A graph that mixes 0.31 and 0.32 data shows a step at the upgrade. @@ -684,6 +693,49 @@ If Prometheus scrapes with OpenMetrics, it already stored exactly these names, b | `windows_nps_accounting_responses` | `windows_nps_accounting_responses_total` | Same value | | `windows_nps_accounting_unknown_type` | `windows_nps_accounting_unknown_type_total` | Same value | +## Instance label names + +The label that identifies the instance of a metric is now named after the entity it identifies, for example `service`, `queue` or `node`. +0.31 used the generic keys `name` and `instance` for many of them. `instance` also collided with the target label that Prometheus adds, so Prometheus renamed it to `exported_instance` (or overwrote the target label with `honor_labels: true`). +Label values are unchanged. **The old keys are no longer exported, there are no aliases.** Update label matchers, `by (...)` and `on (...)` clauses, legends and alert templates such as `{{ $labels.name }}`. + +| Collector | Metrics | 0.31 | 0.32 | +|------------------|------------------------------------------------------------|-----------------------|------------------| +| `dfsr` | `windows_dfsr_connection_*` | `name` | `connection` | +| `dfsr` | `windows_dfsr_folder_*` | `name` | `folder` | +| `dfsr` | `windows_dfsr_volume_*` | `name` | `volume` | +| `dhcp` | `windows_dhcp_scope_info` | `name` | `scope_name` | +| `diskdrive` | `windows_diskdrive_*` | `name` | `device_id` (the `name` label of `windows_diskdrive_info` is removed; it repeated `device_id`) | +| `dns` | `windows_dns_wmi_stats_total` | `name` | `statistic` | +| `exchange` | `windows_exchange_ldap_*` | `name` | `process` | +| `exchange` | `windows_exchange_http_proxy_*` | `name` | `protocol` | +| `exchange` | `windows_exchange_transport_queues_*` | `name` | `queue` | +| `exchange` | `windows_exchange_workload_*` | `name` | `workload` | +| `hyperv` | `windows_hyperv_virtual_smb_*` | `instance` | `vm` | +| `mscluster` | `windows_mscluster_cluster_*` | `name` | `cluster` | +| `mscluster` | `windows_mscluster_network_*` | `name` | `network` | +| `mscluster` | `windows_mscluster_node_*` | `name` | `node` | +| `mscluster` | `windows_mscluster_resource_*` | `name`, `node_name`, `owner_group` | `resource`, `node`, `resource_group` | +| `mscluster` | `windows_mscluster_resourcegroup_*` | `name`, `node_name` | `resource_group`, `node` | +| `mscluster` | `windows_mscluster_shared_volumes_*` | `name` | `shared_volume` | +| `msmq` | `windows_msmq_*` | `name` | `queue` | +| `registry` | `windows_registry_key_success` | `name` | `key` | +| `service` | `windows_service_*` | `name` | `service` | +| `storage_spaces` | `windows_storage_spaces_pool_*` | `name` | `pool` | +| `storage_spaces` | `windows_storage_spaces_virtual_disk_*` | `name` | `virtual_disk` | +| `wmi` | `windows_wmi_query_success`, `windows_wmi_query_duration_seconds` | `name` | `query` | +| `performancecounter` | objects without `instance_label` | `instance` (stored by Prometheus as `exported_instance`, or as `instance` with `honor_labels: true`) | `object_instance` | + +The `node_name` label of `windows_mscluster_resource_owner_node` and `windows_mscluster_resourcegroup_owner_node` is now `node`, like the label of the node metrics, so the owner can be joined with `on (node)`. The `owner_group` label of the resource metrics is now `resource_group`, like the label of the resource group metrics. +Info attributes that are not the instance key keep their names, for example the `name` label of `windows_cpu_info` (the processor model) and of `windows_gpu_info` (the adapter name). + +For example, the stopped automatic services query becomes: + +```promql +windows_service_state{state="running"} == 0 + and on (instance, service) windows_service_start_mode{start_mode="auto"} == 1 +``` + ## Corrected values These metrics keep their names, but 0.31 reported wrong values. Graphs show a step at the upgrade. @@ -733,7 +785,7 @@ Storage pool and virtual disk metrics are in the new `storage_spaces` collector It works on standalone hosts too and doesn't need a failover cluster. The `mscluster` collector now reads cluster data through the Windows Cluster API (`clusapi.dll`) instead of the `root\MSCluster` WMI namespace. -Labels and configuration are unchanged; metrics in minutes, milliseconds, hours, kilobytes, megabytes or percent are now in base units, see [Base units and counter names](#base-units-and-counter-names). `windows_mscluster_resource_is_alive_poll_interval_seconds` and `windows_mscluster_resource_looks_alive_poll_interval_seconds` are left out while the resource uses the interval of its resource type (0xFFFFFFFF in Windows). A property that can't be read is left out and reported as a collection error, instead of being exported as `0`. +Configuration is unchanged. The `name`, `node_name` and `owner_group` labels were renamed, see [Instance label names](#instance-label-names). Metrics in minutes, milliseconds, hours, kilobytes, megabytes or percent are now in base units, see [Base units and counter names](#base-units-and-counter-names). `windows_mscluster_resource_is_alive_poll_interval_seconds` and `windows_mscluster_resource_looks_alive_poll_interval_seconds` are left out while the resource uses the interval of its resource type (0xFFFFFFFF in Windows). A property that can't be read is left out and reported as a collection error, instead of being exported as `0`. ## Scrape timeouts diff --git a/contrib/mixin/dashboards/disk.libsonnet b/contrib/mixin/dashboards/disk.libsonnet index 4d32382b..29f9b3c9 100644 --- a/contrib/mixin/dashboards/disk.libsonnet +++ b/contrib/mixin/dashboards/disk.libsonnet @@ -4,7 +4,7 @@ local sumRate(name) = 'sum(rate(' + metric(name) + '[$__rate_interval]))'; local physical(name) = 'windows_physical_disk_' + name + '{job=~"$job", instance="$instance"}'; local physicalRate(name) = 'rate(' + physical(name) + '[$__rate_interval])'; // diskdrive names drives PHYSICALDRIVE; physical_disk and logical_disk use as disk. -local drive(name, labels='') = 'label_replace(windows_diskdrive_' + name + '{job=~"$job", instance="$instance"' + labels + '}, "disk", "$1", "name", "PHYSICALDRIVE(\\\\d+)")'; +local drive(name, labels='') = 'label_replace(windows_diskdrive_' + name + '{job=~"$job", instance="$instance"' + labels + '}, "disk", "$1", "device_id", "PHYSICALDRIVE(\\\\d+)")'; // Labels physical disk series with the drive model when diskdrive is enabled. local physicalByDisk(on, expr) = if on('diskdrive') @@ -418,12 +418,12 @@ function(on) b.stat(240, 'Pools not OK', 'Storage pools whose health status is not Healthy, excluding the primordial pool. Requires the storage_spaces collector.', 'count(' + pool('health_status') + ' != 0) or (0 * count(' + concretePools + '))', steps=[{ color: 'green', value: null }, { color: 'red', value: 1 }]), b.stat(241, 'Virtual disks not OK', 'Virtual disks whose health status is not Healthy. Requires the storage_spaces collector with its virtual_disk subcollector.', 'count(' + spaces('virtual_disk_health_status') + ' != 0) or (0 * count(' + spaces('virtual_disk_info') + '))', steps=[{ color: 'green', value: null }, { color: 'red', value: 1 }]), - b.joinedTable(242, 'Storage pools', 'Health, size, allocated capacity and used share of each storage pool, excluding the primordial pool of unpooled disks. Requires the storage_spaces collector.', 'name', [ - 'max by (name) (' + pool('health_status') + ')', - 'max by (name) (' + pool('size_bytes') + ')', - 'max by (name) (' + pool('allocated_size_bytes') + ')', - 'max by (name) (100 * ' + pool('allocated_size_bytes') + ' / ' + pool('size_bytes') + ')', - ], [['name', 'Pool'], ['Value #A', 'Health'], ['Value #B', 'Size'], ['Value #C', 'Allocated'], ['Value #D', 'Used']], [ + b.joinedTable(242, 'Storage pools', 'Health, size, allocated capacity and used share of each storage pool, excluding the primordial pool of unpooled disks. Requires the storage_spaces collector.', 'pool', [ + 'max by (pool) (' + pool('health_status') + ')', + 'max by (pool) (' + pool('size_bytes') + ')', + 'max by (pool) (' + pool('allocated_size_bytes') + ')', + 'max by (pool) (100 * ' + pool('allocated_size_bytes') + ' / ' + pool('size_bytes') + ')', + ], [['pool', 'Pool'], ['Value #A', 'Health'], ['Value #B', 'Size'], ['Value #C', 'Allocated'], ['Value #D', 'Used']], [ health, { matcher: { id: 'byName', options: 'Used' }, @@ -439,19 +439,19 @@ function(on) }, ] + bytes(['Size', 'Allocated'])), - b.joinedTable(243, 'Virtual disks', 'Health, size, allocated capacity, pool footprint and storage efficiency (allocated size per pool footprint) of each virtual disk. Mirrors and parity lower the efficiency. Requires the storage_spaces collector with its virtual_disk subcollector.', 'name', [ - 'max by (name) (' + spaces('virtual_disk_health_status') + ')', - 'max by (name) (' + spaces('virtual_disk_size_bytes') + ')', - 'max by (name) (' + spaces('virtual_disk_allocated_size_bytes') + ')', - 'max by (name) (' + spaces('virtual_disk_footprint_on_pool_bytes') + ')', - 'max by (name) (' + spaces('virtual_disk_storage_efficiency_ratio') + ')', - ], [['name', 'Virtual disk'], ['Value #A', 'Health'], ['Value #B', 'Size'], ['Value #C', 'Allocated'], ['Value #D', 'Footprint'], ['Value #E', 'Efficiency']], [ + b.joinedTable(243, 'Virtual disks', 'Health, size, allocated capacity, pool footprint and storage efficiency (allocated size per pool footprint) of each virtual disk. Mirrors and parity lower the efficiency. Requires the storage_spaces collector with its virtual_disk subcollector.', 'virtual_disk', [ + 'max by (virtual_disk) (' + spaces('virtual_disk_health_status') + ')', + 'max by (virtual_disk) (' + spaces('virtual_disk_size_bytes') + ')', + 'max by (virtual_disk) (' + spaces('virtual_disk_allocated_size_bytes') + ')', + 'max by (virtual_disk) (' + spaces('virtual_disk_footprint_on_pool_bytes') + ')', + 'max by (virtual_disk) (' + spaces('virtual_disk_storage_efficiency_ratio') + ')', + ], [['virtual_disk', 'Virtual disk'], ['Value #A', 'Health'], ['Value #B', 'Size'], ['Value #C', 'Allocated'], ['Value #D', 'Footprint'], ['Value #E', 'Efficiency']], [ health, { matcher: { id: 'byName', options: 'Efficiency' }, properties: [{ id: 'unit', value: 'percentunit' }, { id: 'decimals', value: 1 }] }, ] + bytes(['Size', 'Allocated', 'Footprint'])), - b.graph(244, 'Pool usage', 'Allocated share of each storage pool, excluding the primordial pool. A full pool cannot extend thin-provisioned virtual disks, which then fail writes.', 'percent', [['100 * ' + pool('allocated_size_bytes') + ' / ' + pool('size_bytes'), '{{name}}']]) + b.graph(244, 'Pool usage', 'Allocated share of each storage pool, excluding the primordial pool. A full pool cannot extend thin-provisioned virtual disks, which then fail writes.', 'percent', [['100 * ' + pool('allocated_size_bytes') + ' / ' + pool('size_bytes'), '{{pool}}']]) + b.panel.withDefaults({ max: 100, custom: { thresholdsStyle: { mode: 'dashed' } }, thresholds: { steps: b.levels(80, 90) } }), - b.graph(245, 'Virtual disk footprint', 'Pool capacity consumed by each virtual disk, including resiliency copies.', 'bytes', [[spaces('virtual_disk_footprint_on_pool_bytes'), '{{name}}']]), + b.graph(245, 'Virtual disk footprint', 'Pool capacity consumed by each virtual disk, including resiliency copies.', 'bytes', [[spaces('virtual_disk_footprint_on_pool_bytes'), '{{virtual_disk}}']]), ] ) diff --git a/contrib/mixin/dashboards/fleet.libsonnet b/contrib/mixin/dashboards/fleet.libsonnet index 4d436c65..c7e20421 100644 --- a/contrib/mixin/dashboards/fleet.libsonnet +++ b/contrib/mixin/dashboards/fleet.libsonnet @@ -32,7 +32,7 @@ function(on, config, overview=null) b.stat(252, 'CPU > %s%%' % config.cpuHighUsageThreshold, 'Hosts whose CPU usage is above the cpuHighUsageThreshold of the WindowsCPUHighUsage alert. The alert also requires 15 minutes above it.', countHosts(cpuBusy + ' > %s' % config.cpuHighUsageThreshold), steps=attention), b.stat(253, 'RAM > %s%%' % config.memoryHighUsageThreshold, 'Hosts whose physical memory usage is above the memoryHighUsageThreshold of the WindowsMemoryHighUsage alert. The alert also requires 15 minutes above it.', countHosts('max by (instance) (' + memoryUsed + ') > %s' % config.memoryHighUsageThreshold), steps=attention), b.stat(254, 'Low disk', 'Hosts with at least one volume with less than %s%% free space, the diskFreeWarningThreshold' % config.diskFreeWarningThreshold + ' of the WindowsDiskAlmostFull alert. HarddiskVolume* volumes without a drive letter are ignored.', countHosts('min by (instance) (' + volumeFree + ') < %s' % config.diskFreeWarningThreshold), steps=attention), - b.stat(255, 'Auto stopped', 'Hosts with at least one service with start mode auto that is not running. Delayed-start and trigger-start services can show up here until they start.', countHosts('count by (instance) (windows_service_state{job=~"$job", state="running"} == 0 and on (instance, name) windows_service_start_mode{job=~"$job", start_mode="auto"} == 1)'), steps=attention), + b.stat(255, 'Auto stopped', 'Hosts with at least one service with start mode auto that is not running. Delayed-start and trigger-start services can show up here until they start.', countHosts('count by (instance) (windows_service_state{job=~"$job", state="running"} == 0 and on (instance, service) windows_service_start_mode{job=~"$job", start_mode="auto"} == 1)'), steps=attention), b.panel.new(2, 'Hosts', 'table') + b.panel.withDescription('One row per scraped host. Click a hostname to open its details. C: used is the usage of the C: volume, usually the system drive; Fullest volume is the most used volume with a drive letter. Services up counts running services; Auto stopped counts services with start mode auto that are not running.') @@ -67,7 +67,7 @@ function(on, config, overview=null) b.query.new('(sum by (instance) (windows_service_state{job=~"$job", state="running"})) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'J') + b.query.withInstant() + b.query.withFormat('table'), - b.query.new('(count by (instance) (windows_service_state{job=~"$job", state="running"} == 0 and on (instance, name) windows_service_start_mode{job=~"$job", start_mode="auto"} == 1)) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'K') + b.query.new('(count by (instance) (windows_service_state{job=~"$job", state="running"} == 0 and on (instance, service) windows_service_start_mode{job=~"$job", start_mode="auto"} == 1)) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'K') + b.query.withInstant() + b.query.withFormat('table'), b.query.new('(max by (instance) (windows_system_processes{job=~"$job"})) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'L') diff --git a/contrib/mixin/dashboards/overview.libsonnet b/contrib/mixin/dashboards/overview.libsonnet index 6022fd85..2efa308f 100644 --- a/contrib/mixin/dashboards/overview.libsonnet +++ b/contrib/mixin/dashboards/overview.libsonnet @@ -163,7 +163,7 @@ function(on) b.panel.new(17, 'Stopped auto services', 'stat') + b.panel.withDescription('Services with start mode "auto" that are not running. See the Services tab for names.') + b.panel.withQueries([ - b.query.new('count(windows_service_state{job=~"$job", instance="$instance", state="running"} == 0 and on (name) windows_service_start_mode{job=~"$job", instance="$instance", start_mode="auto"} == 1) or vector(0)', 'A') + b.query.new('count(windows_service_state{job=~"$job", instance="$instance", state="running"} == 0 and on (service) windows_service_start_mode{job=~"$job", instance="$instance", start_mode="auto"} == 1) or vector(0)', 'A') + b.query.withInstant(), ]) + b.panel.withDefaults({ diff --git a/contrib/mixin/dashboards/services.libsonnet b/contrib/mixin/dashboards/services.libsonnet index d5af4737..aff9a5ac 100644 --- a/contrib/mixin/dashboards/services.libsonnet +++ b/contrib/mixin/dashboards/services.libsonnet @@ -10,7 +10,7 @@ function(on) [ b.stat(50, 'Running services', 'Number of services currently in the running state, reported by the service collector. Compare unexpected drops with the stopped automatic services table and service change history.', 'sum(windows_service_state{job=~"$job", instance="$instance", state="running"})', 'short'), - b.stat(51, 'Stopped auto services', 'Services with start mode "auto" that are not running.', 'count(windows_service_state{job=~"$job", instance="$instance", state="running"} == 0 and on (name) windows_service_start_mode{job=~"$job", instance="$instance", start_mode="auto"} == 1) or vector(0)', steps=[{ color: 'green', value: null }, { color: 'orange', value: 1 }]), + b.stat(51, 'Stopped auto services', 'Services with start mode "auto" that are not running.', 'count(windows_service_state{job=~"$job", instance="$instance", state="running"} == 0 and on (service) windows_service_start_mode{job=~"$job", instance="$instance", start_mode="auto"} == 1) or vector(0)', steps=[{ color: 'green', value: null }, { color: 'orange', value: 1 }]), b.stat(52, 'Pending services', 'Services in a start, stop, pause or continue pending state. A service that stays pending is hung.', 'sum(windows_service_state{job=~"$job", instance="$instance", state=~".* pending"}) or vector(0)', steps=[{ color: 'green', value: null }, { color: 'orange', value: 1 }]), @@ -19,7 +19,7 @@ function(on) b.panel.new(54, 'Automatic services not running', 'table') + b.panel.withDescription('Services configured to start automatically that are not in the running state. Delayed-start and trigger-start services may show up here until they start.') + b.panel.withQueries([ - b.query.new('max by (name, state) (windows_service_state{job=~"$job", instance="$instance"} == 1) and on (name) (windows_service_state{job=~"$job", instance="$instance", state="running"} == 0) and on (name) (windows_service_start_mode{job=~"$job", instance="$instance", start_mode="auto"} == 1)', 'A') + b.query.new('max by (service, state) (windows_service_state{job=~"$job", instance="$instance"} == 1) and on (service) (windows_service_state{job=~"$job", instance="$instance", state="running"} == 0) and on (service) (windows_service_start_mode{job=~"$job", instance="$instance", start_mode="auto"} == 1)', 'A') + b.query.withInstant() + b.query.withFormat('table'), ]) @@ -36,11 +36,11 @@ function(on) }, includeByName: {}, indexByName: { - name: 0, + service: 0, state: 1, }, renameByName: { - name: 'Service', + service: 'Service', state: 'State', }, }, @@ -59,8 +59,8 @@ function(on) b.panel.new(55, 'Service state changes', 'state-timeline') + b.panel.withDescription('Services that started or stopped in the selected time range.') + b.panel.withQueries([ - b.query.new('windows_service_state{job=~"$job", instance="$instance", state="running"} and on (name) (changes(windows_service_state{job=~"$job", instance="$instance", state="running"}[$__range] @ end()) > 0)', 'A') - + b.query.withLegendFormat('{{name}}'), + b.query.new('windows_service_state{job=~"$job", instance="$instance", state="running"} and on (service) (changes(windows_service_state{job=~"$job", instance="$instance", state="running"}[$__range] @ end()) > 0)', 'A') + + b.query.withLegendFormat('{{service}}'), ]) + b.panel.withDefaults({ mappings: [ diff --git a/contrib/mixin/mise.toml b/contrib/mixin/mise.toml index 1e65f6ef..3ef4df63 100644 --- a/contrib/mixin/mise.toml +++ b/contrib/mixin/mise.toml @@ -88,7 +88,7 @@ for file in $(cat "$out/generated"); do diff -u {{vars.dashboards}}/"$file" "$out/$file" \ || { echo "{{vars.dashboards}}/$file is out of date; run mise run dashboard"; exit 1; } done -promtool check rules windows_rules.yaml windows_alerts.yaml tests/custom_rules.yaml tests/custom_alerts.yaml +promtool check rules windows_rules.yaml windows_alerts.yaml tests/custom_rules.yaml tests/custom_alerts.yaml ../../docs/example-0.32-compatibility-rules-new-to-old.yml pint --offline lint windows_rules.yaml windows_alerts.yaml pint --offline lint tests/custom_rules.yaml tests/custom_alerts.yaml ''' diff --git a/contrib/mixin/tests/compatibility_rules.test.yaml b/contrib/mixin/tests/compatibility_rules.test.yaml new file mode 100644 index 00000000..0a9c85b1 --- /dev/null +++ b/contrib/mixin/tests/compatibility_rules.test.yaml @@ -0,0 +1,37 @@ +rule_files: + - ../../../docs/example-0.32-compatibility-rules-new-to-old.yml +evaluation_interval: 1m + +tests: + - name: 0.32 metrics are published under their 0.31 names, units and labels + interval: 1m + input_series: + - series: 'windows_mscluster_resource_restart_delay_seconds{job="w",instance="h:9182",type="SQL Server",resource="SQL",resource_group="G1"}' + values: '0.5' + - series: 'windows_hyperv_virtual_smb_open_files{job="w",instance="h:9182",vm="VM1"}' + values: '3' + - series: 'windows_cpu_core_frequency_hertz{job="w",instance="h:9182",core="0,0"}' + values: '3600000000' + - series: 'windows_cpu_time_seconds_total{job="w",instance="h:9182",core="0,0",mode="idle"}' + values: '42' + promql_expr_test: + - expr: windows_mscluster_resource_restart_delay + eval_time: 0 + exp_samples: + - labels: 'windows_mscluster_resource_restart_delay{job="w",instance="h:9182",type="SQL Server",name="SQL",owner_group="G1"}' + value: 500 + - expr: windows_hyperv_virtual_smb_current_open_file_count + eval_time: 0 + exp_samples: + - labels: 'windows_hyperv_virtual_smb_current_open_file_count{job="w",instance="h:9182",exported_instance="VM1"}' + value: 3 + - expr: windows_cpu_core_frequency_mhz + eval_time: 0 + exp_samples: + - labels: 'windows_cpu_core_frequency_mhz{job="w",instance="h:9182",core="0,0"}' + value: 3600 + - expr: windows_cpu_time_total + eval_time: 0 + exp_samples: + - labels: 'windows_cpu_time_total{job="w",instance="h:9182",core="0,0",mode="idle"}' + value: 42 diff --git a/dashboard/windows-exporter-dashboard.json b/dashboard/windows-exporter-dashboard.json index 3f092c76..c91be3fa 100644 --- a/dashboard/windows-exporter-dashboard.json +++ b/dashboard/windows-exporter-dashboard.json @@ -7027,7 +7027,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0 and on (name) windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1) or vector(0)", + "expr": "count(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0 and on (service) windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1) or vector(0)", "instant": true, "legendFormat": "__auto", "range": false @@ -10381,7 +10381,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(count by (instance) (windows_service_state{job=~\"$job\", state=\"running\"} == 0 and on (instance, name) windows_service_start_mode{job=~\"$job\", start_mode=\"auto\"} == 1)) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", + "expr": "(count by (instance) (windows_service_state{job=~\"$job\", state=\"running\"} == 0 and on (instance, service) windows_service_start_mode{job=~\"$job\", start_mode=\"auto\"} == 1)) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", "format": "table", "instant": true, "legendFormat": "__auto", @@ -11431,7 +11431,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count(label_replace(windows_diskdrive_status{job=~\"$job\", instance=\"$instance\", status!=\"OK\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\") == 1) or (0 * count(label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")))", + "expr": "count(label_replace(windows_diskdrive_status{job=~\"$job\", instance=\"$instance\", status!=\"OK\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\") == 1) or (0 * count(label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")))", "instant": false, "legendFormat": "__auto", "range": true @@ -11519,7 +11519,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\"))", + "expr": "max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\"))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -11542,7 +11542,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk) (label_replace(windows_diskdrive_size_bytes{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\"))", + "expr": "max by (disk) (label_replace(windows_diskdrive_size_bytes{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\"))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -11565,7 +11565,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk) (label_replace(windows_diskdrive_partitions{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\"))", + "expr": "max by (disk) (label_replace(windows_diskdrive_partitions{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\"))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -11588,7 +11588,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk, status) (label_replace(windows_diskdrive_status{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\") == 1)", + "expr": "max by (disk, status) (label_replace(windows_diskdrive_status{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\") == 1)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -11773,7 +11773,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(1 - clamp_max(rate(windows_physical_disk_idle_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]), 1)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (1 - clamp_max(rate(windows_physical_disk_idle_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]), 1))", + "expr": "(1 - clamp_max(rate(windows_physical_disk_idle_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]), 1)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (1 - clamp_max(rate(windows_physical_disk_idle_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]), 1))", "instant": false, "legendFormat": "{{disk}} {{model}}", "range": true @@ -11889,7 +11889,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_write_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_write_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_write_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_write_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}} write", "range": true @@ -11911,7 +11911,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}} read", "range": true @@ -12038,7 +12038,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}} write", "range": true @@ -12060,7 +12060,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}} read", "range": true @@ -12187,7 +12187,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_write_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_write_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0))", + "expr": "(rate(windows_physical_disk_write_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_write_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0))", "instant": false, "legendFormat": "{{disk}} {{model}} write", "range": true @@ -12209,7 +12209,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_read_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_read_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0))", + "expr": "(rate(windows_physical_disk_read_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_read_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0))", "instant": false, "legendFormat": "{{disk}} {{model}} read", "range": true @@ -12336,7 +12336,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(windows_physical_disk_requests_queued{job=~\"$job\", instance=\"$instance\"}) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (windows_physical_disk_requests_queued{job=~\"$job\", instance=\"$instance\"})", + "expr": "(windows_physical_disk_requests_queued{job=~\"$job\", instance=\"$instance\"}) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (windows_physical_disk_requests_queued{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "{{disk}} {{model}}", "range": true @@ -12451,7 +12451,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_split_ios_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_split_ios_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_split_ios_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_split_ios_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}}", "range": true @@ -16082,7 +16082,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) ((windows_storage_spaces_pool_health_status{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", + "expr": "max by (pool) ((windows_storage_spaces_pool_health_status{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16105,7 +16105,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) ((windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", + "expr": "max by (pool) ((windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16128,7 +16128,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) ((windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", + "expr": "max by (pool) ((windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16151,7 +16151,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (100 * (windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}) / (windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", + "expr": "max by (pool) (100 * (windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}) / (windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16170,7 +16170,7 @@ "kind": "Transformation", "spec": { "options": { - "byField": "name", + "byField": "pool", "mode": "outer" } } @@ -16193,14 +16193,14 @@ "Value #B": 2, "Value #C": 3, "Value #D": 4, - "name": 0 + "pool": 0 }, "renameByName": { "Value #A": "Health", "Value #B": "Size", "Value #C": "Allocated", "Value #D": "Used", - "name": "Pool" + "pool": "Pool" } } } @@ -16413,7 +16413,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_health_status{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_health_status{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16436,7 +16436,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_size_bytes{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_size_bytes{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16459,7 +16459,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16482,7 +16482,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_footprint_on_pool_bytes{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_footprint_on_pool_bytes{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16505,7 +16505,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_storage_efficiency_ratio{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_storage_efficiency_ratio{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16524,7 +16524,7 @@ "kind": "Transformation", "spec": { "options": { - "byField": "name", + "byField": "virtual_disk", "mode": "outer" } } @@ -16549,7 +16549,7 @@ "Value #C": 3, "Value #D": 4, "Value #E": 5, - "name": 0 + "virtual_disk": 0 }, "renameByName": { "Value #A": "Health", @@ -16557,7 +16557,7 @@ "Value #C": "Allocated", "Value #D": "Footprint", "Value #E": "Efficiency", - "name": "Virtual disk" + "virtual_disk": "Virtual disk" } } } @@ -16742,7 +16742,7 @@ "editorMode": "code", "expr": "100 * (windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}) / (windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"})", "instant": false, - "legendFormat": "{{name}}", + "legendFormat": "{{pool}}", "range": true }, "version": "v0" @@ -16866,7 +16866,7 @@ "editorMode": "code", "expr": "windows_storage_spaces_virtual_disk_footprint_on_pool_bytes{job=~\"$job\", instance=\"$instance\"}", "instant": false, - "legendFormat": "{{name}}", + "legendFormat": "{{virtual_disk}}", "range": true }, "version": "v0" @@ -17510,7 +17510,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count((count by (instance) (windows_service_state{job=~\"$job\", state=\"running\"} == 0 and on (instance, name) windows_service_start_mode{job=~\"$job\", start_mode=\"auto\"} == 1)) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}) or (0 * count(windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", + "expr": "count((count by (instance) (windows_service_state{job=~\"$job\", state=\"running\"} == 0 and on (instance, service) windows_service_start_mode{job=~\"$job\", start_mode=\"auto\"} == 1)) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}) or (0 * count(windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", "instant": false, "legendFormat": "__auto", "range": true @@ -21176,7 +21176,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0 and on (name) windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1) or vector(0)", + "expr": "count(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0 and on (service) windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1) or vector(0)", "instant": false, "legendFormat": "__auto", "range": true @@ -21437,7 +21437,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name, state) (windows_service_state{job=~\"$job\", instance=\"$instance\"} == 1) and on (name) (windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0) and on (name) (windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1)", + "expr": "max by (service, state) (windows_service_state{job=~\"$job\", instance=\"$instance\"} == 1) and on (service) (windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0) and on (service) (windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -21463,11 +21463,11 @@ }, "includeByName": {}, "indexByName": { - "name": 0, + "service": 0, "state": 1 }, "renameByName": { - "name": "Service", + "service": "Service", "state": "State" } } @@ -21553,9 +21553,9 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} and on (name) (changes(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"}[$__range] @ end()) > 0)", + "expr": "windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} and on (service) (changes(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"}[$__range] @ end()) > 0)", "instant": false, - "legendFormat": "{{name}}", + "legendFormat": "{{service}}", "range": true }, "version": "v0" diff --git a/dashboard/windows-exporter-disk.json b/dashboard/windows-exporter-disk.json index 60be45e6..e47f0380 100644 --- a/dashboard/windows-exporter-disk.json +++ b/dashboard/windows-exporter-disk.json @@ -615,7 +615,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count(label_replace(windows_diskdrive_status{job=~\"$job\", instance=\"$instance\", status!=\"OK\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\") == 1) or (0 * count(label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")))", + "expr": "count(label_replace(windows_diskdrive_status{job=~\"$job\", instance=\"$instance\", status!=\"OK\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\") == 1) or (0 * count(label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")))", "instant": false, "legendFormat": "__auto", "range": true @@ -703,7 +703,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\"))", + "expr": "max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\"))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -726,7 +726,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk) (label_replace(windows_diskdrive_size_bytes{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\"))", + "expr": "max by (disk) (label_replace(windows_diskdrive_size_bytes{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\"))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -749,7 +749,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk) (label_replace(windows_diskdrive_partitions{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\"))", + "expr": "max by (disk) (label_replace(windows_diskdrive_partitions{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\"))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -772,7 +772,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk, status) (label_replace(windows_diskdrive_status{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\") == 1)", + "expr": "max by (disk, status) (label_replace(windows_diskdrive_status{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\") == 1)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -957,7 +957,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(1 - clamp_max(rate(windows_physical_disk_idle_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]), 1)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (1 - clamp_max(rate(windows_physical_disk_idle_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]), 1))", + "expr": "(1 - clamp_max(rate(windows_physical_disk_idle_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]), 1)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (1 - clamp_max(rate(windows_physical_disk_idle_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]), 1))", "instant": false, "legendFormat": "{{disk}} {{model}}", "range": true @@ -1073,7 +1073,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_write_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_write_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_write_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_write_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}} write", "range": true @@ -1095,7 +1095,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}} read", "range": true @@ -1222,7 +1222,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}} write", "range": true @@ -1244,7 +1244,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}} read", "range": true @@ -1371,7 +1371,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_write_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_write_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0))", + "expr": "(rate(windows_physical_disk_write_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_write_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_writes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0))", "instant": false, "legendFormat": "{{disk}} {{model}} write", "range": true @@ -1393,7 +1393,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_read_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_read_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0))", + "expr": "(rate(windows_physical_disk_read_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0)) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_read_latency_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / (rate(windows_physical_disk_reads_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0))", "instant": false, "legendFormat": "{{disk}} {{model}} read", "range": true @@ -1520,7 +1520,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(windows_physical_disk_requests_queued{job=~\"$job\", instance=\"$instance\"}) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (windows_physical_disk_requests_queued{job=~\"$job\", instance=\"$instance\"})", + "expr": "(windows_physical_disk_requests_queued{job=~\"$job\", instance=\"$instance\"}) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (windows_physical_disk_requests_queued{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "{{disk}} {{model}}", "range": true @@ -1635,7 +1635,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(rate(windows_physical_disk_split_ios_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"name\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_split_ios_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "(rate(windows_physical_disk_split_ios_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) * on (disk) group_left (model) max by (disk, model) (label_replace(windows_diskdrive_info{job=~\"$job\", instance=\"$instance\"}, \"disk\", \"$1\", \"device_id\", \"PHYSICALDRIVE(\\\\d+)\")) or on (disk) (rate(windows_physical_disk_split_ios_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{disk}} {{model}}", "range": true @@ -1926,7 +1926,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) ((windows_storage_spaces_pool_health_status{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", + "expr": "max by (pool) ((windows_storage_spaces_pool_health_status{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1949,7 +1949,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) ((windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", + "expr": "max by (pool) ((windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1972,7 +1972,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) ((windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", + "expr": "max by (pool) ((windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1995,7 +1995,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (100 * (windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}) / (windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", + "expr": "max by (pool) (100 * (windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}) / (windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -2014,7 +2014,7 @@ "kind": "Transformation", "spec": { "options": { - "byField": "name", + "byField": "pool", "mode": "outer" } } @@ -2037,14 +2037,14 @@ "Value #B": 2, "Value #C": 3, "Value #D": 4, - "name": 0 + "pool": 0 }, "renameByName": { "Value #A": "Health", "Value #B": "Size", "Value #C": "Allocated", "Value #D": "Used", - "name": "Pool" + "pool": "Pool" } } } @@ -2257,7 +2257,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_health_status{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_health_status{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -2280,7 +2280,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_size_bytes{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_size_bytes{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -2303,7 +2303,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -2326,7 +2326,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_footprint_on_pool_bytes{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_footprint_on_pool_bytes{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -2349,7 +2349,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_storage_efficiency_ratio{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (virtual_disk) (windows_storage_spaces_virtual_disk_storage_efficiency_ratio{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -2368,7 +2368,7 @@ "kind": "Transformation", "spec": { "options": { - "byField": "name", + "byField": "virtual_disk", "mode": "outer" } } @@ -2393,7 +2393,7 @@ "Value #C": 3, "Value #D": 4, "Value #E": 5, - "name": 0 + "virtual_disk": 0 }, "renameByName": { "Value #A": "Health", @@ -2401,7 +2401,7 @@ "Value #C": "Allocated", "Value #D": "Footprint", "Value #E": "Efficiency", - "name": "Virtual disk" + "virtual_disk": "Virtual disk" } } } @@ -2586,7 +2586,7 @@ "editorMode": "code", "expr": "100 * (windows_storage_spaces_pool_allocated_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"}) / (windows_storage_spaces_pool_size_bytes{job=~\"$job\", instance=\"$instance\"} * on (job, instance, unique_id) group_left () windows_storage_spaces_pool_info{job=~\"$job\", instance=\"$instance\", primordial=\"false\"})", "instant": false, - "legendFormat": "{{name}}", + "legendFormat": "{{pool}}", "range": true }, "version": "v0" @@ -2710,7 +2710,7 @@ "editorMode": "code", "expr": "windows_storage_spaces_virtual_disk_footprint_on_pool_bytes{job=~\"$job\", instance=\"$instance\"}", "instant": false, - "legendFormat": "{{name}}", + "legendFormat": "{{virtual_disk}}", "range": true }, "version": "v0" diff --git a/dashboard/windows-exporter-fleet.json b/dashboard/windows-exporter-fleet.json index 0d0286b7..ff46e84e 100644 --- a/dashboard/windows-exporter-fleet.json +++ b/dashboard/windows-exporter-fleet.json @@ -282,7 +282,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(count by (instance) (windows_service_state{job=~\"$job\", state=\"running\"} == 0 and on (instance, name) windows_service_start_mode{job=~\"$job\", start_mode=\"auto\"} == 1)) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", + "expr": "(count by (instance) (windows_service_state{job=~\"$job\", state=\"running\"} == 0 and on (instance, service) windows_service_start_mode{job=~\"$job\", start_mode=\"auto\"} == 1)) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1402,7 +1402,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count((count by (instance) (windows_service_state{job=~\"$job\", state=\"running\"} == 0 and on (instance, name) windows_service_start_mode{job=~\"$job\", start_mode=\"auto\"} == 1)) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}) or (0 * count(windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", + "expr": "count((count by (instance) (windows_service_state{job=~\"$job\", state=\"running\"} == 0 and on (instance, service) windows_service_start_mode{job=~\"$job\", start_mode=\"auto\"} == 1)) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}) or (0 * count(windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", "instant": false, "legendFormat": "__auto", "range": true diff --git a/dashboard/windows-exporter-overview.json b/dashboard/windows-exporter-overview.json index fae31fba..28dd2118 100644 --- a/dashboard/windows-exporter-overview.json +++ b/dashboard/windows-exporter-overview.json @@ -691,7 +691,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0 and on (name) windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1) or vector(0)", + "expr": "count(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0 and on (service) windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1) or vector(0)", "instant": true, "legendFormat": "__auto", "range": false diff --git a/dashboard/windows-exporter-services.json b/dashboard/windows-exporter-services.json index cafdd2fe..7d7d1e96 100644 --- a/dashboard/windows-exporter-services.json +++ b/dashboard/windows-exporter-services.json @@ -163,7 +163,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0 and on (name) windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1) or vector(0)", + "expr": "count(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0 and on (service) windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1) or vector(0)", "instant": false, "legendFormat": "__auto", "range": true @@ -424,7 +424,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name, state) (windows_service_state{job=~\"$job\", instance=\"$instance\"} == 1) and on (name) (windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0) and on (name) (windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1)", + "expr": "max by (service, state) (windows_service_state{job=~\"$job\", instance=\"$instance\"} == 1) and on (service) (windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} == 0) and on (service) (windows_service_start_mode{job=~\"$job\", instance=\"$instance\", start_mode=\"auto\"} == 1)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -450,11 +450,11 @@ }, "includeByName": {}, "indexByName": { - "name": 0, + "service": 0, "state": 1 }, "renameByName": { - "name": "Service", + "service": "Service", "state": "State" } } @@ -540,9 +540,9 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} and on (name) (changes(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"}[$__range] @ end()) > 0)", + "expr": "windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"} and on (service) (changes(windows_service_state{job=~\"$job\", instance=\"$instance\", state=\"running\"}[$__range] @ end()) > 0)", "instant": false, - "legendFormat": "{{name}}", + "legendFormat": "{{service}}", "range": true }, "version": "v0" diff --git a/docs/collector.dfsr.md b/docs/collector.dfsr.md index 306416eb..9c3730d7 100644 --- a/docs/collector.dfsr.md +++ b/docs/collector.dfsr.md @@ -21,47 +21,47 @@ All sources are enabled by default Name | Description | Type | Labels -----|-------------|------|------- -`windows_dfsr_connection_bandwidth_savings_using_dfs_replication_ratio` | Share of bandwidth (0-1) saved by the DFS Replication service for this connection, using a combination of remote differential compression (RDC) and other compression technologies, compared to transferring the files uncompressed. For example, `0.2` means DFS Replication used 20% less bandwidth. | gauge | name -`windows_dfsr_connection_bytes_received_total` | Total bytes received for connection | counter | name -`windows_dfsr_connection_compressed_size_of_files_received_bytes_total` | Total compressed size of files received on the connection, in bytes | counter | name -`windows_dfsr_connection_received_files_total` | Total number of files received for connection | counter | name -`windows_dfsr_connection_rdc_received_bytes_total` | Total bytes received on the connection while replicating files using Remote Differential Compression. This is the actual bytes received over the network without the networking protocol overhead | counter | name -`windows_dfsr_connection_rdc_compressed_size_of_received_files_bytes_total` | Total compressed size of files received with Remote Differential Compression on the connection, in bytes. This is the number of bytes that would have been received had RDC not been used. This is not the actual number of bytes received over the network. | counter | name -`windows_dfsr_connection_rdc_received_files_total` | Total number of files received using remote differential compression | counter | name -`windows_dfsr_connection_rdc_size_of_received_files_bytes_total` | Total uncompressed size of files received with remote differential compression, in bytes. This is the number of bytes that would have been received had neither compression nor RDC been used. This is not the actual number of bytes received over the network. | counter | name -`windows_dfsr_connection_files_received_bytes_total` | Total uncompressed size of files received on the connection, in bytes. This is the number of bytes that would have been received had DFS Replication compression not been used. | counter | name -`windows_dfsr_folder_bandwidth_savings_using_dfs_replication_ratio` | Share of bandwidth (0-1) saved by the DFS Replication service for this replicated folder, using a combination of remote differential compression (RDC) and other compression technologies, compared to transferring the files uncompressed. For example, `0.2` means DFS Replication used 20% less bandwidth. | gauge | name -`windows_dfsr_folder_compressed_size_of_received_files_bytes_total` | Total compressed size of files received for this folder, in bytes | counter | name -`windows_dfsr_folder_conflict_cleaned_up_bytes_total` | Total size of conflict loser files and folders deleted from the Conflict and Deleted folder, in bytes. | counter | name -`windows_dfsr_folder_conflict_generated_bytes_total` | Total size of conflict loser files and folders moved to the Conflict and Deleted folder, in bytes. | counter | name -`windows_dfsr_folder_conflict_cleaned_up_files_total` | Number of conflict loser files deleted from the Conflict and Deleted folder. | counter | name -`windows_dfsr_folder_conflict_generated_files_total` | Number of files and folders moved to the Conflict and Deleted folder | counter | name -`windows_dfsr_folder_conflict_folder_cleanups_total` | Number of deletions of conflict loser files and folders in the Conflict and Deleted | counter | name -`windows_dfsr_folder_conflict_space_in_use_bytes` | Total size of the conflict loser files and folders currently in the Conflict and Deleted folder | gauge | name -`windows_dfsr_folder_deleted_space_in_use_bytes` | Total size (in bytes) of the deleted files and folders currently in the Conflict and Deleted folder. | gauge | name -`windows_dfsr_folder_deleted_cleaned_up_bytes_total` | Total size (in bytes) of replicating deleted files and folders that were cleaned up from the Conflict and Deleted folder. | counter | name -`windows_dfsr_folder_deleted_generated_bytes_total` | Total size (in bytes) of replicated deleted files and folders that were moved to the Conflict and Deleted folder after they were deleted from a replicated folder on a sending member. | counter | name -`windows_dfsr_folder_deleted_cleaned_up_files_total` | Number of files and folders that were cleaned up from the Conflict and Deleted folder. | counter | name -`windows_dfsr_folder_deleted_generated_files_total` | Number of deleted files and folders that were moved to the Conflict and Deleted folder. | counter | name -`windows_dfsr_folder_file_installs_retried_total` | Total number of file installs that are being retried due to sharing violations or other errors encountered when installing the files. The DFS Replication service replicates staged files into a staging folder, uncompresses them in the Installing folder, and renames them to the target location. The second and third steps of this process are known as installing the file. | counter | name -`windows_dfsr_folder_file_installs_succeeded_total` | Total number of files that were successfully received from sending members and installed locally on this server. The DFS Replication service replicates staged files into a staging folder, uncompresses them in the Installing folder, and renames them to the target location. The second and third steps of this process are known as installing the file. | counter | name -`windows_dfsr_folder_received_files_total` | Total number of files received. | counter | name -`windows_dfsr_folder_rdc_received_bytes_total` | Total number of bytes received in replicating files using Remote Differential Compression. This is the actual bytes received over the network without the networking protocol overhead. | counter | name -`windows_dfsr_folder_rdc_compressed_size_of_received_files_bytes_total` | Total compressed size (in bytes) of the files received with Remote Differential Compression. This is the number of bytes that would have been received had RDC not been used. This is not the actual bytes received over the network. | counter | name -`windows_dfsr_folder_rdc_received_files_total` | Total number of files received with Remote Differential Compression. | counter | name -`windows_dfsr_folder_rdc_files_received_bytes_total` | Total uncompressed size (in bytes) of the files received with Remote Differential Compression. This is the number of bytes that would have been received had neither compression nor RDC been used. This is not the actual bytes received over the network. | counter | name -`windows_dfsr_folder_files_received_bytes_total` | Total uncompressed size (in bytes) of the files received. | counter | name -`windows_dfsr_folder_staging_space_in_use_bytes` | Total size of files and folders currently in the staging folder. This metric will fluctuate as staging space is reclaimed. | gauge | name -`windows_dfsr_folder_staging_cleaned_up_bytes_total` | Total size (in bytes) of the files and folders that have been cleaned up from the staging folder. | counter | name -`windows_dfsr_folder_staging_generated_bytes_total` | Total size (in bytes) of replicated files and folders in the staging folder created by the DFS Replication service since last restart. | counter | name -`windows_dfsr_folder_staging_cleaned_up_files_total` | Total number of files and folders that have been cleaned up from the staging folder. | counter | name -`windows_dfsr_folder_staging_generated_files_total` | Total number of times replicated files and folders have been staged by the DFS Replication service. | counter | name -`windows_dfsr_folder_dropped_updates_total` | Total number of redundant file replication update records that have been ignored by the DFS Replication service because they did not change the replicated file or folder. | counter | name -`windows_dfsr_volume_database_commits_total` | Total number of DFSR Volume database commits. | counter | name -`windows_dfsr_volume_database_lookups_total` | Total number of DFSR Volume database lookups. | counter | name -`windows_dfsr_volume_usn_journal_unread_ratio` | Share (0-1) of the volume USN journal that the DFS Replication service has not read and processed yet. A journal wrap occurs when it reaches `1`. | gauge | name -`windows_dfsr_volume_usn_journal_accepted_records_total` | Total number of USN journal records accepted. | counter | name -`windows_dfsr_volume_usn_journal_read_records_total` | Total number of DFSR Volume USN journal records read. | counter | name +`windows_dfsr_connection_bandwidth_savings_using_dfs_replication_ratio` | Share of bandwidth (0-1) saved by the DFS Replication service for this connection, using a combination of remote differential compression (RDC) and other compression technologies, compared to transferring the files uncompressed. For example, `0.2` means DFS Replication used 20% less bandwidth. | gauge | connection +`windows_dfsr_connection_bytes_received_total` | Total bytes received for connection | counter | connection +`windows_dfsr_connection_compressed_size_of_files_received_bytes_total` | Total compressed size of files received on the connection, in bytes | counter | connection +`windows_dfsr_connection_received_files_total` | Total number of files received for connection | counter | connection +`windows_dfsr_connection_rdc_received_bytes_total` | Total bytes received on the connection while replicating files using Remote Differential Compression. This is the actual bytes received over the network without the networking protocol overhead | counter | connection +`windows_dfsr_connection_rdc_compressed_size_of_received_files_bytes_total` | Total compressed size of files received with Remote Differential Compression on the connection, in bytes. This is the number of bytes that would have been received had RDC not been used. This is not the actual number of bytes received over the network. | counter | connection +`windows_dfsr_connection_rdc_received_files_total` | Total number of files received using remote differential compression | counter | connection +`windows_dfsr_connection_rdc_size_of_received_files_bytes_total` | Total uncompressed size of files received with remote differential compression, in bytes. This is the number of bytes that would have been received had neither compression nor RDC been used. This is not the actual number of bytes received over the network. | counter | connection +`windows_dfsr_connection_files_received_bytes_total` | Total uncompressed size of files received on the connection, in bytes. This is the number of bytes that would have been received had DFS Replication compression not been used. | counter | connection +`windows_dfsr_folder_bandwidth_savings_using_dfs_replication_ratio` | Share of bandwidth (0-1) saved by the DFS Replication service for this replicated folder, using a combination of remote differential compression (RDC) and other compression technologies, compared to transferring the files uncompressed. For example, `0.2` means DFS Replication used 20% less bandwidth. | gauge | folder +`windows_dfsr_folder_compressed_size_of_received_files_bytes_total` | Total compressed size of files received for this folder, in bytes | counter | folder +`windows_dfsr_folder_conflict_cleaned_up_bytes_total` | Total size of conflict loser files and folders deleted from the Conflict and Deleted folder, in bytes. | counter | folder +`windows_dfsr_folder_conflict_generated_bytes_total` | Total size of conflict loser files and folders moved to the Conflict and Deleted folder, in bytes. | counter | folder +`windows_dfsr_folder_conflict_cleaned_up_files_total` | Number of conflict loser files deleted from the Conflict and Deleted folder. | counter | folder +`windows_dfsr_folder_conflict_generated_files_total` | Number of files and folders moved to the Conflict and Deleted folder | counter | folder +`windows_dfsr_folder_conflict_folder_cleanups_total` | Number of deletions of conflict loser files and folders in the Conflict and Deleted | counter | folder +`windows_dfsr_folder_conflict_space_in_use_bytes` | Total size of the conflict loser files and folders currently in the Conflict and Deleted folder | gauge | folder +`windows_dfsr_folder_deleted_space_in_use_bytes` | Total size (in bytes) of the deleted files and folders currently in the Conflict and Deleted folder. | gauge | folder +`windows_dfsr_folder_deleted_cleaned_up_bytes_total` | Total size (in bytes) of replicating deleted files and folders that were cleaned up from the Conflict and Deleted folder. | counter | folder +`windows_dfsr_folder_deleted_generated_bytes_total` | Total size (in bytes) of replicated deleted files and folders that were moved to the Conflict and Deleted folder after they were deleted from a replicated folder on a sending member. | counter | folder +`windows_dfsr_folder_deleted_cleaned_up_files_total` | Number of files and folders that were cleaned up from the Conflict and Deleted folder. | counter | folder +`windows_dfsr_folder_deleted_generated_files_total` | Number of deleted files and folders that were moved to the Conflict and Deleted folder. | counter | folder +`windows_dfsr_folder_file_installs_retried_total` | Total number of file installs that are being retried due to sharing violations or other errors encountered when installing the files. The DFS Replication service replicates staged files into a staging folder, uncompresses them in the Installing folder, and renames them to the target location. The second and third steps of this process are known as installing the file. | counter | folder +`windows_dfsr_folder_file_installs_succeeded_total` | Total number of files that were successfully received from sending members and installed locally on this server. The DFS Replication service replicates staged files into a staging folder, uncompresses them in the Installing folder, and renames them to the target location. The second and third steps of this process are known as installing the file. | counter | folder +`windows_dfsr_folder_received_files_total` | Total number of files received. | counter | folder +`windows_dfsr_folder_rdc_received_bytes_total` | Total number of bytes received in replicating files using Remote Differential Compression. This is the actual bytes received over the network without the networking protocol overhead. | counter | folder +`windows_dfsr_folder_rdc_compressed_size_of_received_files_bytes_total` | Total compressed size (in bytes) of the files received with Remote Differential Compression. This is the number of bytes that would have been received had RDC not been used. This is not the actual bytes received over the network. | counter | folder +`windows_dfsr_folder_rdc_received_files_total` | Total number of files received with Remote Differential Compression. | counter | folder +`windows_dfsr_folder_rdc_files_received_bytes_total` | Total uncompressed size (in bytes) of the files received with Remote Differential Compression. This is the number of bytes that would have been received had neither compression nor RDC been used. This is not the actual bytes received over the network. | counter | folder +`windows_dfsr_folder_files_received_bytes_total` | Total uncompressed size (in bytes) of the files received. | counter | folder +`windows_dfsr_folder_staging_space_in_use_bytes` | Total size of files and folders currently in the staging folder. This metric will fluctuate as staging space is reclaimed. | gauge | folder +`windows_dfsr_folder_staging_cleaned_up_bytes_total` | Total size (in bytes) of the files and folders that have been cleaned up from the staging folder. | counter | folder +`windows_dfsr_folder_staging_generated_bytes_total` | Total size (in bytes) of replicated files and folders in the staging folder created by the DFS Replication service since last restart. | counter | folder +`windows_dfsr_folder_staging_cleaned_up_files_total` | Total number of files and folders that have been cleaned up from the staging folder. | counter | folder +`windows_dfsr_folder_staging_generated_files_total` | Total number of times replicated files and folders have been staged by the DFS Replication service. | counter | folder +`windows_dfsr_folder_dropped_updates_total` | Total number of redundant file replication update records that have been ignored by the DFS Replication service because they did not change the replicated file or folder. | counter | folder +`windows_dfsr_volume_database_commits_total` | Total number of DFSR Volume database commits. | counter | volume +`windows_dfsr_volume_database_lookups_total` | Total number of DFSR Volume database lookups. | counter | volume +`windows_dfsr_volume_usn_journal_unread_ratio` | Share (0-1) of the volume USN journal that the DFS Replication service has not read and processed yet. A journal wrap occurs when it reaches `1`. | gauge | volume +`windows_dfsr_volume_usn_journal_accepted_records_total` | Total number of USN journal records accepted. | counter | volume +`windows_dfsr_volume_usn_journal_read_records_total` | Total number of DFSR Volume USN journal records read. | counter | volume ### Example metric _This collector does not yet have explained examples, we would appreciate your help adding them!_ diff --git a/docs/collector.dhcp.md b/docs/collector.dhcp.md index 8b583b74..fdb54bb5 100644 --- a/docs/collector.dhcp.md +++ b/docs/collector.dhcp.md @@ -50,7 +50,7 @@ Comma-separated list of collectors to use. Supported values are `server_metrics` | `windows_dhcp_scope_addresses_in_use_on_this_server` | DHCP Scope addresses in use on this server | gauge | `scope` | | `windows_dhcp_scope_addresses_in_use_on_partner_server` | DHCP Scope addresses in use on partner server | gauge | `scope` | | `windows_dhcp_scope_addresses_in_use` | DHCP Scope addresses in use | gauge | `scope` | -| `windows_dhcp_scope_info` | DHCP Scope information | gauge | `name`, `superscope_name`, `superscope_id`, `scope` | +| `windows_dhcp_scope_info` | DHCP Scope information | gauge | `scope_name`, `superscope_name`, `superscope_id`, `scope` | | `windows_dhcp_scope_pending_offers` | DHCP Scope pending offers | gauge | `scope` | | `windows_dhcp_scope_reserved_address` | DHCP Scope reserved addresses | gauge | `scope` | | `windows_dhcp_scope_state` | DHCP Scope state | gauge | `scope`, `state` | @@ -145,9 +145,9 @@ windows_dhcp_scope_addresses_in_use{scope="172.16.0.0/24"} 0 windows_dhcp_scope_addresses_in_use{scope="192.168.0.0/24"} 0 # HELP windows_dhcp_scope_info DHCP Scope information # TYPE windows_dhcp_scope_info gauge -windows_dhcp_scope_info{name="SUBSUPERSCOPE",scope="172.16.0.0/24",superscope_id="2",superscope_name="SUPERSCOPE"} 1 -windows_dhcp_scope_info{name="TEST",scope="192.168.0.0/24",superscope_id="0",superscope_name=""} 1 -windows_dhcp_scope_info{name="TEST2",scope="10.11.12.0/25",superscope_id="2",superscope_name="SUPERSCOPE"} 1 +windows_dhcp_scope_info{scope_name="SUBSUPERSCOPE",scope="172.16.0.0/24",superscope_id="2",superscope_name="SUPERSCOPE"} 1 +windows_dhcp_scope_info{scope_name="TEST",scope="192.168.0.0/24",superscope_id="0",superscope_name=""} 1 +windows_dhcp_scope_info{scope_name="TEST2",scope="10.11.12.0/25",superscope_id="2",superscope_name="SUPERSCOPE"} 1 # HELP windows_dhcp_scope_pending_offers DHCP Scope pending offers # TYPE windows_dhcp_scope_pending_offers gauge windows_dhcp_scope_pending_offers{scope="10.11.12.0/25"} 0 diff --git a/docs/collector.diskdrive.md b/docs/collector.diskdrive.md index 29bf7245..dc0995ed 100644 --- a/docs/collector.diskdrive.md +++ b/docs/collector.diskdrive.md @@ -16,11 +16,11 @@ None | Name | Description | Type | Labels | | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------ | -| `windows_diskdrive_info` | General identifiable information about the disk drive | gauge | device_id,model,caption,name | -| `windows_diskdrive_availability` | The disk drive's current availability | gauge | name,availability | -| `windows_diskdrive_partitions` | Number of partitions on the drive | gauge | name | -| `windows_diskdrive_size_bytes` | Size of the disk drive. It is calculated by multiplying the total number of cylinders, tracks in each cylinder, sectors in each track, and bytes in each sector. | gauge | name | -| `windows_diskdrive_status` | Operational status of the drive | gauge | name,status | +| `windows_diskdrive_info` | General identifiable information about the disk drive | gauge | device_id,model,caption | +| `windows_diskdrive_availability` | The disk drive's current availability | gauge | device_id,availability | +| `windows_diskdrive_partitions` | Number of partitions on the drive | gauge | device_id | +| `windows_diskdrive_size_bytes` | Size of the disk drive. It is calculated by multiplying the total number of cylinders, tracks in each cylinder, sectors in each track, and bytes in each sector. | gauge | device_id | +| `windows_diskdrive_status` | Operational status of the drive | gauge | device_id,status | ## Alerting examples **prometheus.rules** @@ -35,6 +35,6 @@ groups: labels: severity: high annotations: - summary: "Instance: {{ $labels.instance }} has drive status: {{ $labels.status }} on disk {{ $labels.name }}" + summary: "Instance: {{ $labels.instance }} has drive status: {{ $labels.status }} on disk {{ $labels.device_id }}" description: "Drive Status Unhealthy" ``` diff --git a/docs/collector.dns.md b/docs/collector.dns.md index e3eeed72..22317b2b 100644 --- a/docs/collector.dns.md +++ b/docs/collector.dns.md @@ -43,7 +43,7 @@ Name | Description | Type | Labels `windows_dns_wins_queries_total` | Number of WINS lookup requests received by the server | counter | `direction` `windows_dns_wins_responses_total` | Number of WINS lookup responses sent by the server | counter | `direction` `windows_dns_unmatched_responses_total` | Number of response packets received by the DNS server that do not match any outstanding remote query | counter | None -`windows_dns_wmi_stats_total` | DNS WMI statistics from MicrosoftDNS_Statistic | counter | `name`, `collection_name`, `dns_server` +`windows_dns_wmi_stats_total` | DNS WMI statistics from MicrosoftDNS_Statistic | counter | `statistic`, `collection_name`, `dns_server` ### Sub-collectors @@ -73,22 +73,22 @@ windows_exporter.exe --collector.dns.enabled=metrics,wmi_stats ### Example metric ``` -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="BadKey"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="BadSig"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="BadTime"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="FormError"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="Max"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NoError"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NotAuth"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NotImpl"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NotZone"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NxDomain"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NxRRSet"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="Refused"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="ServFail"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="UnknownError"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="YxDomain"} 0 -windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="YxRRSet"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="BadKey"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="BadSig"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="BadTime"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="FormError"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="Max"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="NoError"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="NotAuth"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="NotImpl"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="NotZone"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="NxDomain"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="NxRRSet"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="Refused"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="ServFail"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="UnknownError"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="YxDomain"} 0 +windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",statistic="YxRRSet"} 0 ``` ## Useful queries diff --git a/docs/collector.exchange.md b/docs/collector.exchange.md index d69e9fce..e6312a66 100644 --- a/docs/collector.exchange.md +++ b/docs/collector.exchange.md @@ -26,49 +26,49 @@ Supported values are `ADAccessProcesses`, `TransportQueues`, `HttpProxy`, `Activ | `windows_exchange_rpc_connections` | Total number of client connections maintained | gauge | None | | `windows_exchange_rpc_operations_total` | The rate at which RPC operations occur | counter | None | | `windows_exchange_rpc_users` | Number of users | gauge | None | -| `windows_exchange_ldap_read_time_seconds_total` | Total time in seconds to send an LDAP read request and receive a response | counter | `name` | -| `windows_exchange_ldap_read_operations_total` | Total number of LDAP read operations | counter | `name` | -| `windows_exchange_ldap_search_time_seconds_total` | Total time in seconds to send an LDAP search request and receive a response | counter | `name` | -| `windows_exchange_ldap_search_operations_total` | Total number of LDAP search operations | counter | `name` | -| `windows_exchange_ldap_write_time_seconds_total` | Total time in seconds to send an LDAP Add/Modify/Delete request and receive a response | counter | `name` | -| `windows_exchange_ldap_write_operations_total` | Total number of LDAP Add/Modify/Delete operations | counter | `name` | -| `windows_exchange_ldap_timeout_errors_total` | Total number of LDAP timeout errors | counter | `name` | -| `windows_exchange_ldap_long_running_operations_per_second` | Long running LDAP operations per second, averaged over the last minute | gauge | `name` | -| `windows_exchange_transport_queues_external_active_remote_delivery` | External Active Remote Delivery Queue length | gauge | `name` | -| `windows_exchange_transport_queues_internal_active_remote_delivery` | Internal Active Remote Delivery Queue length | gauge | `name` | -| `windows_exchange_transport_queues_active_mailbox_delivery` | Active Mailbox Delivery Queue length | gauge | `name` | -| `windows_exchange_transport_queues_retry_mailbox_delivery` | Retry Mailbox Delivery Queue length | gauge | `name` | -| `windows_exchange_transport_queues_unreachable` | Unreachable Queue length | gauge | `name` | -| `windows_exchange_transport_queues_external_largest_delivery` | External Largest Delivery Queue length | gauge | `name` | -| `windows_exchange_transport_queues_internal_largest_delivery` | Internal Largest Delivery Queue length | gauge | `name` | -| `windows_exchange_transport_queues_poison` | Poison Queue length | gauge | `name` | -| `windows_exchange_transport_queues_messages_queued_for_delivery_total` | Messages Queued For Delivery Total | counter | `name` | -| `windows_exchange_transport_queues_messages_submitted_total` | Messages Submitted Total | counter | `name` | -| `windows_exchange_transport_queues_messages_delayed_total` | Messages Delayed Total | counter | `name` | -| `windows_exchange_transport_queues_messages_completed_delivery_total` | Messages Completed Delivery Total | counter | `name` | -| `windows_exchange_transport_queues_aggregate_shadow_queue_length` | The current number of messages in shadow queues | gauge | `name` | -| `windows_exchange_transport_queues_submission_queue_length` | Submission Queue Length | gauge | `name` | -| `windows_exchange_transport_queues_delay_queue_length` | Delay Queue Length | gauge | `name` | -| `windows_exchange_transport_queues_items_completed_delivery_total` | Items Completed Delivery Total | counter | `name` | -| `windows_exchange_transport_queues_items_queued_for_delivery_expired_total` | Items Queued For Delivery Expired Total | counter | `name` | -| `windows_exchange_transport_queues_items_queued_for_delivery_total` | Items Queued For Delivery Total | counter | `name` | -| `windows_exchange_transport_queues_items_resubmitted_total` | Items Resubmitted Total | counter | `name` | -| `windows_exchange_http_proxy_mailbox_server_locator_avg_latency_seconds` | Average latency in seconds of MailboxServerLocator web service calls | gauge | `name` | -| `windows_exchange_http_proxy_avg_auth_latency_seconds` | Average time in seconds spent authenticating CAS requests over the last 200 samples | gauge | `name` | -| `windows_exchange_http_proxy_outstanding_proxy_requests` | Number of concurrent outstanding proxy requests | gauge | `name` | -| `windows_exchange_http_proxy_requests_total` | Number of proxy requests processed each second | counter | `name` | +| `windows_exchange_ldap_read_time_seconds_total` | Total time in seconds to send an LDAP read request and receive a response | counter | `process` | +| `windows_exchange_ldap_read_operations_total` | Total number of LDAP read operations | counter | `process` | +| `windows_exchange_ldap_search_time_seconds_total` | Total time in seconds to send an LDAP search request and receive a response | counter | `process` | +| `windows_exchange_ldap_search_operations_total` | Total number of LDAP search operations | counter | `process` | +| `windows_exchange_ldap_write_time_seconds_total` | Total time in seconds to send an LDAP Add/Modify/Delete request and receive a response | counter | `process` | +| `windows_exchange_ldap_write_operations_total` | Total number of LDAP Add/Modify/Delete operations | counter | `process` | +| `windows_exchange_ldap_timeout_errors_total` | Total number of LDAP timeout errors | counter | `process` | +| `windows_exchange_ldap_long_running_operations_per_second` | Long running LDAP operations per second, averaged over the last minute | gauge | `process` | +| `windows_exchange_transport_queues_external_active_remote_delivery` | External Active Remote Delivery Queue length | gauge | `queue` | +| `windows_exchange_transport_queues_internal_active_remote_delivery` | Internal Active Remote Delivery Queue length | gauge | `queue` | +| `windows_exchange_transport_queues_active_mailbox_delivery` | Active Mailbox Delivery Queue length | gauge | `queue` | +| `windows_exchange_transport_queues_retry_mailbox_delivery` | Retry Mailbox Delivery Queue length | gauge | `queue` | +| `windows_exchange_transport_queues_unreachable` | Unreachable Queue length | gauge | `queue` | +| `windows_exchange_transport_queues_external_largest_delivery` | External Largest Delivery Queue length | gauge | `queue` | +| `windows_exchange_transport_queues_internal_largest_delivery` | Internal Largest Delivery Queue length | gauge | `queue` | +| `windows_exchange_transport_queues_poison` | Poison Queue length | gauge | `queue` | +| `windows_exchange_transport_queues_messages_queued_for_delivery_total` | Messages Queued For Delivery Total | counter | `queue` | +| `windows_exchange_transport_queues_messages_submitted_total` | Messages Submitted Total | counter | `queue` | +| `windows_exchange_transport_queues_messages_delayed_total` | Messages Delayed Total | counter | `queue` | +| `windows_exchange_transport_queues_messages_completed_delivery_total` | Messages Completed Delivery Total | counter | `queue` | +| `windows_exchange_transport_queues_aggregate_shadow_queue_length` | The current number of messages in shadow queues | gauge | `queue` | +| `windows_exchange_transport_queues_submission_queue_length` | Submission Queue Length | gauge | `queue` | +| `windows_exchange_transport_queues_delay_queue_length` | Delay Queue Length | gauge | `queue` | +| `windows_exchange_transport_queues_items_completed_delivery_total` | Items Completed Delivery Total | counter | `queue` | +| `windows_exchange_transport_queues_items_queued_for_delivery_expired_total` | Items Queued For Delivery Expired Total | counter | `queue` | +| `windows_exchange_transport_queues_items_queued_for_delivery_total` | Items Queued For Delivery Total | counter | `queue` | +| `windows_exchange_transport_queues_items_resubmitted_total` | Items Resubmitted Total | counter | `queue` | +| `windows_exchange_http_proxy_mailbox_server_locator_avg_latency_seconds` | Average latency in seconds of MailboxServerLocator web service calls | gauge | `protocol` | +| `windows_exchange_http_proxy_avg_auth_latency_seconds` | Average time in seconds spent authenticating CAS requests over the last 200 samples | gauge | `protocol` | +| `windows_exchange_http_proxy_outstanding_proxy_requests` | Number of concurrent outstanding proxy requests | gauge | `protocol` | +| `windows_exchange_http_proxy_requests_total` | Number of proxy requests processed each second | counter | `protocol` | | `windows_exchange_availability_service_requests_total` | Total number of requests serviced | counter | None | | `windows_exchange_owa_current_unique_users` | Number of unique users currently logged on to Outlook Web App | gauge | None | | `windows_exchange_owa_requests_total` | Number of requests handled by Outlook Web App per second | counter | None | | `windows_exchange_autodiscover_requests_total` | Number of autodiscover service requests processed each second | counter | None | -| `windows_exchange_workload_active_tasks` | Number of active tasks currently running in the background for workload management | gauge | `name` | -| `windows_exchange_workload_completed_tasks_total` | Number of workload management tasks that have been completed | counter | `name` | -| `windows_exchange_workload_queued_tasks` | Number of workload management tasks that are currently queued up waiting to be processed | gauge | `name` | -| `windows_exchange_workload_yielded_tasks_total` | The total number of tasks that have been yielded by a workload | counter | `name` | -| `windows_exchange_workload_is_active` | Active indicates whether the workload is in an active (1) or paused (0) state | gauge | `name` | +| `windows_exchange_workload_active_tasks` | Number of active tasks currently running in the background for workload management | gauge | `workload` | +| `windows_exchange_workload_completed_tasks_total` | Number of workload management tasks that have been completed | counter | `workload` | +| `windows_exchange_workload_queued_tasks` | Number of workload management tasks that are currently queued up waiting to be processed | gauge | `workload` | +| `windows_exchange_workload_yielded_tasks_total` | The total number of tasks that have been yielded by a workload | counter | `workload` | +| `windows_exchange_workload_is_active` | Active indicates whether the workload is in an active (1) or paused (0) state | gauge | `workload` | | `windows_exchange_activesync_requests_total` | Num HTTP requests received from the client via ASP.NET per sec. Shows Current user load | counter | None | -| `windows_exchange_http_proxy_avg_cas_processing_latency_seconds` | Average latency in seconds of CAS processing time over the last 200 reqs | gauge | `name` | -| `windows_exchange_http_proxy_mailbox_proxy_failure_ratio` | Ratio (0-1) of failures between this CAS and MBX servers over the last 200 sample | gauge | `name` | +| `windows_exchange_http_proxy_avg_cas_processing_latency_seconds` | Average latency in seconds of CAS processing time over the last 200 reqs | gauge | `protocol` | +| `windows_exchange_http_proxy_mailbox_proxy_failure_ratio` | Ratio (0-1) of failures between this CAS and MBX servers over the last 200 sample | gauge | `protocol` | | `windows_exchange_activesync_ping_cmds_pending` | Number of ping commands currently pending in the queue | gauge | None | | `windows_exchange_activesync_sync_cmds_total` | Number of sync commands processed per second. Clients use this command to synchronize items within a folder | counter | None | | `windows_exchange_mapihttp_emsmdb_active_users` | Number of unique outlook users that have shown some kind of activity in the last 2 minutes | gauge | None | diff --git a/docs/collector.hyperv.md b/docs/collector.hyperv.md index 8d59e80d..12089866 100644 --- a/docs/collector.hyperv.md +++ b/docs/collector.hyperv.md @@ -301,25 +301,27 @@ Example alert: ### Hyper-V Virtual SMB +The `vm` label holds the instance name of the `Hyper-V Virtual SMB` performance counter object unchanged. Microsoft does not document its format (virtual machine name or ID), and the test hosts have no Virtual SMB instances, so it was not verified. + | Name | Description | Type | Labels | |-------------------------------------------------------|-----------------------------------------------------------------------------------|---------|------------| -| `windows_hyperv_virtual_smb_direct_mapped_sections` | Represents the number of direct-mapped sections in the virtual SMB` | gauge | `instance` | -| `windows_hyperv_virtual_smb_direct_mapped_pages` | Represents the number of direct-mapped pages in the virtual SMB` | gauge | `instance` | -| `windows_hyperv_virtual_smb_rdma_write_bytes_total` | Represents the total number of bytes written using RDMA in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_write_bytes_total` | Represents the total number of bytes written in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_rdma_read_bytes_total` | Represents the total number of bytes read using RDMA in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_read_bytes_total` | Represents the total number of bytes read in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_flush_requests_total` | Represents the total number of flush requests in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_rdma_write_requests_total` | Represents the total number of write requests using RDMA in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_write_requests_total` | Represents the total number of write requests in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_rdma_read_requests_total` | Represents the total number of read requests using RDMA in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_read_requests_total` | Represents the total number of read requests in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_current_pending_requests` | Represents the current number of pending requests in the virtual SMB` | gauge | `instance` | -| `windows_hyperv_virtual_smb_open_files` | Represents the current number of open files in the virtual SMB` | gauge | `instance` | -| `windows_hyperv_virtual_smb_tree_connects_total` | Represents the total number of tree connects in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_requests_total` | Represents the total number of requests in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_sent_bytes_total` | Represents the total number of bytes sent in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_received_bytes_total` | Represents the total number of bytes received in the virtual SMB` | counter | `instance` | +| `windows_hyperv_virtual_smb_direct_mapped_sections` | Represents the number of direct-mapped sections in the virtual SMB` | gauge | `vm` | +| `windows_hyperv_virtual_smb_direct_mapped_pages` | Represents the number of direct-mapped pages in the virtual SMB` | gauge | `vm` | +| `windows_hyperv_virtual_smb_rdma_write_bytes_total` | Represents the total number of bytes written using RDMA in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_write_bytes_total` | Represents the total number of bytes written in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_rdma_read_bytes_total` | Represents the total number of bytes read using RDMA in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_read_bytes_total` | Represents the total number of bytes read in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_flush_requests_total` | Represents the total number of flush requests in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_rdma_write_requests_total` | Represents the total number of write requests using RDMA in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_write_requests_total` | Represents the total number of write requests in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_rdma_read_requests_total` | Represents the total number of read requests using RDMA in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_read_requests_total` | Represents the total number of read requests in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_current_pending_requests` | Represents the current number of pending requests in the virtual SMB` | gauge | `vm` | +| `windows_hyperv_virtual_smb_open_files` | Represents the current number of open files in the virtual SMB` | gauge | `vm` | +| `windows_hyperv_virtual_smb_tree_connects_total` | Represents the total number of tree connects in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_requests_total` | Represents the total number of requests in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_sent_bytes_total` | Represents the total number of bytes sent in the virtual SMB` | counter | `vm` | +| `windows_hyperv_virtual_smb_received_bytes_total` | Represents the total number of bytes received in the virtual SMB` | counter | `vm` | ### Hyper-V Virtual Switch diff --git a/docs/collector.mscluster.md b/docs/collector.mscluster.md index e3f5be9a..e18d2782 100644 --- a/docs/collector.mscluster.md +++ b/docs/collector.mscluster.md @@ -30,151 +30,151 @@ Matching is case-sensitive. All of these subcollectors are enabled by default. | Name | Description | Type | Labels | |-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|--------| -| `windows_mscluster_cluster_add_evict_delay_seconds` | Provides access to the cluster's AddEvictDelay property, which is the number of seconds that a new node is delayed after an eviction of another node. | gauge | `name` | -| `windows_mscluster_cluster_admin_access_point` | The type of the cluster administrative access point. | gauge | `name` | -| `windows_mscluster_cluster_auto_assign_node_site` | Determines whether or not the cluster will attempt to automatically assign nodes to sites based on networks and Active Directory Site information. | gauge | `name` | -| `windows_mscluster_cluster_auto_balancer_level` | Determines the level of aggressiveness of AutoBalancer. | gauge | `name` | -| `windows_mscluster_cluster_auto_balancer_mode` | Determines whether or not the auto balancer is enabled. | gauge | `name` | -| `windows_mscluster_cluster_backup_in_progress` | Indicates whether a backup is in progress. | gauge | `name` | -| `windows_mscluster_cluster_block_cache_size_bytes` | CSV BlockCache size in bytes. | gauge | `name` | -| `windows_mscluster_cluster_clus_svc_hang_timeout_seconds` | Controls how long, in seconds, the cluster network driver waits between Failover Cluster Service heartbeats before it determines that the Failover Cluster Service has stopped responding. | gauge | `name` | -| `windows_mscluster_cluster_clus_svc_regroup_opening_timeout_seconds` | Controls how long, in seconds, a node will wait on other nodes in the opening stage before deciding that they failed. | gauge | `name` | -| `windows_mscluster_cluster_clus_svc_regroup_pruning_timeout_seconds` | Controls how long, in seconds, the membership leader will wait to reach full connectivity between cluster nodes. | gauge | `name` | -| `windows_mscluster_cluster_clus_svc_regroup_stage_timeout_seconds` | Controls how long, in seconds, a node will wait on other nodes in a membership stage before deciding that they failed. | gauge | `name` | -| `windows_mscluster_cluster_clus_svc_regroup_tick_seconds` | Controls how frequently, in seconds, the membership algorithm is sending periodic membership messages. | gauge | `name` | -| `windows_mscluster_cluster_cluster_enforced_anti_affinity` | Enables or disables hard enforcement of group anti-affinity classes. | gauge | `name` | -| `windows_mscluster_cluster_cluster_functional_level` | The functional level the cluster is currently running in. | gauge | `name` | -| `windows_mscluster_cluster_cluster_group_wait_delay_seconds` | Maximum time in seconds that a group waits for its preferred node to come online during cluster startup before coming online on a different node. | gauge | `name` | -| `windows_mscluster_cluster_cluster_log_level` | Controls the level of cluster logging. | gauge | `name` | -| `windows_mscluster_cluster_cluster_log_size_bytes` | Controls the maximum size, in bytes, of the cluster log files on each of the nodes. | gauge | `name` | -| `windows_mscluster_cluster_cluster_upgrade_version` | Specifies the upgrade version the cluster is currently running in. | gauge | `name` | -| `windows_mscluster_cluster_cross_site_delay_seconds` | Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats across sites. | gauge | `name` | -| `windows_mscluster_cluster_cross_site_threshold` | Controls how many Cluster Service heartbeats can be missed across sites before it determines that Cluster Service has stopped responding. | gauge | `name` | -| `windows_mscluster_cluster_cross_subnet_delay_seconds` | Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats across subnets. | gauge | `name` | -| `windows_mscluster_cluster_cross_subnet_threshold` | Controls how many Cluster Service heartbeats can be missed across subnets before it determines that Cluster Service has stopped responding. | gauge | `name` | -| `windows_mscluster_cluster_csv_balancer` | Whether automatic balancing for CSV is enabled. | gauge | `name` | -| `windows_mscluster_cluster_database_read_write_mode` | Sets the database read and write mode. | gauge | `name` | -| `windows_mscluster_cluster_default_network_role` | Provides access to the cluster's DefaultNetworkRole property. | gauge | `name` | -| `windows_mscluster_cluster_detected_cloud_platform` | (DetectedCloudPlatform) | gauge | `name` | -| `windows_mscluster_cluster_detect_managed_events` | (DetectManagedEvents) | gauge | `name` | -| `windows_mscluster_cluster_detect_managed_events_threshold` | (DetectManagedEventsThreshold) | gauge | `name` | -| `windows_mscluster_cluster_disable_group_preferred_owner_randomization` | (DisableGroupPreferredOwnerRandomization) | gauge | `name` | -| `windows_mscluster_cluster_drain_on_shutdown` | Whether to drain the node when cluster service is being stopped. | gauge | `name` | -| `windows_mscluster_cluster_dynamic_quorum_enabled` | Allows cluster service to adjust node weights as needed to increase availability. | gauge | `name` | -| `windows_mscluster_cluster_enable_shared_volumes` | Enables or disables cluster shared volumes on this cluster. | gauge | `name` | -| `windows_mscluster_cluster_fix_quorum` | Provides access to the cluster's FixQuorum property, which specifies if the cluster is in a fix quorum state. | gauge | `name` | -| `windows_mscluster_cluster_grace_period_enabled` | Whether the node grace period feature of this cluster is enabled. | gauge | `name` | -| `windows_mscluster_cluster_grace_period_timeout_seconds` | The grace period timeout in seconds. | gauge | `name` | -| `windows_mscluster_cluster_group_dependency_timeout_seconds` | The timeout in seconds after which a group will be brought online despite unsatisfied dependencies | gauge | `name` | -| `windows_mscluster_cluster_hang_recovery_action` | Controls the action to take if the user-mode processes have stopped responding. | gauge | `name` | -| `windows_mscluster_cluster_ignore_persistent_state_on_startup` | Provides access to the cluster's IgnorePersistentStateOnStartup property, which specifies whether the cluster will bring online groups that were online when the cluster was shut down. | gauge | `name` | -| `windows_mscluster_cluster_log_resource_controls` | Controls the logging of resource controls. | gauge | `name` | -| `windows_mscluster_cluster_lower_quorum_priority_node_id` | Specifies the Node ID that has a lower priority when voting for quorum is performed. If the quorum vote is split 50/50%, the specified node's vote would be ignored to break the tie. If this is not set then the cluster will pick a node at random to break the tie. | gauge | `name` | -| `windows_mscluster_cluster_max_number_of_nodes` | Indicates the maximum number of nodes that may participate in the Cluster. | gauge | `name` | -| `windows_mscluster_cluster_message_buffer_length` | The maximum unacknowledged message count for GEM. | gauge | `name` | -| `windows_mscluster_cluster_minimum_never_preempt_priority` | Groups with this priority or higher cannot be preempted. | gauge | `name` | -| `windows_mscluster_cluster_minimum_preemptor_priority` | Minimum priority a cluster group must have to be able to preempt another group. | gauge | `name` | -| `windows_mscluster_cluster_netft_ip_sec_enabled` | Whether IPSec is enabled for cluster internal traffic. | gauge | `name` | -| `windows_mscluster_cluster_placement_options` | Various option flags to modify default placement behavior. | gauge | `name` | -| `windows_mscluster_cluster_plumb_all_cross_subnet_routes` | Plumbs all possible cross subnet routes to all nodes. | gauge | `name` | -| `windows_mscluster_cluster_prevent_quorum` | Whether the cluster will ignore group persistent state on startup. | gauge | `name` | -| `windows_mscluster_cluster_quarantine_duration_seconds` | The quarantine period timeout in seconds. | gauge | `name` | -| `windows_mscluster_cluster_quarantine_threshold` | Number of node failures before it will be quarantined. | gauge | `name` | -| `windows_mscluster_cluster_quorum_arbitration_time_max_seconds` | Controls the maximum time, in seconds, necessary to decide the Quorum owner node. | gauge | `name` | -| `windows_mscluster_cluster_quorum_arbitration_time_min_seconds` | Controls the minimum time, in seconds, necessary to decide the Quorum owner node. | gauge | `name` | -| `windows_mscluster_cluster_quorum_type_value` | Get the current quorum type value. -1: Unknown; 1: Node; 2: FileShareWitness; 3: Storage; 4: None | gauge | `name` | -| `windows_mscluster_cluster_request_reply_timeout_seconds` | Controls the request reply time-out period in seconds. | gauge | `name` | -| `windows_mscluster_cluster_resiliency_default_period_seconds` | The default resiliency period, in seconds, for the cluster. | gauge | `name` | -| `windows_mscluster_cluster_resiliency_level` | The resiliency level for the cluster. | gauge | `name` | -| `windows_mscluster_cluster_root_memory_reserved_bytes` | Controls the amount of memory, in bytes, reserved for the parent partition on all cluster nodes. | gauge | `name` | -| `windows_mscluster_cluster_route_history_length` | The history length for routes to help finding network issues. | gauge | `name` | -| `windows_mscluster_cluster_s2d_bus_types` | Bus types for storage spaces direct. | gauge | `name` | -| `windows_mscluster_cluster_s2d_cache_desired_state` | Desired state of the storage spaces direct cache. | gauge | `name` | -| `windows_mscluster_cluster_s2d_cache_flash_reserve_ratio` | Ratio (0-1) of allocated flash space to utilize when caching. | gauge | `name` | -| `windows_mscluster_cluster_s2d_cache_page_size_bytes` | Page size in bytes used by S2D cache. | gauge | `name` | -| `windows_mscluster_cluster_s2d_enabled` | Whether direct attached storage (DAS) is enabled. | gauge | `name` | -| `windows_mscluster_cluster_s2dio_latency_threshold_seconds` | The I/O latency threshold in seconds for storage spaces direct. | gauge | `name` | -| `windows_mscluster_cluster_s2d_optimizations` | Optimization flags for storage spaces direct. | gauge | `name` | -| `windows_mscluster_cluster_same_subnet_delay_seconds` | Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats on the same subnet. | gauge | `name` | -| `windows_mscluster_cluster_same_subnet_threshold` | Controls how many Cluster Service heartbeats can be missed on the same subnet before it determines that Cluster Service has stopped responding. | gauge | `name` | -| `windows_mscluster_cluster_security_level` | Controls the level of security that should apply to intracluster messages. 0: Clear Text; 1: Sign; 2: Encrypt | gauge | `name` | -| `windows_mscluster_cluster_security_level_for_storage` | (SecurityLevelForStorage) | gauge | `name` | -| `windows_mscluster_cluster_shared_volume_vss_writer_operation_timeout_seconds` | CSV VSS Writer operation timeout in seconds. | gauge | `name` | -| `windows_mscluster_cluster_shutdown_timeout_seconds` | The maximum time in seconds allowed for cluster resources to come offline during cluster service shutdown. | gauge | `name` | -| `windows_mscluster_cluster_use_client_access_networks_for_shared_volumes` | Whether the use of client access networks for cluster shared volumes feature of this cluster is enabled. 0: Disabled; 1: Enabled; 2: Auto | gauge | `name` | -| `windows_mscluster_cluster_witness_database_write_timeout_seconds` | Controls the maximum time in seconds that a cluster database write to a witness can take before the write is abandoned. | gauge | `name` | -| `windows_mscluster_cluster_witness_dynamic_weight` | The weight of the configured witness. | gauge | `name` | -| `windows_mscluster_cluster_witness_restart_interval_seconds` | Controls the witness restart interval in seconds. | gauge | `name` | +| `windows_mscluster_cluster_add_evict_delay_seconds` | Provides access to the cluster's AddEvictDelay property, which is the number of seconds that a new node is delayed after an eviction of another node. | gauge | `cluster` | +| `windows_mscluster_cluster_admin_access_point` | The type of the cluster administrative access point. | gauge | `cluster` | +| `windows_mscluster_cluster_auto_assign_node_site` | Determines whether or not the cluster will attempt to automatically assign nodes to sites based on networks and Active Directory Site information. | gauge | `cluster` | +| `windows_mscluster_cluster_auto_balancer_level` | Determines the level of aggressiveness of AutoBalancer. | gauge | `cluster` | +| `windows_mscluster_cluster_auto_balancer_mode` | Determines whether or not the auto balancer is enabled. | gauge | `cluster` | +| `windows_mscluster_cluster_backup_in_progress` | Indicates whether a backup is in progress. | gauge | `cluster` | +| `windows_mscluster_cluster_block_cache_size_bytes` | CSV BlockCache size in bytes. | gauge | `cluster` | +| `windows_mscluster_cluster_clus_svc_hang_timeout_seconds` | Controls how long, in seconds, the cluster network driver waits between Failover Cluster Service heartbeats before it determines that the Failover Cluster Service has stopped responding. | gauge | `cluster` | +| `windows_mscluster_cluster_clus_svc_regroup_opening_timeout_seconds` | Controls how long, in seconds, a node will wait on other nodes in the opening stage before deciding that they failed. | gauge | `cluster` | +| `windows_mscluster_cluster_clus_svc_regroup_pruning_timeout_seconds` | Controls how long, in seconds, the membership leader will wait to reach full connectivity between cluster nodes. | gauge | `cluster` | +| `windows_mscluster_cluster_clus_svc_regroup_stage_timeout_seconds` | Controls how long, in seconds, a node will wait on other nodes in a membership stage before deciding that they failed. | gauge | `cluster` | +| `windows_mscluster_cluster_clus_svc_regroup_tick_seconds` | Controls how frequently, in seconds, the membership algorithm is sending periodic membership messages. | gauge | `cluster` | +| `windows_mscluster_cluster_cluster_enforced_anti_affinity` | Enables or disables hard enforcement of group anti-affinity classes. | gauge | `cluster` | +| `windows_mscluster_cluster_cluster_functional_level` | The functional level the cluster is currently running in. | gauge | `cluster` | +| `windows_mscluster_cluster_cluster_group_wait_delay_seconds` | Maximum time in seconds that a group waits for its preferred node to come online during cluster startup before coming online on a different node. | gauge | `cluster` | +| `windows_mscluster_cluster_cluster_log_level` | Controls the level of cluster logging. | gauge | `cluster` | +| `windows_mscluster_cluster_cluster_log_size_bytes` | Controls the maximum size, in bytes, of the cluster log files on each of the nodes. | gauge | `cluster` | +| `windows_mscluster_cluster_cluster_upgrade_version` | Specifies the upgrade version the cluster is currently running in. | gauge | `cluster` | +| `windows_mscluster_cluster_cross_site_delay_seconds` | Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats across sites. | gauge | `cluster` | +| `windows_mscluster_cluster_cross_site_threshold` | Controls how many Cluster Service heartbeats can be missed across sites before it determines that Cluster Service has stopped responding. | gauge | `cluster` | +| `windows_mscluster_cluster_cross_subnet_delay_seconds` | Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats across subnets. | gauge | `cluster` | +| `windows_mscluster_cluster_cross_subnet_threshold` | Controls how many Cluster Service heartbeats can be missed across subnets before it determines that Cluster Service has stopped responding. | gauge | `cluster` | +| `windows_mscluster_cluster_csv_balancer` | Whether automatic balancing for CSV is enabled. | gauge | `cluster` | +| `windows_mscluster_cluster_database_read_write_mode` | Sets the database read and write mode. | gauge | `cluster` | +| `windows_mscluster_cluster_default_network_role` | Provides access to the cluster's DefaultNetworkRole property. | gauge | `cluster` | +| `windows_mscluster_cluster_detected_cloud_platform` | (DetectedCloudPlatform) | gauge | `cluster` | +| `windows_mscluster_cluster_detect_managed_events` | (DetectManagedEvents) | gauge | `cluster` | +| `windows_mscluster_cluster_detect_managed_events_threshold` | (DetectManagedEventsThreshold) | gauge | `cluster` | +| `windows_mscluster_cluster_disable_group_preferred_owner_randomization` | (DisableGroupPreferredOwnerRandomization) | gauge | `cluster` | +| `windows_mscluster_cluster_drain_on_shutdown` | Whether to drain the node when cluster service is being stopped. | gauge | `cluster` | +| `windows_mscluster_cluster_dynamic_quorum_enabled` | Allows cluster service to adjust node weights as needed to increase availability. | gauge | `cluster` | +| `windows_mscluster_cluster_enable_shared_volumes` | Enables or disables cluster shared volumes on this cluster. | gauge | `cluster` | +| `windows_mscluster_cluster_fix_quorum` | Provides access to the cluster's FixQuorum property, which specifies if the cluster is in a fix quorum state. | gauge | `cluster` | +| `windows_mscluster_cluster_grace_period_enabled` | Whether the node grace period feature of this cluster is enabled. | gauge | `cluster` | +| `windows_mscluster_cluster_grace_period_timeout_seconds` | The grace period timeout in seconds. | gauge | `cluster` | +| `windows_mscluster_cluster_group_dependency_timeout_seconds` | The timeout in seconds after which a group will be brought online despite unsatisfied dependencies | gauge | `cluster` | +| `windows_mscluster_cluster_hang_recovery_action` | Controls the action to take if the user-mode processes have stopped responding. | gauge | `cluster` | +| `windows_mscluster_cluster_ignore_persistent_state_on_startup` | Provides access to the cluster's IgnorePersistentStateOnStartup property, which specifies whether the cluster will bring online groups that were online when the cluster was shut down. | gauge | `cluster` | +| `windows_mscluster_cluster_log_resource_controls` | Controls the logging of resource controls. | gauge | `cluster` | +| `windows_mscluster_cluster_lower_quorum_priority_node_id` | Specifies the Node ID that has a lower priority when voting for quorum is performed. If the quorum vote is split 50/50%, the specified node's vote would be ignored to break the tie. If this is not set then the cluster will pick a node at random to break the tie. | gauge | `cluster` | +| `windows_mscluster_cluster_max_number_of_nodes` | Indicates the maximum number of nodes that may participate in the Cluster. | gauge | `cluster` | +| `windows_mscluster_cluster_message_buffer_length` | The maximum unacknowledged message count for GEM. | gauge | `cluster` | +| `windows_mscluster_cluster_minimum_never_preempt_priority` | Groups with this priority or higher cannot be preempted. | gauge | `cluster` | +| `windows_mscluster_cluster_minimum_preemptor_priority` | Minimum priority a cluster group must have to be able to preempt another group. | gauge | `cluster` | +| `windows_mscluster_cluster_netft_ip_sec_enabled` | Whether IPSec is enabled for cluster internal traffic. | gauge | `cluster` | +| `windows_mscluster_cluster_placement_options` | Various option flags to modify default placement behavior. | gauge | `cluster` | +| `windows_mscluster_cluster_plumb_all_cross_subnet_routes` | Plumbs all possible cross subnet routes to all nodes. | gauge | `cluster` | +| `windows_mscluster_cluster_prevent_quorum` | Whether the cluster will ignore group persistent state on startup. | gauge | `cluster` | +| `windows_mscluster_cluster_quarantine_duration_seconds` | The quarantine period timeout in seconds. | gauge | `cluster` | +| `windows_mscluster_cluster_quarantine_threshold` | Number of node failures before it will be quarantined. | gauge | `cluster` | +| `windows_mscluster_cluster_quorum_arbitration_time_max_seconds` | Controls the maximum time, in seconds, necessary to decide the Quorum owner node. | gauge | `cluster` | +| `windows_mscluster_cluster_quorum_arbitration_time_min_seconds` | Controls the minimum time, in seconds, necessary to decide the Quorum owner node. | gauge | `cluster` | +| `windows_mscluster_cluster_quorum_type_value` | Get the current quorum type value. -1: Unknown; 1: Node; 2: FileShareWitness; 3: Storage; 4: None | gauge | `cluster` | +| `windows_mscluster_cluster_request_reply_timeout_seconds` | Controls the request reply time-out period in seconds. | gauge | `cluster` | +| `windows_mscluster_cluster_resiliency_default_period_seconds` | The default resiliency period, in seconds, for the cluster. | gauge | `cluster` | +| `windows_mscluster_cluster_resiliency_level` | The resiliency level for the cluster. | gauge | `cluster` | +| `windows_mscluster_cluster_root_memory_reserved_bytes` | Controls the amount of memory, in bytes, reserved for the parent partition on all cluster nodes. | gauge | `cluster` | +| `windows_mscluster_cluster_route_history_length` | The history length for routes to help finding network issues. | gauge | `cluster` | +| `windows_mscluster_cluster_s2d_bus_types` | Bus types for storage spaces direct. | gauge | `cluster` | +| `windows_mscluster_cluster_s2d_cache_desired_state` | Desired state of the storage spaces direct cache. | gauge | `cluster` | +| `windows_mscluster_cluster_s2d_cache_flash_reserve_ratio` | Ratio (0-1) of allocated flash space to utilize when caching. | gauge | `cluster` | +| `windows_mscluster_cluster_s2d_cache_page_size_bytes` | Page size in bytes used by S2D cache. | gauge | `cluster` | +| `windows_mscluster_cluster_s2d_enabled` | Whether direct attached storage (DAS) is enabled. | gauge | `cluster` | +| `windows_mscluster_cluster_s2dio_latency_threshold_seconds` | The I/O latency threshold in seconds for storage spaces direct. | gauge | `cluster` | +| `windows_mscluster_cluster_s2d_optimizations` | Optimization flags for storage spaces direct. | gauge | `cluster` | +| `windows_mscluster_cluster_same_subnet_delay_seconds` | Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats on the same subnet. | gauge | `cluster` | +| `windows_mscluster_cluster_same_subnet_threshold` | Controls how many Cluster Service heartbeats can be missed on the same subnet before it determines that Cluster Service has stopped responding. | gauge | `cluster` | +| `windows_mscluster_cluster_security_level` | Controls the level of security that should apply to intracluster messages. 0: Clear Text; 1: Sign; 2: Encrypt | gauge | `cluster` | +| `windows_mscluster_cluster_security_level_for_storage` | (SecurityLevelForStorage) | gauge | `cluster` | +| `windows_mscluster_cluster_shared_volume_vss_writer_operation_timeout_seconds` | CSV VSS Writer operation timeout in seconds. | gauge | `cluster` | +| `windows_mscluster_cluster_shutdown_timeout_seconds` | The maximum time in seconds allowed for cluster resources to come offline during cluster service shutdown. | gauge | `cluster` | +| `windows_mscluster_cluster_use_client_access_networks_for_shared_volumes` | Whether the use of client access networks for cluster shared volumes feature of this cluster is enabled. 0: Disabled; 1: Enabled; 2: Auto | gauge | `cluster` | +| `windows_mscluster_cluster_witness_database_write_timeout_seconds` | Controls the maximum time in seconds that a cluster database write to a witness can take before the write is abandoned. | gauge | `cluster` | +| `windows_mscluster_cluster_witness_dynamic_weight` | The weight of the configured witness. | gauge | `cluster` | +| `windows_mscluster_cluster_witness_restart_interval_seconds` | Controls the witness restart interval in seconds. | gauge | `cluster` | ### Network | Name | Description | Type | Labels | |-------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|--------| -| `windows_mscluster_network_characteristics` | Provides the characteristics of the network. The cluster defines characteristics only for resources. For a description of these characteristics, see [CLUSCTL_RESOURCE_GET_CHARACTERISTICS](https://msdn.microsoft.com/library/aa367466). | gauge | `name` | -| `windows_mscluster_network_flags` | Provides access to the flags set for the network. The cluster defines flags only for resources. For a description of these flags, see [CLUSCTL_RESOURCE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-flags). | gauge | `name` | -| `windows_mscluster_network_metric` | The metric of a cluster network (networks with lower values are used first). If this value is set, then the AutoMetric property is set to false. | gauge | `name` | -| `windows_mscluster_network_role` | Provides access to the network's Role property. The Role property describes the role of the network in the cluster. 0: None; 1: Cluster; 2: Client; 3: Both | gauge | `name` | -| `windows_mscluster_network_state` | Provides the current state of the network. 1-1: Unknown; 0: Unavailable; 1: Down; 2: Partitioned; 3: Up | gauge | `name` | +| `windows_mscluster_network_characteristics` | Provides the characteristics of the network. The cluster defines characteristics only for resources. For a description of these characteristics, see [CLUSCTL_RESOURCE_GET_CHARACTERISTICS](https://msdn.microsoft.com/library/aa367466). | gauge | `network` | +| `windows_mscluster_network_flags` | Provides access to the flags set for the network. The cluster defines flags only for resources. For a description of these flags, see [CLUSCTL_RESOURCE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-flags). | gauge | `network` | +| `windows_mscluster_network_metric` | The metric of a cluster network (networks with lower values are used first). If this value is set, then the AutoMetric property is set to false. | gauge | `network` | +| `windows_mscluster_network_role` | Provides access to the network's Role property. The Role property describes the role of the network in the cluster. 0: None; 1: Cluster; 2: Client; 3: Both | gauge | `network` | +| `windows_mscluster_network_state` | Provides the current state of the network. 1-1: Unknown; 0: Unavailable; 1: Down; 2: Partitioned; 3: Up | gauge | `network` | ### Node | Name | Description | Type | Labels | |----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|--------| -| `windows_mscluster_node_build_number` | Provides access to the node's BuildNumber property. | gauge | `name` | -| `windows_mscluster_node_characteristics` | Provides access to the characteristics set for the node. For a list of possible characteristics, see [CLUSCTL_NODE_GET_CHARACTERISTICS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-node-get-characteristics). | gauge | `name` | -| `windows_mscluster_node_detected_cloud_platform` | (DetectedCloudPlatform) | gauge | `name` | -| `windows_mscluster_node_dynamic_weight` | The dynamic vote weight of the node adjusted by dynamic quorum feature. | gauge | `name` | -| `windows_mscluster_node_flags` | Provides access to the flags set for the node. For a list of possible characteristics, see [CLUSCTL_NODE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-node-get-flags). | gauge | `name` | -| `windows_mscluster_node_major_version` | Provides access to the node's MajorVersion property, which specifies the major portion of the Windows version installed. | gauge | `name` | -| `windows_mscluster_node_minor_version` | Provides access to the node's MinorVersion property, which specifies the minor portion of the Windows version installed. | gauge | `name` | -| `windows_mscluster_node_needs_prevent_quorum` | Whether the cluster service on that node should be started with prevent quorum flag. | gauge | `name` | -| `windows_mscluster_node_node_drain_status` | The current node drain status of a node. 0: Not Initiated; 1: In Progress; 2: Completed; 3: Failed | gauge | `name` | -| `windows_mscluster_node_node_highest_version` | Provides access to the node's NodeHighestVersion property, which specifies the highest possible version of the cluster service with which the node can join or communicate. | gauge | `name` | -| `windows_mscluster_node_node_lowest_version` | Provides access to the node's NodeLowestVersion property, which specifies the lowest possible version of the cluster service with which the node can join or communicate. | gauge | `name` | -| `windows_mscluster_node_node_weight` | The vote weight of the node. | gauge | `name` | -| `windows_mscluster_node_state` | Returns the current state of a node. -1: Unknown; 0: Up; 1: Down; 2: Paused; 3: Joining | gauge | `name` | -| `windows_mscluster_node_status_information` | The isolation or quarantine status of the node. | gauge | `name` | +| `windows_mscluster_node_build_number` | Provides access to the node's BuildNumber property. | gauge | `node` | +| `windows_mscluster_node_characteristics` | Provides access to the characteristics set for the node. For a list of possible characteristics, see [CLUSCTL_NODE_GET_CHARACTERISTICS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-node-get-characteristics). | gauge | `node` | +| `windows_mscluster_node_detected_cloud_platform` | (DetectedCloudPlatform) | gauge | `node` | +| `windows_mscluster_node_dynamic_weight` | The dynamic vote weight of the node adjusted by dynamic quorum feature. | gauge | `node` | +| `windows_mscluster_node_flags` | Provides access to the flags set for the node. For a list of possible characteristics, see [CLUSCTL_NODE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-node-get-flags). | gauge | `node` | +| `windows_mscluster_node_major_version` | Provides access to the node's MajorVersion property, which specifies the major portion of the Windows version installed. | gauge | `node` | +| `windows_mscluster_node_minor_version` | Provides access to the node's MinorVersion property, which specifies the minor portion of the Windows version installed. | gauge | `node` | +| `windows_mscluster_node_needs_prevent_quorum` | Whether the cluster service on that node should be started with prevent quorum flag. | gauge | `node` | +| `windows_mscluster_node_node_drain_status` | The current node drain status of a node. 0: Not Initiated; 1: In Progress; 2: Completed; 3: Failed | gauge | `node` | +| `windows_mscluster_node_node_highest_version` | Provides access to the node's NodeHighestVersion property, which specifies the highest possible version of the cluster service with which the node can join or communicate. | gauge | `node` | +| `windows_mscluster_node_node_lowest_version` | Provides access to the node's NodeLowestVersion property, which specifies the lowest possible version of the cluster service with which the node can join or communicate. | gauge | `node` | +| `windows_mscluster_node_node_weight` | The vote weight of the node. | gauge | `node` | +| `windows_mscluster_node_state` | Returns the current state of a node. -1: Unknown; 0: Up; 1: Down; 2: Paused; 3: Joining | gauge | `node` | +| `windows_mscluster_node_status_information` | The isolation or quarantine status of the node. | gauge | `node` | ### Resource | Name | Description | Type | Labels | |---------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|--------------------------------------------| -| `windows_mscluster_resource_characteristics` | Provides the characteristics of the object. The cluster defines characteristics only for resources. For a description of these characteristics, see [CLUSCTL_RESOURCE_GET_CHARACTERISTICS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-characteristics). | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_deadlock_timeout_seconds` | Indicates the length of time to wait, in seconds, before declaring a deadlock in any call into a resource. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_embedded_failure_action` | The time, in milliseconds, that a resource should remain in a failed state before the Cluster service attempts to restart it. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_flags` | Provides access to the flags set for the object. The cluster defines flags only for resources. For a description of these flags, see [CLUSCTL_RESOURCE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-flags). | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_is_alive_poll_interval_seconds` | Provides access to the resource's IsAlivePollInterval property, which is the recommended interval in seconds at which the Cluster Service should poll the resource to determine whether it is operational. The series is omitted while the resource uses the interval of its resource type (0xFFFFFFFF). | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_looks_alive_poll_interval_seconds` | Provides access to the resource's LooksAlivePollInterval property, which is the recommended interval in seconds at which the Cluster Service should poll the resource to determine whether it appears operational. The series is omitted while the resource uses the interval of its resource type (0xFFFFFFFF). | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_monitor_process_id` | Provides the process ID of the resource host service that is currently hosting the resource. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_owner_node` | The node hosting the resource. 0: Not hosted; 1: Hosted | gauge | `type`, `owner_group`, `node_name`, `name` | -| `windows_mscluster_resource_pending_timeout_seconds` | Provides access to the resource's PendingTimeout property. If a resource cannot be brought online or taken offline in the number of seconds specified by the PendingTimeout property, the resource is forcibly terminated. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_resource_class` | Gets or sets the resource class of a resource. 0: Unknown; 1: Storage; 2: Network; 32768: Unknown | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_restart_action` | Provides access to the resource's RestartAction property, which is the action to be taken by the Cluster Service if the resource fails. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_restart_delay_seconds` | Indicates the time delay in seconds before a failed resource is restarted. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_restart_period_seconds` | Provides access to the resource's RestartPeriod property, which is interval of time, in seconds, during which a specified number of restart attempts can be made on a nonresponsive resource. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_restart_threshold` | Provides access to the resource's RestartThreshold property which is the maximum number of restart attempts that can be made on a resource within an interval defined by the RestartPeriod property before the Cluster Service initiates the action specified by the RestartAction property. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_retry_period_on_failure_seconds` | Provides access to the resource's RetryPeriodOnFailure property, which is the interval of time (in seconds) that a resource should remain in a failed state before the Cluster service attempts to restart it. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_state` | The current state of the resource. -1: Unknown; 0: Inherited; 1: Initializing; 2: Online; 3: Offline; 4: Failed; 128: Pending; 129: Online Pending; 130: Offline Pending | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_subclass` | Provides the list of references to nodes that can be the owner of this resource. | gauge | `type`, `owner_group`, `name` | +| `windows_mscluster_resource_characteristics` | Provides the characteristics of the object. The cluster defines characteristics only for resources. For a description of these characteristics, see [CLUSCTL_RESOURCE_GET_CHARACTERISTICS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-characteristics). | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_deadlock_timeout_seconds` | Indicates the length of time to wait, in seconds, before declaring a deadlock in any call into a resource. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_embedded_failure_action` | The time, in milliseconds, that a resource should remain in a failed state before the Cluster service attempts to restart it. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_flags` | Provides access to the flags set for the object. The cluster defines flags only for resources. For a description of these flags, see [CLUSCTL_RESOURCE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-flags). | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_is_alive_poll_interval_seconds` | Provides access to the resource's IsAlivePollInterval property, which is the recommended interval in seconds at which the Cluster Service should poll the resource to determine whether it is operational. The series is omitted while the resource uses the interval of its resource type (0xFFFFFFFF). | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_looks_alive_poll_interval_seconds` | Provides access to the resource's LooksAlivePollInterval property, which is the recommended interval in seconds at which the Cluster Service should poll the resource to determine whether it appears operational. The series is omitted while the resource uses the interval of its resource type (0xFFFFFFFF). | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_monitor_process_id` | Provides the process ID of the resource host service that is currently hosting the resource. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_owner_node` | The node hosting the resource. 0: Not hosted; 1: Hosted | gauge | `type`, `resource_group`, `node`, `resource` | +| `windows_mscluster_resource_pending_timeout_seconds` | Provides access to the resource's PendingTimeout property. If a resource cannot be brought online or taken offline in the number of seconds specified by the PendingTimeout property, the resource is forcibly terminated. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_resource_class` | Gets or sets the resource class of a resource. 0: Unknown; 1: Storage; 2: Network; 32768: Unknown | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_restart_action` | Provides access to the resource's RestartAction property, which is the action to be taken by the Cluster Service if the resource fails. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_restart_delay_seconds` | Indicates the time delay in seconds before a failed resource is restarted. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_restart_period_seconds` | Provides access to the resource's RestartPeriod property, which is interval of time, in seconds, during which a specified number of restart attempts can be made on a nonresponsive resource. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_restart_threshold` | Provides access to the resource's RestartThreshold property which is the maximum number of restart attempts that can be made on a resource within an interval defined by the RestartPeriod property before the Cluster Service initiates the action specified by the RestartAction property. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_retry_period_on_failure_seconds` | Provides access to the resource's RetryPeriodOnFailure property, which is the interval of time (in seconds) that a resource should remain in a failed state before the Cluster service attempts to restart it. | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_state` | The current state of the resource. -1: Unknown; 0: Inherited; 1: Initializing; 2: Online; 3: Offline; 4: Failed; 128: Pending; 129: Online Pending; 130: Offline Pending | gauge | `type`, `resource_group`, `resource` | +| `windows_mscluster_resource_subclass` | Provides the list of references to nodes that can be the owner of this resource. | gauge | `type`, `resource_group`, `resource` | ## ResourceGroup | Name | Description | Type | Labels | |-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|---------------------| -| `windows_mscluster_resourcegroup_auto_failback_type` | Provides access to the group's AutoFailbackType property. | gauge | `name` | -| `windows_mscluster_resourcegroup_characteristics` | Provides the characteristics of the group. The cluster defines characteristics only for resources. For a description of these characteristics, see [CLUSCTL_RESOURCE_GET_CHARACTERISTICS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-characteristics). | gauge | `name` | -| `windows_mscluster_resourcegroup_cold_start_setting` | Indicates whether a group can start after a cluster cold start. | gauge | `name` | -| `windows_mscluster_resourcegroup_default_owner` | Number of the last node the resource group was activated on or explicitly moved to. | gauge | `name` | -| `windows_mscluster_resourcegroup_failback_window_end` | The FailbackWindowEnd property provides the latest time that the group can be moved back to the node identified as its preferred node. | gauge | `name` | -| `windows_mscluster_resourcegroup_failback_window_start` | The FailbackWindowStart property provides the earliest time (that is, local time as kept by the cluster) that the group can be moved back to the node identified as its preferred node. | gauge | `name` | -| `windows_mscluster_resourcegroup_failover_period_seconds` | The FailoverPeriod property specifies a number of seconds during which a maximum number of failover attempts, specified by the FailoverThreshold property, can occur. Windows stores it in hours. | gauge | `name` | -| `windows_mscluster_resourcegroup_failover_threshold` | The FailoverThreshold property specifies the maximum number of failover attempts. | gauge | `name` | -| `windows_mscluster_resourcegroup_flags` | Provides access to the flags set for the group. The cluster defines flags only for resources. For a description of these flags, see [CLUSCTL_RESOURCE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-flags). | gauge | `name` | -| `windows_mscluster_resourcegroup_group_type` | The Type of the resource group. | gauge | `name` | -| `windows_mscluster_resourcegroup_owner_node` | The node hosting the resource group. 0: Not hosted; 1: Hosted | gauge | `node_name`, `name` | -| `windows_mscluster_resourcegroup_priority` | Priority value of the resource group | gauge | `name` | -| `windows_mscluster_resourcegroup_resiliency_period_seconds` | The resiliency period for this group, in seconds. | gauge | `name` | -| `windows_mscluster_resourcegroup_state` | The current state of the resource group. -1: Unknown; 0: Online; 1: Offline; 2: Failed; 3: Partial Online; 4: Pending | gauge | `name` | +| `windows_mscluster_resourcegroup_auto_failback_type` | Provides access to the group's AutoFailbackType property. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_characteristics` | Provides the characteristics of the group. The cluster defines characteristics only for resources. For a description of these characteristics, see [CLUSCTL_RESOURCE_GET_CHARACTERISTICS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-characteristics). | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_cold_start_setting` | Indicates whether a group can start after a cluster cold start. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_default_owner` | Number of the last node the resource group was activated on or explicitly moved to. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_failback_window_end` | The FailbackWindowEnd property provides the latest time that the group can be moved back to the node identified as its preferred node. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_failback_window_start` | The FailbackWindowStart property provides the earliest time (that is, local time as kept by the cluster) that the group can be moved back to the node identified as its preferred node. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_failover_period_seconds` | The FailoverPeriod property specifies a number of seconds during which a maximum number of failover attempts, specified by the FailoverThreshold property, can occur. Windows stores it in hours. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_failover_threshold` | The FailoverThreshold property specifies the maximum number of failover attempts. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_flags` | Provides access to the flags set for the group. The cluster defines flags only for resources. For a description of these flags, see [CLUSCTL_RESOURCE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-flags). | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_group_type` | The Type of the resource group. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_owner_node` | The node hosting the resource group. 0: Not hosted; 1: Hosted | gauge | `node`, `resource_group` | +| `windows_mscluster_resourcegroup_priority` | Priority value of the resource group | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_resiliency_period_seconds` | The resiliency period for this group, in seconds. | gauge | `resource_group` | +| `windows_mscluster_resourcegroup_state` | The current state of the resource group. -1: Unknown; 0: Online; 1: Offline; 2: Failed; 3: Partial Online; 4: Pending | gauge | `resource_group` | ### Shared Volumes @@ -195,14 +195,14 @@ only exist for Storage Spaces Direct, are in the [`storage_spaces`](collector.st | Name | Description | Type | Labels | |------------------------------------------|----------------------------------------------------------------|-------|-----------------------------| -| `windows_mscluster_shared_volumes_info` | Cluster Shared Volumes information (value is always 1) | gauge | `name`,`path`,`volume_guid` | -| `windows_mscluster_shared_volumes_total_bytes`| Total size of the Cluster Shared Volume in bytes | gauge | `name`,`volume_guid` | -| `windows_mscluster_shared_volumes_free_bytes`| Free space on the Cluster Shared Volume in bytes | gauge | `name`,`volume_guid` | +| `windows_mscluster_shared_volumes_info` | Cluster Shared Volumes information (value is always 1) | gauge | `shared_volume`,`path`,`volume_guid` | +| `windows_mscluster_shared_volumes_total_bytes`| Total size of the Cluster Shared Volume in bytes | gauge | `shared_volume`,`volume_guid` | +| `windows_mscluster_shared_volumes_free_bytes`| Free space on the Cluster Shared Volume in bytes | gauge | `shared_volume`,`volume_guid` | ### Example metric Query the state of all cluster resource owned by node1 ``` -windows_mscluster_resource_owner_node{node_name="node1"} +windows_mscluster_resource_owner_node{node="node1"} ``` ## Useful queries @@ -219,15 +219,15 @@ count(windows_mscluster_resource_state{type="Network Name"}) - alert: LowCSVFreeSpace expr: | ( - max by (name, cluster) (windows_mscluster_shared_volumes_free_bytes{name!="ClusterPerformanceHistory"}) + max by (shared_volume, cluster) (windows_mscluster_shared_volumes_free_bytes{shared_volume!="ClusterPerformanceHistory"}) / - max by (name, cluster) (windows_mscluster_shared_volumes_total_bytes{name!="ClusterPerformanceHistory"}) + max by (shared_volume, cluster) (windows_mscluster_shared_volumes_total_bytes{shared_volume!="ClusterPerformanceHistory"}) ) * 100 < 20 for: 10m labels: severity: warning annotations: - summary: "Low CSV free space on {{ $labels.name }}" + summary: "Low CSV free space on {{ $labels.shared_volume }}" description: | - Cluster Shared Volume {{ $labels.name }} on cluster {{ $labels.cluster }} has less than 20% free space (current: {{ printf "%.2f" $value }}%) + Cluster Shared Volume {{ $labels.shared_volume }} on cluster {{ $labels.cluster }} has less than 20% free space (current: {{ printf "%.2f" $value }}%) ``` diff --git a/docs/collector.msmq.md b/docs/collector.msmq.md index 75c84a7d..0b5259ce 100644 --- a/docs/collector.msmq.md +++ b/docs/collector.msmq.md @@ -14,10 +14,10 @@ The msmq collector exposes metrics about the queues on a MSMQ server | Name | Description | Type | Labels | |------------------------------------------|---------------------------------|-------|--------| -| `windows_msmq_journal_queue_bytes` | Size of queue journal in bytes | gauge | `name` | -| `windows_msmq_queue_bytes` | Size of queue in bytes | gauge | `name` | -| `windows_msmq_messages_in_journal_queue` | Count messages in queue journal | gauge | `name` | -| `windows_msmq_messages_in_queue` | Count messages in queue | gauge | `name` | +| `windows_msmq_journal_queue_bytes` | Size of queue journal in bytes | gauge | `queue` | +| `windows_msmq_queue_bytes` | Size of queue in bytes | gauge | `queue` | +| `windows_msmq_messages_in_journal_queue` | Count messages in queue journal | gauge | `queue` | +| `windows_msmq_messages_in_queue` | Count messages in queue | gauge | `queue` | ### Example metric _This collector does not yet have explained examples, we would appreciate your help adding them!_ diff --git a/docs/collector.performancecounter.md b/docs/collector.performancecounter.md index 740fd918..c2ff3fb2 100644 --- a/docs/collector.performancecounter.md +++ b/docs/collector.performancecounter.md @@ -164,7 +164,7 @@ Some Objects like `Memory` do not have instances to select from at all. In this #### instance_label -The name of the label that holds the instance name. Optional and defaults to `instance`. +The name of the label that holds the instance name. Optional and defaults to `object_instance`. Do not use `instance`: it collides with the target label that Prometheus adds. The label is only added if `instances` is set. diff --git a/docs/collector.registry.md b/docs/collector.registry.md index c01e9d56..4bae6e29 100644 --- a/docs/collector.registry.md +++ b/docs/collector.registry.md @@ -93,7 +93,7 @@ JSON: #### name -Required, unique ID for the key group. It is used as the `name` label on +Required, unique ID for the key group. It is used as the `key` label on `windows_registry_key_success`, to identify the key in logs, and to seed auto-generated metric names (see [Metric naming](#metric-naming)). Each key must have a distinct `name`; duplicates are rejected at build time. @@ -173,13 +173,13 @@ according to the configuration, plus a per-key success metric. | Name | Description | Type | Labels | | --- | --- | --- | --- | | *user defined* | Numeric value of a configured REG_DWORD or REG_QWORD value | gauge / counter | *user defined* | -| `windows_registry_key_success` | Whether the key could be opened and all of its configured values read (0, 1) | gauge | `name` | +| `windows_registry_key_success` | Whether the key could be opened and all of its configured values read (0, 1) | gauge | `key` | A `windows_registry_key_success` value of `0` means the key could not be opened *or* at least one configured value was missing or not a `REG_DWORD`/`REG_QWORD`; values that did read successfully are still exported. -The `name` label on `windows_registry_key_success` is the configured key +The `key` label on `windows_registry_key_success` is the configured key [`name`](#name), used verbatim. Because each key must have a unique `name`, the success metric can never emit duplicate series. @@ -244,8 +244,8 @@ windows_registry_windows_major_version{product="windows"} 10 windows_registry_memory_management_clearpagefileatshutdown 0 # HELP windows_registry_key_success Whether the registry key could be read successfully. # TYPE windows_registry_key_success gauge -windows_registry_key_success{name="windows_nt"} 1 -windows_registry_key_success{name="memory_management"} 1 +windows_registry_key_success{key="windows_nt"} 1 +windows_registry_key_success{key="memory_management"} 1 ``` ### Notes @@ -275,5 +275,5 @@ windows_registry_memory_management_clearpagefileatshutdown != 0 severity: warning annotations: summary: "Registry key could not be read (instance {{ $labels.instance }})" - description: "The registry key {{ $labels.name }} could not be read for 15 minutes." + description: "The registry key {{ $labels.key }} could not be read for 15 minutes." ``` diff --git a/docs/collector.service.md b/docs/collector.service.md index 56604744..f5db020a 100644 --- a/docs/collector.service.md +++ b/docs/collector.service.md @@ -42,10 +42,10 @@ on every scrape. | Name | Description | Type | Labels | |------------------------------|-----------------------------------------------------------------------------------------------|-------|---------------------------------------| -| `windows_service_info` | Contains service information run as user in labels, constant 1 | gauge | name, display_name, run_as, path_name | -| `windows_service_start_mode` | The start mode of the service, 1 if the current start mode, 0 otherwise | gauge | name, start_mode | -| `windows_service_state` | The state of the service, 1 if the current state, 0 otherwise | gauge | name, state | -| `windows_service_process` | Process of started service. The value is the creation time of the process as a Unix timestamp | gauge | name, process_id | +| `windows_service_info` | Contains service information run as user in labels, constant 1 | gauge | service, display_name, run_as, path_name | +| `windows_service_start_mode` | The start mode of the service, 1 if the current start mode, 0 otherwise | gauge | service, start_mode | +| `windows_service_state` | The state of the service, 1 if the current state, 0 otherwise | gauge | service, state | +| `windows_service_process` | Process of started service. The value is the creation time of the process as a Unix timestamp | gauge | service, process_id | ### States @@ -78,46 +78,46 @@ Account name under which a service runs. Depending on the service type, the acco ``` # HELP windows_service_info A metric with a constant '1' value labeled with service information # TYPE windows_service_info gauge -windows_service_info{display_name="Declared Configuration(DC) service",name="dcsvc",path_name="C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p",run_as="LocalSystem"} 1 -windows_service_info{display_name="Designs",name="Themes",path_name="C:\\WINDOWS\\System32\\svchost.exe -k netsvcs -p",run_as="LocalSystem"} 1 +windows_service_info{display_name="Declared Configuration(DC) service",service="dcsvc",path_name="C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p",run_as="LocalSystem"} 1 +windows_service_info{display_name="Designs",service="Themes",path_name="C:\\WINDOWS\\System32\\svchost.exe -k netsvcs -p",run_as="LocalSystem"} 1 # HELP windows_service_process Process of started service. The value is the creation time of the process as a unix timestamp. # TYPE windows_service_process gauge -windows_service_process{name="Themes",process_id="2856"} 1.7244891e+09 +windows_service_process{service="Themes",process_id="2856"} 1.7244891e+09 # HELP windows_service_start_mode The start mode of the service (StartMode) # TYPE windows_service_start_mode gauge -windows_service_start_mode{name="Themes",start_mode="auto"} 1 -windows_service_start_mode{name="Themes",start_mode="boot"} 0 -windows_service_start_mode{name="Themes",start_mode="disabled"} 0 -windows_service_start_mode{name="Themes",start_mode="manual"} 0 -windows_service_start_mode{name="Themes",start_mode="system"} 0 -windows_service_start_mode{name="dcsvc",start_mode="auto"} 0 -windows_service_start_mode{name="dcsvc",start_mode="boot"} 0 -windows_service_start_mode{name="dcsvc",start_mode="disabled"} 0 -windows_service_start_mode{name="dcsvc",start_mode="manual"} 1 -windows_service_start_mode{name="dcsvc",start_mode="system"} 0 +windows_service_start_mode{service="Themes",start_mode="auto"} 1 +windows_service_start_mode{service="Themes",start_mode="boot"} 0 +windows_service_start_mode{service="Themes",start_mode="disabled"} 0 +windows_service_start_mode{service="Themes",start_mode="manual"} 0 +windows_service_start_mode{service="Themes",start_mode="system"} 0 +windows_service_start_mode{service="dcsvc",start_mode="auto"} 0 +windows_service_start_mode{service="dcsvc",start_mode="boot"} 0 +windows_service_start_mode{service="dcsvc",start_mode="disabled"} 0 +windows_service_start_mode{service="dcsvc",start_mode="manual"} 1 +windows_service_start_mode{service="dcsvc",start_mode="system"} 0 # HELP windows_service_state The state of the service (State) # TYPE windows_service_state gauge -windows_service_state{name="Themes",state="continue pending"} 0 -windows_service_state{name="Themes",state="pause pending"} 0 -windows_service_state{name="Themes",state="paused"} 0 -windows_service_state{name="Themes",state="running"} 1 -windows_service_state{name="Themes",state="start pending"} 0 -windows_service_state{name="Themes",state="stop pending"} 0 -windows_service_state{name="Themes",state="stopped"} 0 -windows_service_state{name="dcsvc",state="continue pending"} 0 -windows_service_state{name="dcsvc",state="pause pending"} 0 -windows_service_state{name="dcsvc",state="paused"} 0 -windows_service_state{name="dcsvc",state="running"} 0 -windows_service_state{name="dcsvc",state="start pending"} 0 -windows_service_state{name="dcsvc",state="stop pending"} 0 -windows_service_state{name="dcsvc",state="stopped"} 1 +windows_service_state{service="Themes",state="continue pending"} 0 +windows_service_state{service="Themes",state="pause pending"} 0 +windows_service_state{service="Themes",state="paused"} 0 +windows_service_state{service="Themes",state="running"} 1 +windows_service_state{service="Themes",state="start pending"} 0 +windows_service_state{service="Themes",state="stop pending"} 0 +windows_service_state{service="Themes",state="stopped"} 0 +windows_service_state{service="dcsvc",state="continue pending"} 0 +windows_service_state{service="dcsvc",state="pause pending"} 0 +windows_service_state{service="dcsvc",state="paused"} 0 +windows_service_state{service="dcsvc",state="running"} 0 +windows_service_state{service="dcsvc",state="start pending"} 0 +windows_service_state{service="dcsvc",state="stop pending"} 0 +windows_service_state{service="dcsvc",state="stopped"} 1 ``` ## Useful queries Counts the number of Microsoft SQL Server/Agent Processes ``` -count(windows_service_state{name=~"(sqlserveragent|mssqlserver)",state="running"}) +count(windows_service_state{service=~"(sqlserveragent|mssqlserver)",state="running"}) ``` ## Alerting examples @@ -129,22 +129,22 @@ groups: # Sends an alert when the 'sqlserveragent' service is not in the running state for 3 minutes. - alert: SQL Server Agent DOWN - expr: windows_service_state{instance="SQL",name="sqlserveragent",state="running"} == 0 + expr: windows_service_state{instance="SQL",service="sqlserveragent",state="running"} == 0 for: 3m labels: severity: high annotations: - summary: "Service {{ $labels.name }} down" - description: "Service {{ $labels.name }} on instance {{ $labels.instance }} has been down for more than 3 minutes." + summary: "Service {{ $labels.service }} down" + description: "Service {{ $labels.service }} on instance {{ $labels.instance }} has been down for more than 3 minutes." # Sends an alert when the 'mssqlserver' service is not in the running state for 3 minutes. - alert: SQL Server DOWN - expr: windows_service_state{instance="SQL",name="mssqlserver",state="running"} == 0 + expr: windows_service_state{instance="SQL",service="mssqlserver",state="running"} == 0 for: 3m labels: severity: high annotations: - summary: "Service {{ $labels.name }} down" - description: "Service {{ $labels.name }} on instance {{ $labels.instance }} has been down for more than 3 minutes." + summary: "Service {{ $labels.service }} down" + description: "Service {{ $labels.service }} on instance {{ $labels.instance }} has been down for more than 3 minutes." ``` In this example, `instance` is the target label of the host. So each alert will be processed per host, which is then used in the alert description. diff --git a/docs/collector.storage_spaces.md b/docs/collector.storage_spaces.md index f31a4e9e..486ddb90 100644 --- a/docs/collector.storage_spaces.md +++ b/docs/collector.storage_spaces.md @@ -29,12 +29,12 @@ Matching is case-sensitive. | Name | Description | Type | Labels | |------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|-------|-----------------------------------| -| `windows_storage_spaces_pool_info` | Storage pool information (value is always 1). `primordial` is `true` for the built-in primordial pool | gauge | `name`, `unique_id`, `primordial` | -| `windows_storage_spaces_pool_health_status` | Health status of the storage pool. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown | gauge | `name`, `unique_id` | -| `windows_storage_spaces_pool_size_bytes` | Total size of the storage pool in bytes | gauge | `name`, `unique_id` | -| `windows_storage_spaces_pool_allocated_size_bytes` | Allocated size of the storage pool in bytes | gauge | `name`, `unique_id` | -| `windows_storage_spaces_pool_operational_status` | Operational status codes reported for the storage pool (one series per status value) | gauge | `name`, `unique_id`, `status` | -| `windows_storage_spaces_pool_thin_provisioning_alert_thresholds` | Thin provisioning alert thresholds configured for the storage pool, in percent (one series per configured threshold) | gauge | `name`, `unique_id`, `threshold` | +| `windows_storage_spaces_pool_info` | Storage pool information (value is always 1). `primordial` is `true` for the built-in primordial pool | gauge | `pool`, `unique_id`, `primordial` | +| `windows_storage_spaces_pool_health_status` | Health status of the storage pool. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown | gauge | `pool`, `unique_id` | +| `windows_storage_spaces_pool_size_bytes` | Total size of the storage pool in bytes | gauge | `pool`, `unique_id` | +| `windows_storage_spaces_pool_allocated_size_bytes` | Allocated size of the storage pool in bytes | gauge | `pool`, `unique_id` | +| `windows_storage_spaces_pool_operational_status` | Operational status codes reported for the storage pool (one series per status value) | gauge | `pool`, `unique_id`, `status` | +| `windows_storage_spaces_pool_thin_provisioning_alert_thresholds` | Thin provisioning alert thresholds configured for the storage pool, in percent (one series per configured threshold) | gauge | `pool`, `unique_id`, `threshold` | Windows always reports a built-in pool named `Primordial` next to the concrete pools. It groups every local physical disk that can be pooled but is not yet part of a concrete pool, so its size is the sum of those disks and not usable pool capacity. @@ -45,18 +45,18 @@ Join on `unique_id` to restrict other pool metrics to concrete pools, as shown i | Name | Description | Type | Labels | |------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|-------|---------------------| -| `windows_storage_spaces_virtual_disk_info` | Virtual disk information (value is always 1) | gauge | `name`, `unique_id` | -| `windows_storage_spaces_virtual_disk_health_status` | Health status of the virtual disk. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown | gauge | `name`, `unique_id` | -| `windows_storage_spaces_virtual_disk_size_bytes` | Total size of the virtual disk in bytes | gauge | `name`, `unique_id` | -| `windows_storage_spaces_virtual_disk_allocated_size_bytes` | Allocated size of the virtual disk in bytes (capacity actually provisioned, excludes thin-provisioned unused capacity) | gauge | `name`, `unique_id` | -| `windows_storage_spaces_virtual_disk_footprint_on_pool_bytes` | Physical storage consumed by the virtual disk on the storage pool in bytes | gauge | `name`, `unique_id` | -| `windows_storage_spaces_virtual_disk_storage_efficiency_ratio` | Storage efficiency ratio (AllocatedSize / FootprintOnPool), omitted while FootprintOnPool is 0 | gauge | `name`, `unique_id` | +| `windows_storage_spaces_virtual_disk_info` | Virtual disk information (value is always 1) | gauge | `virtual_disk`, `unique_id` | +| `windows_storage_spaces_virtual_disk_health_status` | Health status of the virtual disk. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown | gauge | `virtual_disk`, `unique_id` | +| `windows_storage_spaces_virtual_disk_size_bytes` | Total size of the virtual disk in bytes | gauge | `virtual_disk`, `unique_id` | +| `windows_storage_spaces_virtual_disk_allocated_size_bytes` | Allocated size of the virtual disk in bytes (capacity actually provisioned, excludes thin-provisioned unused capacity) | gauge | `virtual_disk`, `unique_id` | +| `windows_storage_spaces_virtual_disk_footprint_on_pool_bytes` | Physical storage consumed by the virtual disk on the storage pool in bytes | gauge | `virtual_disk`, `unique_id` | +| `windows_storage_spaces_virtual_disk_storage_efficiency_ratio` | Storage efficiency ratio (AllocatedSize / FootprintOnPool), omitted while FootprintOnPool is 0 | gauge | `virtual_disk`, `unique_id` | ### Example metric ``` -windows_storage_spaces_pool_info{name="Pool01",primordial="false",unique_id="{8f2c...}"} 1 -windows_storage_spaces_pool_size_bytes{name="Pool01",unique_id="{8f2c...}"} 1.0995116277760e+12 +windows_storage_spaces_pool_info{pool="Pool01",primordial="false",unique_id="{8f2c...}"} 1 +windows_storage_spaces_pool_size_bytes{pool="Pool01",unique_id="{8f2c...}"} 1.0995116277760e+12 ``` ## Useful queries @@ -95,6 +95,6 @@ sum(windows_storage_spaces_virtual_disk_size_bytes) / sum(windows_storage_spaces labels: severity: warning annotations: - summary: "Storage pool {{ $labels.name }} is not healthy" - description: "Storage pool {{ $labels.name }} on {{ $labels.instance }} reports health status {{ $value }}." + summary: "Storage pool {{ $labels.pool }} is not healthy" + description: "Storage pool {{ $labels.pool }} on {{ $labels.instance }} reports health status {{ $value }}." ``` diff --git a/docs/collector.wmi.md b/docs/collector.wmi.md index 5df23bdb..9a5e65f6 100644 --- a/docs/collector.wmi.md +++ b/docs/collector.wmi.md @@ -116,7 +116,7 @@ SELECT , FROM [WHERE ] #### name -Required, unique ID for the query. It is used as the `name` label on +Required, unique ID for the query. It is used as the `query` label on `windows_wmi_query_success` and `windows_wmi_query_duration_seconds`, to identify the query in logs, and to seed auto-generated metric names (see [Metric naming](#metric-naming)). Duplicates are rejected at build time, and so @@ -235,8 +235,8 @@ duration metric per query. | Name | Description | Type | Labels | | --- | --- | --- | --- | | *user defined* | Numeric value of a configured WMI property | gauge / counter | *label properties*, *user defined* | -| `windows_wmi_query_success` | Whether the query ran and all of its configured properties could be read (0, 1) | gauge | `name` | -| `windows_wmi_query_duration_seconds` | Duration of the query | gauge | `name` | +| `windows_wmi_query_success` | Whether the query ran and all of its configured properties could be read (0, 1) | gauge | `query` | +| `windows_wmi_query_duration_seconds` | Duration of the query | gauge | `query` | A `windows_wmi_query_success` value of `0` means one of: @@ -310,12 +310,12 @@ windows_wmi_os_last_boot_timestamp_seconds 1.791272732355078e+09 windows_wmi_os_numberofprocesses 478 # HELP windows_wmi_query_duration_seconds Duration of the WMI query. # TYPE windows_wmi_query_duration_seconds gauge -windows_wmi_query_duration_seconds{name="logical_disk"} 0.0375302 -windows_wmi_query_duration_seconds{name="os"} 0.1690887 +windows_wmi_query_duration_seconds{query="logical_disk"} 0.0375302 +windows_wmi_query_duration_seconds{query="os"} 0.1690887 # HELP windows_wmi_query_success Whether the WMI query and all of its configured properties could be read successfully. # TYPE windows_wmi_query_success gauge -windows_wmi_query_success{name="logical_disk"} 1 -windows_wmi_query_success{name="os"} 1 +windows_wmi_query_success{query="logical_disk"} 1 +windows_wmi_query_success{query="os"} 1 ``` ### Notes @@ -349,5 +349,5 @@ windows_wmi_logical_disk_free_bytes / windows_wmi_logical_disk_size_bytes severity: warning annotations: summary: "WMI query failed (instance {{ $labels.instance }})" - description: "The WMI query {{ $labels.name }} failed for 15 minutes." + description: "The WMI query {{ $labels.query }} failed for 15 minutes." ``` diff --git a/docs/example-0.32-compatibility-rules-new-to-old.yml b/docs/example-0.32-compatibility-rules-new-to-old.yml new file mode 100644 index 00000000..87729458 --- /dev/null +++ b/docs/example-0.32-compatibility-rules-new-to-old.yml @@ -0,0 +1,780 @@ +# Recording rules that publish the metrics of windows_exporter 0.32 under +# their 0.31 names, units and instance labels, for dashboards and alerts that +# have not been migrated yet. Load them into Prometheus next to the scrape of +# the new exporter and remove them once the queries use the new names. +# +# Generated from UPGRADE.md by internal/metriccontract; do not edit. +# +# Not covered: +# - Metrics that only renamed their instance label, e.g. windows_service_*. +# Recording them under the same name would duplicate every series. +# - Metrics whose 0.31 value can't be computed from 0.32, e.g. removed +# metrics, split metrics and ratios that 0.31 computed wrongly. +# - Series that 0.32 leaves out, e.g. mscluster settings that are zero. +groups: + - name: windows_exporter-0.32-ad + rules: + - record: windows_ad_atq_average_request_latency + expr: windows_ad_atq_average_request_latency_seconds * 1000 + - record: windows_ad_sam_group_evaluation_latency + expr: windows_ad_sam_group_evaluation_latency_seconds * 1000 + - record: windows_ad_security_descriptor_propagation_events_total + expr: windows_ad_security_descriptor_propagation_suboperations_total + - record: windows_ad_security_descriptor_propagation_items_queued_total + expr: windows_ad_security_descriptor_propagation_items_queued + - record: windows_ad_replication_highest_usn + expr: windows_ad_replication_highest_usn_total + - name: windows_exporter-0.32-container + rules: + - record: windows_container_count + expr: windows_containers + - record: windows_container_cpu_usage_seconds_kernelmode + expr: windows_container_cpu_usage_kernelmode_seconds_total + - record: windows_container_cpu_usage_seconds_usermode + expr: windows_container_cpu_usage_usermode_seconds_total + - name: windows_exporter-0.32-cpu + rules: + - record: windows_cpu_core_frequency_mhz + expr: windows_cpu_core_frequency_hertz / 1e6 + - record: windows_cpu_time_total + expr: windows_cpu_time_seconds_total + - name: windows_exporter-0.32-cpu_info + rules: + - record: windows_cpu_info_l2_cache_size + expr: windows_cpu_info_l2_cache_size_bytes / 1024 + - record: windows_cpu_info_l3_cache_size + expr: windows_cpu_info_l3_cache_size_bytes / 1024 + - name: windows_exporter-0.32-dfsr + rules: + - record: windows_dfsr_connection_bandwidth_savings_using_dfs_replication_bytes_total + expr: max without (connection) (label_replace(windows_dfsr_connection_bandwidth_savings_using_dfs_replication_ratio * 100, "name", "$1", "connection", "(.+)")) + - record: windows_dfsr_folder_bandwidth_savings_using_dfs_replication_bytes_total + expr: max without (folder) (label_replace(windows_dfsr_folder_bandwidth_savings_using_dfs_replication_ratio * 100, "name", "$1", "folder", "(.+)")) + - record: windows_dfsr_volume_usn_journal_unread_percentage + expr: max without (volume) (label_replace(windows_dfsr_volume_usn_journal_unread_ratio * 100, "name", "$1", "volume", "(.+)")) + - name: windows_exporter-0.32-diskdrive + rules: + - record: windows_diskdrive_size + expr: max without (device_id) (label_replace(windows_diskdrive_size_bytes, "name", "$1", "device_id", "(.+)")) + - name: windows_exporter-0.32-dns + rules: + - record: windows_dns_dynamic_updates_queued + expr: windows_dns_dynamic_updates_queued_total + - name: windows_exporter-0.32-exchange + rules: + - record: windows_exchange_http_proxy_avg_auth_latency + expr: max without (protocol) (label_replace(windows_exchange_http_proxy_avg_auth_latency_seconds * 1000, "name", "$1", "protocol", "(.+)")) + - record: windows_exchange_http_proxy_mailbox_proxy_failure_rate + expr: max without (protocol) (label_replace(windows_exchange_http_proxy_mailbox_proxy_failure_ratio * 100, "name", "$1", "protocol", "(.+)")) + - record: windows_exchange_ldap_long_running_ops_per_sec + expr: max without (process) (label_replace(windows_exchange_ldap_long_running_operations_per_second * 3600, "name", "$1", "process", "(.+)")) + - record: windows_exchange_availability_service_requests_per_sec + expr: windows_exchange_availability_service_requests_total + - record: windows_exchange_http_proxy_avg_cas_processing_latency_sec + expr: max without (protocol) (label_replace(windows_exchange_http_proxy_avg_cas_processing_latency_seconds, "name", "$1", "protocol", "(.+)")) + - record: windows_exchange_http_proxy_mailbox_server_locator_avg_latency_sec + expr: max without (protocol) (label_replace(windows_exchange_http_proxy_mailbox_server_locator_avg_latency_seconds, "name", "$1", "protocol", "(.+)")) + - record: windows_exchange_ldap_read_time_sec + expr: max without (process) (label_replace(windows_exchange_ldap_read_time_seconds_total, "name", "$1", "process", "(.+)")) + - record: windows_exchange_ldap_search_time_sec + expr: max without (process) (label_replace(windows_exchange_ldap_search_time_seconds_total, "name", "$1", "process", "(.+)")) + - record: windows_exchange_ldap_write_time_sec + expr: max without (process) (label_replace(windows_exchange_ldap_write_time_seconds_total, "name", "$1", "process", "(.+)")) + - record: windows_exchange_mapihttp_emsmdb_active_user_count + expr: windows_exchange_mapihttp_emsmdb_active_users + - record: windows_exchange_rpc_active_user_count + expr: windows_exchange_rpc_active_users + - record: windows_exchange_rpc_avg_latency_sec + expr: windows_exchange_rpc_avg_latency_seconds + - record: windows_exchange_rpc_connection_count + expr: windows_exchange_rpc_connections + - record: windows_exchange_rpc_user_count + expr: windows_exchange_rpc_users + - record: windows_exchange_workload_completed_tasks + expr: max without (workload) (label_replace(windows_exchange_workload_completed_tasks_total, "name", "$1", "workload", "(.+)")) + - record: windows_exchange_workload_yielded_tasks + expr: max without (workload) (label_replace(windows_exchange_workload_yielded_tasks_total, "name", "$1", "workload", "(.+)")) + - name: windows_exporter-0.32-fsrmquota + rules: + - record: windows_fsrmquota_count + expr: windows_fsrmquota_quotas + - name: windows_exporter-0.32-gpu + rules: + - record: windows_gpu_engine_time_seconds + expr: windows_gpu_engine_time_seconds_total + - name: windows_exporter-0.32-hyperv + rules: + - record: windows_hyperv_virtual_storage_device_throughput + expr: windows_hyperv_virtual_storage_device_throughput_total + - record: windows_hyperv_virtual_storage_device_normalized_throughput + expr: windows_hyperv_virtual_storage_device_normalized_throughput_total + - record: windows_hyperv_io_quota_replenishment_rate + expr: windows_hyperv_virtual_storage_device_io_quota_replenishment_total + - record: windows_hyperv_root_partition_preferred_numa_node_index + expr: windows_hyperv_root_partition_gpa_pages + - record: windows_hyperv_root_partition_physical_pages_allocated + expr: windows_hyperv_root_partition_skipped_timer_ticks_total + - record: windows_hyperv_root_partition_device_interrupt_throttle_events + expr: windows_hyperv_root_partition_device_interrupt_throttle_events_total + - record: windows_hyperv_root_partition_io_tlb_flush_cost + expr: windows_hyperv_root_partition_io_tlb_flush_seconds_total + - record: windows_hyperv_root_partition_io_tlb_flush + expr: windows_hyperv_root_partition_io_tlb_flushes_total + - record: windows_hyperv_root_partition_gpa_space_modifications + expr: windows_hyperv_root_partition_gpa_space_modifications_total + - record: windows_hyperv_root_partition_virtual_tlb_flush_entries + expr: windows_hyperv_root_partition_virtual_tlb_flush_entries_total + - record: windows_hyperv_hypervisor_virtual_processor_cpu_wait_time_per_dispatch_total + expr: windows_hyperv_hypervisor_virtual_processor_cpu_wait_seconds_total + - record: windows_hyperv_hypervisor_root_virtual_cpu_wait_time_per_dispatch_total + expr: windows_hyperv_hypervisor_root_virtual_processor_cpu_wait_seconds_total + - record: windows_hyperv_datastore_cache_update_operation_latency_microseconds + expr: windows_hyperv_datastore_cache_update_operation_latency_seconds * 1e6 + - record: windows_hyperv_datastore_commit_byte_latency_microseconds + expr: windows_hyperv_datastore_commit_byte_latency_seconds * 1e6 + - record: windows_hyperv_datastore_commit_operation_latency_microseconds + expr: windows_hyperv_datastore_commit_operation_latency_seconds * 1e6 + - record: windows_hyperv_datastore_compact_operation_latency_microseconds + expr: windows_hyperv_datastore_compact_operation_latency_seconds * 1e6 + - record: windows_hyperv_datastore_load_file_operation_latency_microseconds + expr: windows_hyperv_datastore_load_file_operation_latency_seconds * 1e6 + - record: windows_hyperv_datastore_query_size_operation_latency_microseconds + expr: windows_hyperv_datastore_query_size_operation_latency_seconds * 1e6 + - record: windows_hyperv_datastore_read_from_file_byte_latency_microseconds + expr: windows_hyperv_datastore_read_from_file_byte_latency_seconds * 1e6 + - record: windows_hyperv_datastore_read_from_storage_byte_latency_microseconds + expr: windows_hyperv_datastore_read_from_storage_byte_latency_seconds * 1e6 + - record: windows_hyperv_datastore_reconnect_latency_microseconds + expr: windows_hyperv_datastore_reconnect_latency_seconds * 1e6 + - record: windows_hyperv_datastore_remove_operation_latency_microseconds + expr: windows_hyperv_datastore_remove_operation_latency_seconds * 1e6 + - record: windows_hyperv_datastore_set_operation_latency_microseconds + expr: windows_hyperv_datastore_set_operation_latency_seconds * 1e6 + - record: windows_hyperv_datastore_write_to_file_byte_latency_microseconds + expr: windows_hyperv_datastore_write_to_file_byte_latency_seconds * 1e6 + - record: windows_hyperv_datastore_write_to_storage_byte_latency_microseconds + expr: windows_hyperv_datastore_write_to_storage_byte_latency_seconds * 1e6 + - record: windows_hyperv_datastore_cache_update_operation_count + expr: windows_hyperv_datastore_cache_update_operations_total + - record: windows_hyperv_datastore_commit_byte_count + expr: windows_hyperv_datastore_commit_bytes_total + - record: windows_hyperv_datastore_commit_count + expr: windows_hyperv_datastore_commits_total + - record: windows_hyperv_datastore_commit_operation_count + expr: windows_hyperv_datastore_commit_operations_total + - record: windows_hyperv_datastore_compact_operation_count + expr: windows_hyperv_datastore_compact_operations_total + - record: windows_hyperv_datastore_disconnect_count + expr: windows_hyperv_datastore_disconnects_total + - record: windows_hyperv_datastore_load_file_operation_count + expr: windows_hyperv_datastore_load_file_operations_total + - record: windows_hyperv_datastore_query_size_operation_count + expr: windows_hyperv_datastore_query_size_operations_total + - record: windows_hyperv_datastore_read_from_file_byte_count + expr: windows_hyperv_datastore_read_from_file_bytes_total + - record: windows_hyperv_datastore_read_from_file_count + expr: windows_hyperv_datastore_read_from_file_operations_total + - record: windows_hyperv_datastore_read_from_storage_byte_count + expr: windows_hyperv_datastore_read_from_storage_bytes_total + - record: windows_hyperv_datastore_read_from_storage_count + expr: windows_hyperv_datastore_read_from_storage_operations_total + - record: windows_hyperv_datastore_remove_operation_count + expr: windows_hyperv_datastore_remove_operations_total + - record: windows_hyperv_datastore_set_operation_count + expr: windows_hyperv_datastore_set_operations_total + - record: windows_hyperv_datastore_write_to_file_byte_count + expr: windows_hyperv_datastore_write_to_file_bytes_total + - record: windows_hyperv_datastore_write_to_file_count + expr: windows_hyperv_datastore_write_to_file_operations_total + - record: windows_hyperv_datastore_write_to_storage_byte_count + expr: windows_hyperv_datastore_write_to_storage_bytes_total + - record: windows_hyperv_datastore_write_to_storage_count + expr: windows_hyperv_datastore_write_to_storage_operations_total + - record: windows_hyperv_host_logical_processor_count + expr: windows_hyperv_host_logical_processors + - record: windows_hyperv_hypervisor_logical_processor_time_total + expr: windows_hyperv_hypervisor_logical_processor_time_seconds_total + - record: windows_hyperv_hypervisor_logical_processor_total_run_time_total + expr: windows_hyperv_hypervisor_logical_processor_total_run_time_seconds_total + - record: windows_hyperv_hypervisor_root_virtual_processor_time_total + expr: windows_hyperv_hypervisor_root_virtual_processor_time_seconds_total + - record: windows_hyperv_hypervisor_root_virtual_processor_total_run_time_total + expr: windows_hyperv_hypervisor_root_virtual_processor_total_run_time_seconds_total + - record: windows_hyperv_hypervisor_virtual_processor_mode_time_total + expr: windows_hyperv_hypervisor_virtual_processor_mode_time_seconds_total + - record: windows_hyperv_hypervisor_virtual_processor_run_time_total + expr: windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total + - record: windows_hyperv_root_partition_1G_device_pages + expr: windows_hyperv_root_partition_1g_device_pages + - record: windows_hyperv_root_partition_1G_gpa_pages + expr: windows_hyperv_root_partition_1g_gpa_pages + - record: windows_hyperv_root_partition_2M_device_pages + expr: windows_hyperv_root_partition_2m_device_pages + - record: windows_hyperv_root_partition_2M_gpa_pages + expr: windows_hyperv_root_partition_2m_gpa_pages + - record: windows_hyperv_root_partition_4K_device_pages + expr: windows_hyperv_root_partition_4k_device_pages + - record: windows_hyperv_root_partition_4K_gpa_pages + expr: windows_hyperv_root_partition_4k_gpa_pages + - record: windows_hyperv_total_vm_processor_count + expr: windows_hyperv_assigned_vm_processors + - record: windows_hyperv_virtual_machine_health_total_count + expr: windows_hyperv_virtual_machines + - record: windows_hyperv_virtual_smb_current_open_file_count + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_open_files, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_read_bytes_rdma + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_rdma_read_bytes_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_read_requests_rdma + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_rdma_read_requests_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_tree_connect_count + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_tree_connects_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_write_bytes_rdma + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_rdma_write_bytes_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_write_requests_rdma + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_rdma_write_requests_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_storage_device_bytes_read + expr: windows_hyperv_virtual_storage_device_read_bytes_total + - record: windows_hyperv_virtual_storage_device_bytes_written + expr: windows_hyperv_virtual_storage_device_written_bytes_total + - record: windows_hyperv_virtual_storage_device_error_count_total + expr: windows_hyperv_virtual_storage_device_errors_total + - record: windows_hyperv_vm_processor_count + expr: windows_hyperv_vm_processors + - record: windows_hyperv_virtual_network_adapter_drop_reasons + expr: windows_hyperv_virtual_network_adapter_drop_reasons_total + - record: windows_hyperv_virtual_smb_flush_requests + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_flush_requests_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_read_bytes + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_read_bytes_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_read_requests + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_read_requests_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_received_bytes + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_received_bytes_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_requests + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_requests_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_sent_bytes + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_sent_bytes_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_write_bytes + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_write_bytes_total, "exported_instance", "$1", "vm", "(.+)")) + - record: windows_hyperv_virtual_smb_write_requests + expr: max without (vm) (label_replace(windows_hyperv_virtual_smb_write_requests_total, "exported_instance", "$1", "vm", "(.+)")) + - name: windows_exporter-0.32-iis + rules: + - record: windows_iis_ipapi_extension_requests_total + expr: windows_iis_isapi_extension_requests_total + - record: windows_iis_current_application_pool_start_time + expr: windows_iis_current_application_pool_uptime_seconds + - record: windows_iis_total_application_pool_start_time + expr: windows_iis_total_application_pool_uptime_seconds + - record: windows_iis_time_since_last_worker_process_failure + expr: windows_iis_time_since_last_worker_process_failure_seconds + - record: windows_iis_service_uptime + expr: windows_iis_service_uptime_seconds + - record: windows_iis_total_application_pool_recycles + expr: windows_iis_application_pool_recycles_total + - record: windows_iis_total_worker_process_failures + expr: windows_iis_worker_process_failures_total + - record: windows_iis_total_worker_process_ping_failures + expr: windows_iis_worker_process_ping_failures_total + - record: windows_iis_total_worker_process_shutdown_failures + expr: windows_iis_worker_process_shutdown_failures_total + - record: windows_iis_total_worker_process_startup_failures + expr: windows_iis_worker_process_startup_failures_total + - record: windows_iis_total_worker_processes_created + expr: windows_iis_worker_processes_created_total + - name: windows_exporter-0.32-memory + rules: + - record: windows_memory_commit_limit + expr: windows_memory_commit_limit_bytes + - record: windows_memory_pool_paged_allocs_total + expr: windows_memory_pool_paged_allocs + - record: windows_memory_pool_nonpaged_allocs_total + expr: windows_memory_pool_nonpaged_allocs + - name: windows_exporter-0.32-mscluster + rules: + - record: windows_mscluster_cluster_block_cache_size + expr: max without (cluster) (label_replace(windows_mscluster_cluster_block_cache_size_bytes / 1048576, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_clus_svc_regroup_tick_in_milliseconds + expr: max without (cluster) (label_replace(windows_mscluster_cluster_clus_svc_regroup_tick_seconds * 1000, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_cluster_log_size + expr: max without (cluster) (label_replace(windows_mscluster_cluster_cluster_log_size_bytes / 1048576, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_cross_site_delay + expr: max without (cluster) (label_replace(windows_mscluster_cluster_cross_site_delay_seconds * 1000, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_cross_subnet_delay + expr: max without (cluster) (label_replace(windows_mscluster_cluster_cross_subnet_delay_seconds * 1000, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_grace_period_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_grace_period_timeout_seconds * 1000, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_root_memory_reserved + expr: max without (cluster) (label_replace(windows_mscluster_cluster_root_memory_reserved_bytes / 1048576, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_s2d_cache_flash_reserve_percent + expr: max without (cluster) (label_replace(windows_mscluster_cluster_s2d_cache_flash_reserve_ratio * 100, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_s2d_cache_page_size_k_bytes + expr: max without (cluster) (label_replace(windows_mscluster_cluster_s2d_cache_page_size_bytes / 1024, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_s2dio_latency_threshold + expr: max without (cluster) (label_replace(windows_mscluster_cluster_s2dio_latency_threshold_seconds * 1000, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_same_subnet_delay + expr: max without (cluster) (label_replace(windows_mscluster_cluster_same_subnet_delay_seconds * 1000, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_shutdown_timeout_in_minutes + expr: max without (cluster) (label_replace(windows_mscluster_cluster_shutdown_timeout_seconds / 60, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_resource_deadlock_timeout + expr: max without (resource, node, resource_group) (label_replace(label_replace(label_replace(windows_mscluster_resource_deadlock_timeout_seconds * 1000, "name", "$1", "resource", "(.+)"), "node_name", "$1", "node", "(.+)"), "owner_group", "$1", "resource_group", "(.+)")) + - record: windows_mscluster_resource_is_alive_poll_interval + expr: max without (resource, node, resource_group) (label_replace(label_replace(label_replace(windows_mscluster_resource_is_alive_poll_interval_seconds * 1000, "name", "$1", "resource", "(.+)"), "node_name", "$1", "node", "(.+)"), "owner_group", "$1", "resource_group", "(.+)")) + - record: windows_mscluster_resource_looks_alive_poll_interval + expr: max without (resource, node, resource_group) (label_replace(label_replace(label_replace(windows_mscluster_resource_looks_alive_poll_interval_seconds * 1000, "name", "$1", "resource", "(.+)"), "node_name", "$1", "node", "(.+)"), "owner_group", "$1", "resource_group", "(.+)")) + - record: windows_mscluster_resource_pending_timeout + expr: max without (resource, node, resource_group) (label_replace(label_replace(label_replace(windows_mscluster_resource_pending_timeout_seconds * 1000, "name", "$1", "resource", "(.+)"), "node_name", "$1", "node", "(.+)"), "owner_group", "$1", "resource_group", "(.+)")) + - record: windows_mscluster_resource_restart_delay + expr: max without (resource, node, resource_group) (label_replace(label_replace(label_replace(windows_mscluster_resource_restart_delay_seconds * 1000, "name", "$1", "resource", "(.+)"), "node_name", "$1", "node", "(.+)"), "owner_group", "$1", "resource_group", "(.+)")) + - record: windows_mscluster_resource_restart_period + expr: max without (resource, node, resource_group) (label_replace(label_replace(label_replace(windows_mscluster_resource_restart_period_seconds * 1000, "name", "$1", "resource", "(.+)"), "node_name", "$1", "node", "(.+)"), "owner_group", "$1", "resource_group", "(.+)")) + - record: windows_mscluster_resource_retry_period_on_failure + expr: max without (resource, node, resource_group) (label_replace(label_replace(label_replace(windows_mscluster_resource_retry_period_on_failure_seconds * 1000, "name", "$1", "resource", "(.+)"), "node_name", "$1", "node", "(.+)"), "owner_group", "$1", "resource_group", "(.+)")) + - record: windows_mscluster_resourcegroup_failover_period + expr: max without (resource_group, node) (label_replace(label_replace(windows_mscluster_resourcegroup_failover_period_seconds / 3600, "name", "$1", "resource_group", "(.+)"), "node_name", "$1", "node", "(.+)")) + - record: windows_mscluster_cluster_add_evict_delay + expr: max without (cluster) (label_replace(windows_mscluster_cluster_add_evict_delay_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_clus_svc_hang_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_clus_svc_hang_timeout_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_clus_svc_regroup_opening_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_clus_svc_regroup_opening_timeout_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_clus_svc_regroup_pruning_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_clus_svc_regroup_pruning_timeout_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_clus_svc_regroup_stage_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_clus_svc_regroup_stage_timeout_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_cluster_group_wait_delay + expr: max without (cluster) (label_replace(windows_mscluster_cluster_cluster_group_wait_delay_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_group_dependency_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_group_dependency_timeout_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_quarantine_duration + expr: max without (cluster) (label_replace(windows_mscluster_cluster_quarantine_duration_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_quorum_arbitration_time_max + expr: max without (cluster) (label_replace(windows_mscluster_cluster_quorum_arbitration_time_max_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_quorum_arbitration_time_min + expr: max without (cluster) (label_replace(windows_mscluster_cluster_quorum_arbitration_time_min_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_request_reply_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_request_reply_timeout_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_resiliency_default_period + expr: max without (cluster) (label_replace(windows_mscluster_cluster_resiliency_default_period_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_shared_volume_vss_writer_operation_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_shared_volume_vss_writer_operation_timeout_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_witness_database_write_timeout + expr: max without (cluster) (label_replace(windows_mscluster_cluster_witness_database_write_timeout_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_cluster_witness_restart_interval + expr: max without (cluster) (label_replace(windows_mscluster_cluster_witness_restart_interval_seconds, "name", "$1", "cluster", "(.+)")) + - record: windows_mscluster_resourcegroup_resiliency_period + expr: max without (resource_group, node) (label_replace(label_replace(windows_mscluster_resourcegroup_resiliency_period_seconds, "name", "$1", "resource_group", "(.+)"), "node_name", "$1", "node", "(.+)")) + - name: windows_exporter-0.32-msmq + rules: + - record: windows_msmq_bytes_in_journal_queue + expr: max without (queue) (label_replace(windows_msmq_journal_queue_bytes, "name", "$1", "queue", "(.+)")) + - record: windows_msmq_bytes_in_queue + expr: max without (queue) (label_replace(windows_msmq_queue_bytes, "name", "$1", "queue", "(.+)")) + - name: windows_exporter-0.32-mssql + rules: + - record: windows_mssql_databases_log_flush_wait_seconds + expr: windows_mssql_databases_log_flush_wait_seconds_total + - record: windows_mssql_databases_log_flush_write_seconds + expr: windows_mssql_databases_log_flush_write_seconds_total + - record: windows_mssql_databases_log_growths + expr: windows_mssql_databases_log_growths_total + - record: windows_mssql_databases_log_shrinks + expr: windows_mssql_databases_log_shrinks_total + - record: windows_mssql_databases_log_truncations + expr: windows_mssql_databases_log_truncations_total + - record: windows_mssql_dbreplica_database_flow_control_wait_seconds + expr: windows_mssql_dbreplica_database_flow_control_wait_seconds_total * 1e6 + - record: windows_mssql_dbreplica_group_commit_stall_seconds + expr: windows_mssql_dbreplica_group_commit_stall_seconds_total * 1e6 + - record: windows_mssql_dbreplica_transaction_delay_seconds + expr: windows_mssql_dbreplica_transaction_delay_seconds_total + - record: windows_mssql_dbreplica_recovery_queue_records + expr: windows_mssql_dbreplica_recovery_queue_bytes / 1024 + - record: windows_mssql_dbreplica_log_send_queue + expr: windows_mssql_dbreplica_log_send_queue_bytes / 1024 + - record: windows_mssql_dbreplica_log_remaining_for_undo + expr: windows_mssql_dbreplica_log_remaining_for_undo_bytes / 1024 + - record: windows_mssql_dbreplica_total_log_requiring_undo + expr: windows_mssql_dbreplica_total_log_requiring_undo_bytes / 1024 + - record: windows_mssql_locks_wait_time_seconds + expr: windows_mssql_locks_wait_time_seconds_total + - record: windows_mssql_locks_lock_wait_seconds + expr: windows_mssql_locks_lock_wait_seconds_total + - record: windows_mssql_transactions_nonsnapshot_version_active_total + expr: windows_mssql_transactions_nonsnapshot_version_active + - record: windows_mssql_transactions_snapshot_active_total + expr: windows_mssql_transactions_snapshot_active + - record: windows_mssql_transactions_update_snapshot_active_total + expr: windows_mssql_transactions_update_snapshot_active + - record: windows_mssql_transactions_version_cleanup_rate_bytes + expr: windows_mssql_transactions_version_cleanup_bytes_total + - record: windows_mssql_transactions_version_generation_rate_bytes + expr: windows_mssql_transactions_version_generation_bytes_total + - record: windows_mssql_bufman_extension_in_use_as_percentage + expr: windows_mssql_bufman_extension_in_use_ratio * 100 + - record: windows_mssql_databases_log_used_percent + expr: windows_mssql_databases_log_used_ratio * 100 + - record: windows_mssql_locks_lock_timeouts_excluding_NOWAIT + expr: windows_mssql_locks_lock_timeouts_excluding_nowait_total + - record: windows_mssql_accessmethods_au_batch_cleanup_failures + expr: windows_mssql_accessmethods_au_batch_cleanup_failures_total + - record: windows_mssql_accessmethods_au_batch_cleanups + expr: windows_mssql_accessmethods_au_batch_cleanups_total + - record: windows_mssql_accessmethods_au_cleanups + expr: windows_mssql_accessmethods_au_cleanups_total + - record: windows_mssql_accessmethods_by_reference_lob_creates + expr: windows_mssql_accessmethods_by_reference_lob_creates_total + - record: windows_mssql_accessmethods_by_reference_lob_uses + expr: windows_mssql_accessmethods_by_reference_lob_uses_total + - record: windows_mssql_accessmethods_column_value_pulls + expr: windows_mssql_accessmethods_column_value_pulls_total + - record: windows_mssql_accessmethods_column_value_pushes + expr: windows_mssql_accessmethods_column_value_pushes_total + - record: windows_mssql_accessmethods_dropped_rowset_cleanups + expr: windows_mssql_accessmethods_dropped_rowset_cleanups_total + - record: windows_mssql_accessmethods_dropped_rowset_skips + expr: windows_mssql_accessmethods_dropped_rowset_skips_total + - record: windows_mssql_accessmethods_extent_allocations + expr: windows_mssql_accessmethods_extent_allocations_total + - record: windows_mssql_accessmethods_extent_deallocations + expr: windows_mssql_accessmethods_extent_deallocations_total + - record: windows_mssql_accessmethods_forwarded_records + expr: windows_mssql_accessmethods_forwarded_records_total + - record: windows_mssql_accessmethods_free_space_page_fetches + expr: windows_mssql_accessmethods_free_space_page_fetches_total + - record: windows_mssql_accessmethods_free_space_scans + expr: windows_mssql_accessmethods_free_space_scans_total + - record: windows_mssql_accessmethods_full_scans + expr: windows_mssql_accessmethods_full_scans_total + - record: windows_mssql_accessmethods_ghost_record_skips + expr: windows_mssql_accessmethods_ghost_record_skips_total + - record: windows_mssql_accessmethods_index_searches + expr: windows_mssql_accessmethods_index_searches_total + - record: windows_mssql_accessmethods_insysxact_waits + expr: windows_mssql_accessmethods_insysxact_waits_total + - record: windows_mssql_accessmethods_leaf_page_cookie_failures + expr: windows_mssql_accessmethods_leaf_page_cookie_failures_total + - record: windows_mssql_accessmethods_leaf_page_cookie_uses + expr: windows_mssql_accessmethods_leaf_page_cookie_uses_total + - record: windows_mssql_accessmethods_lob_handle_creates + expr: windows_mssql_accessmethods_lob_handle_creates_total + - record: windows_mssql_accessmethods_lob_handle_destroys + expr: windows_mssql_accessmethods_lob_handle_destroys_total + - record: windows_mssql_accessmethods_lob_read_aheads + expr: windows_mssql_accessmethods_lob_read_aheads_total + - record: windows_mssql_accessmethods_lob_ss_provider_creates + expr: windows_mssql_accessmethods_lob_ss_provider_creates_total + - record: windows_mssql_accessmethods_lob_ss_provider_destroys + expr: windows_mssql_accessmethods_lob_ss_provider_destroys_total + - record: windows_mssql_accessmethods_lob_ss_provider_truncations + expr: windows_mssql_accessmethods_lob_ss_provider_truncations_total + - record: windows_mssql_accessmethods_mixed_page_allocations + expr: windows_mssql_accessmethods_mixed_page_allocations_total + - record: windows_mssql_accessmethods_page_allocations + expr: windows_mssql_accessmethods_page_allocations_total + - record: windows_mssql_accessmethods_page_compression_attempts + expr: windows_mssql_accessmethods_page_compression_attempts_total + - record: windows_mssql_accessmethods_page_compressions + expr: windows_mssql_accessmethods_page_compressions_total + - record: windows_mssql_accessmethods_page_deallocations + expr: windows_mssql_accessmethods_page_deallocations_total + - record: windows_mssql_accessmethods_page_splits + expr: windows_mssql_accessmethods_page_splits_total + - record: windows_mssql_accessmethods_probe_scans + expr: windows_mssql_accessmethods_probe_scans_total + - record: windows_mssql_accessmethods_range_scans + expr: windows_mssql_accessmethods_range_scans_total + - record: windows_mssql_accessmethods_scan_point_revalidations + expr: windows_mssql_accessmethods_scan_point_revalidations_total + - record: windows_mssql_accessmethods_table_lock_escalations + expr: windows_mssql_accessmethods_table_lock_escalations_total + - record: windows_mssql_accessmethods_tree_page_cookie_failures + expr: windows_mssql_accessmethods_tree_page_cookie_failures_total + - record: windows_mssql_accessmethods_tree_page_cookie_uses + expr: windows_mssql_accessmethods_tree_page_cookie_uses_total + - record: windows_mssql_accessmethods_workfile_creates + expr: windows_mssql_accessmethods_workfile_creates_total + - record: windows_mssql_accessmethods_worktables_creates + expr: windows_mssql_accessmethods_worktables_creates_total + - record: windows_mssql_accessmethods_worktables_from_cache_hits + expr: windows_mssql_accessmethods_worktables_from_cache_hits_total + - record: windows_mssql_accessmethods_worktables_from_cache_lookups + expr: windows_mssql_accessmethods_worktables_from_cache_lookups_total + - record: windows_mssql_availreplica_flow_control_wait_seconds + expr: windows_mssql_availreplica_flow_control_wait_seconds_total + - record: windows_mssql_availreplica_initiated_flow_controls + expr: windows_mssql_availreplica_initiated_flow_controls_total + - record: windows_mssql_availreplica_received_from_replica_bytes + expr: windows_mssql_availreplica_received_from_replica_bytes_total + - record: windows_mssql_availreplica_receives_from_replica + expr: windows_mssql_availreplica_receives_from_replica_total + - record: windows_mssql_availreplica_resent_messages + expr: windows_mssql_availreplica_resent_messages_total + - record: windows_mssql_availreplica_sends_to_replica + expr: windows_mssql_availreplica_sends_to_replica_total + - record: windows_mssql_availreplica_sends_to_transport + expr: windows_mssql_availreplica_sends_to_transport_total + - record: windows_mssql_availreplica_sent_to_replica_bytes + expr: windows_mssql_availreplica_sent_to_replica_bytes_total + - record: windows_mssql_availreplica_sent_to_transport_bytes + expr: windows_mssql_availreplica_sent_to_transport_bytes_total + - record: windows_mssql_bufman_background_writer_pages + expr: windows_mssql_bufman_background_writer_pages_total + - record: windows_mssql_bufman_checkpoint_pages + expr: windows_mssql_bufman_checkpoint_pages_total + - record: windows_mssql_bufman_extension_page_evictions + expr: windows_mssql_bufman_extension_page_evictions_total + - record: windows_mssql_bufman_extension_page_reads + expr: windows_mssql_bufman_extension_page_reads_total + - record: windows_mssql_bufman_extension_page_writes + expr: windows_mssql_bufman_extension_page_writes_total + - record: windows_mssql_bufman_free_list_stalls + expr: windows_mssql_bufman_free_list_stalls_total + - record: windows_mssql_bufman_lazywrites + expr: windows_mssql_bufman_lazywrites_total + - record: windows_mssql_bufman_page_lookups + expr: windows_mssql_bufman_page_lookups_total + - record: windows_mssql_bufman_page_reads + expr: windows_mssql_bufman_page_reads_total + - record: windows_mssql_bufman_page_writes + expr: windows_mssql_bufman_page_writes_total + - record: windows_mssql_bufman_read_ahead_issuing_seconds + expr: windows_mssql_bufman_read_ahead_issuing_seconds_total * 1e6 + - record: windows_mssql_bufman_read_ahead_pages + expr: windows_mssql_bufman_read_ahead_pages_total + - record: windows_mssql_databases_backup_restore_operations + expr: windows_mssql_databases_backup_restore_operations_total + - record: windows_mssql_databases_bulk_copy_bytes + expr: windows_mssql_databases_bulk_copy_bytes_total + - record: windows_mssql_databases_bulk_copy_rows + expr: windows_mssql_databases_bulk_copy_rows_total + - record: windows_mssql_databases_dbcc_logical_scan_bytes + expr: windows_mssql_databases_dbcc_logical_scan_bytes_total + - record: windows_mssql_databases_group_commit_stall_seconds + expr: windows_mssql_databases_group_commit_stall_seconds_total + - record: windows_mssql_databases_log_cache_reads + expr: windows_mssql_databases_log_cache_reads_total + - record: windows_mssql_databases_log_flush_waits + expr: windows_mssql_databases_log_flush_waits_total + - record: windows_mssql_databases_log_flushed_bytes + expr: windows_mssql_databases_log_flushed_bytes_total + - record: windows_mssql_databases_log_flushes + expr: windows_mssql_databases_log_flushes_total + - record: windows_mssql_databases_log_pool_cache_misses + expr: windows_mssql_databases_log_pool_cache_misses_total + - record: windows_mssql_databases_log_pool_disk_reads + expr: windows_mssql_databases_log_pool_disk_reads_total + - record: windows_mssql_databases_log_pool_empty_free_pool_pushes + expr: windows_mssql_databases_log_pool_empty_free_pool_pushes_total + - record: windows_mssql_databases_log_pool_hash_deletes + expr: windows_mssql_databases_log_pool_hash_deletes_total + - record: windows_mssql_databases_log_pool_hash_inserts + expr: windows_mssql_databases_log_pool_hash_inserts_total + - record: windows_mssql_databases_log_pool_invalid_hash_entries + expr: windows_mssql_databases_log_pool_invalid_hash_entries_total + - record: windows_mssql_databases_log_pool_log_scan_pushes + expr: windows_mssql_databases_log_pool_log_scan_pushes_total + - record: windows_mssql_databases_log_pool_log_writer_pushes + expr: windows_mssql_databases_log_pool_log_writer_pushes_total + - record: windows_mssql_databases_log_pool_low_memory_pushes + expr: windows_mssql_databases_log_pool_low_memory_pushes_total + - record: windows_mssql_databases_log_pool_no_free_buffer_pushes + expr: windows_mssql_databases_log_pool_no_free_buffer_pushes_total + - record: windows_mssql_databases_log_pool_req_behind_trunc + expr: windows_mssql_databases_log_pool_req_behind_trunc_total + - record: windows_mssql_databases_log_pool_requests + expr: windows_mssql_databases_log_pool_requests_total + - record: windows_mssql_databases_log_pool_requests_old_vlf + expr: windows_mssql_databases_log_pool_requests_old_vlf_total + - record: windows_mssql_databases_repl_transactions + expr: windows_mssql_databases_repl_transactions_total + - record: windows_mssql_databases_shrink_data_movement_bytes + expr: windows_mssql_databases_shrink_data_movement_bytes_total + - record: windows_mssql_databases_tracked_transactions + expr: windows_mssql_databases_tracked_transactions_total + - record: windows_mssql_databases_transactions + expr: windows_mssql_databases_transactions_total + - record: windows_mssql_databases_write_transactions + expr: windows_mssql_databases_write_transactions_total + - record: windows_mssql_databases_xtp_controller_log_processed_bytes + expr: windows_mssql_databases_xtp_controller_log_processed_bytes_total + - record: windows_mssql_dbreplica_database_initiated_flow_controls + expr: windows_mssql_dbreplica_database_initiated_flow_controls_total + - record: windows_mssql_dbreplica_group_commits + expr: windows_mssql_dbreplica_group_commits_total + - record: windows_mssql_dbreplica_log_compressed_bytes + expr: windows_mssql_dbreplica_log_compressed_bytes_total + - record: windows_mssql_dbreplica_log_compression_cachehits + expr: windows_mssql_dbreplica_log_compression_cachehits_total + - record: windows_mssql_dbreplica_log_compression_cachemisses + expr: windows_mssql_dbreplica_log_compression_cachemisses_total + - record: windows_mssql_dbreplica_log_compressions + expr: windows_mssql_dbreplica_log_compressions_total + - record: windows_mssql_dbreplica_log_decompressed_bytes + expr: windows_mssql_dbreplica_log_decompressed_bytes_total + - record: windows_mssql_dbreplica_log_decompressions + expr: windows_mssql_dbreplica_log_decompressions_total + - record: windows_mssql_dbreplica_log_received_bytes + expr: windows_mssql_dbreplica_log_received_bytes_total + - record: windows_mssql_dbreplica_mirrored_write_transactions + expr: windows_mssql_dbreplica_mirrored_write_transactions_total + - record: windows_mssql_dbreplica_received_file_bytes + expr: windows_mssql_dbreplica_received_file_bytes_total + - record: windows_mssql_dbreplica_redo_blocks + expr: windows_mssql_dbreplica_redo_blocks_total + - record: windows_mssql_dbreplica_redone_bytes + expr: windows_mssql_dbreplica_redone_bytes_total + - record: windows_mssql_dbreplica_redones + expr: windows_mssql_dbreplica_redones_total + - record: windows_mssql_genstats_connection_resets + expr: windows_mssql_genstats_connection_resets_total + - record: windows_mssql_genstats_logins + expr: windows_mssql_genstats_logins_total + - record: windows_mssql_genstats_logouts + expr: windows_mssql_genstats_logouts_total + - record: windows_mssql_genstats_non_atomic_yields + expr: windows_mssql_genstats_non_atomic_yields_total + - record: windows_mssql_genstats_temp_tables_creations + expr: windows_mssql_genstats_temp_tables_creations_total + - record: windows_mssql_locks_deadlocks + expr: windows_mssql_locks_deadlocks_total + - record: windows_mssql_locks_lock_requests + expr: windows_mssql_locks_lock_requests_total + - record: windows_mssql_locks_lock_timeouts + expr: windows_mssql_locks_lock_timeouts_total + - record: windows_mssql_locks_lock_waits + expr: windows_mssql_locks_lock_waits_total + - record: windows_mssql_sqlstats_auto_parameterization_attempts + expr: windows_mssql_sqlstats_auto_parameterization_attempts_total + - record: windows_mssql_sqlstats_batch_requests + expr: windows_mssql_sqlstats_batch_requests_total + - record: windows_mssql_sqlstats_failed_auto_parameterization_attempts + expr: windows_mssql_sqlstats_failed_auto_parameterization_attempts_total + - record: windows_mssql_sqlstats_forced_parameterizations + expr: windows_mssql_sqlstats_forced_parameterizations_total + - record: windows_mssql_sqlstats_guided_plan_executions + expr: windows_mssql_sqlstats_guided_plan_executions_total + - record: windows_mssql_sqlstats_misguided_plan_executions + expr: windows_mssql_sqlstats_misguided_plan_executions_total + - record: windows_mssql_sqlstats_safe_auto_parameterization_attempts + expr: windows_mssql_sqlstats_safe_auto_parameterization_attempts_total + - record: windows_mssql_sqlstats_sql_attentions + expr: windows_mssql_sqlstats_sql_attentions_total + - record: windows_mssql_sqlstats_sql_compilations + expr: windows_mssql_sqlstats_sql_compilations_total + - record: windows_mssql_sqlstats_sql_recompilations + expr: windows_mssql_sqlstats_sql_recompilations_total + - record: windows_mssql_sqlstats_unsafe_auto_parameterization_attempts + expr: windows_mssql_sqlstats_unsafe_auto_parameterization_attempts_total + - record: windows_mssql_transactions_version_store_creation_units + expr: windows_mssql_transactions_version_store_creation_units_total + - record: windows_mssql_transactions_version_store_truncation_units + expr: windows_mssql_transactions_version_store_truncation_units_total + - name: windows_exporter-0.32-netframework + rules: + - record: windows_netframework_clrmemory_gc_time_percent + expr: windows_netframework_clrmemory_gc_time_ratio * 100 + - name: windows_exporter-0.32-nps + rules: + - record: windows_nps_access_server_reset_time + expr: windows_nps_access_server_reset_time_seconds + - record: windows_nps_access_server_up_time + expr: windows_nps_access_server_up_time_seconds + - record: windows_nps_accounting_server_reset_time + expr: windows_nps_accounting_server_reset_time_seconds + - record: windows_nps_accounting_server_up_time + expr: windows_nps_accounting_server_up_time_seconds + - record: windows_nps_access_accepts + expr: windows_nps_access_accepts_total + - record: windows_nps_access_bad_authenticators + expr: windows_nps_access_bad_authenticators_total + - record: windows_nps_access_challenges + expr: windows_nps_access_challenges_total + - record: windows_nps_access_dropped_packets + expr: windows_nps_access_dropped_packets_total + - record: windows_nps_access_invalid_requests + expr: windows_nps_access_invalid_requests_total + - record: windows_nps_access_malformed_packets + expr: windows_nps_access_malformed_packets_total + - record: windows_nps_access_packets_received + expr: windows_nps_access_packets_received_total + - record: windows_nps_access_packets_sent + expr: windows_nps_access_packets_sent_total + - record: windows_nps_access_rejects + expr: windows_nps_access_rejects_total + - record: windows_nps_access_requests + expr: windows_nps_access_requests_total + - record: windows_nps_access_unknown_type + expr: windows_nps_access_unknown_type_total + - record: windows_nps_accounting_bad_authenticators + expr: windows_nps_accounting_bad_authenticators_total + - record: windows_nps_accounting_dropped_packets + expr: windows_nps_accounting_dropped_packets_total + - record: windows_nps_accounting_invalid_requests + expr: windows_nps_accounting_invalid_requests_total + - record: windows_nps_accounting_malformed_packets + expr: windows_nps_accounting_malformed_packets_total + - record: windows_nps_accounting_no_record + expr: windows_nps_accounting_no_record_total + - record: windows_nps_accounting_packets_received + expr: windows_nps_accounting_packets_received_total + - record: windows_nps_accounting_packets_sent + expr: windows_nps_accounting_packets_sent_total + - record: windows_nps_accounting_requests + expr: windows_nps_accounting_requests_total + - record: windows_nps_accounting_responses + expr: windows_nps_accounting_responses_total + - record: windows_nps_accounting_unknown_type + expr: windows_nps_accounting_unknown_type_total + - name: windows_exporter-0.32-printer + rules: + - record: windows_printer_job_count + expr: windows_printer_jobs + - name: windows_exporter-0.32-process + rules: + - record: windows_process_cpu_time_total + expr: windows_process_cpu_time_seconds_total + - name: windows_exporter-0.32-remote_fx + rules: + - record: windows_remote_fx_net_current_tcp_bandwidth + expr: windows_remote_fx_net_current_tcp_bandwidth_bytes_per_second + - record: windows_remote_fx_net_current_udp_bandwidth + expr: windows_remote_fx_net_current_udp_bandwidth_bytes_per_second + - record: windows_remote_fx_gfx_frame_quality + expr: windows_remote_fx_gfx_frame_quality_ratio * 100 + - name: windows_exporter-0.32-smb + rules: + - record: windows_smb_server_shares_read_requests_count_total + expr: windows_smb_server_shares_read_requests_total + - record: windows_smb_server_shares_write_requests_count_total + expr: windows_smb_server_shares_write_requests_total + - record: windows_smb_server_shares_metadata_requests_count_total + expr: windows_smb_server_shares_metadata_requests_total + - record: windows_smb_server_shares_files_opened_count_total + expr: windows_smb_server_shares_files_opened_total + - record: windows_smb_server_shares_current_open_file_count + expr: windows_smb_server_shares_open_files + - record: windows_smb_server_shares_tree_connect_count + expr: windows_smb_server_shares_tree_connects + - name: windows_exporter-0.32-storage_spaces + rules: + - record: windows_storage_spaces_virtual_disk_storage_efficiency_percent + expr: max without (virtual_disk) (label_replace(windows_storage_spaces_virtual_disk_storage_efficiency_ratio * 100, "name", "$1", "virtual_disk", "(.+)")) + - name: windows_exporter-0.32-tcp + rules: + - record: windows_tcp_connections_state_count + expr: windows_tcp_connections + - name: windows_exporter-0.32-time + rules: + - record: windows_time_clock_frequency_adjustment_ppb + expr: windows_time_clock_frequency_adjustment_ratio * 1e9 + - name: windows_exporter-0.32-vmware + rules: + - record: windows_vmware_cpu_effective_vm_speed_mhz_total + expr: windows_vmware_cpu_effective_vm_speed_hertz / 1e6 + - record: windows_vmware_cpu_limit_mhz + expr: windows_vmware_cpu_limit_hertz / 1e6 + - record: windows_vmware_cpu_reservation_mhz + expr: windows_vmware_cpu_reservation_hertz / 1e6 + - record: windows_vmware_host_processor_speed_mhz + expr: windows_vmware_host_processor_speed_hertz / 1e6 diff --git a/internal/collector/dfsr/dfsr.go b/internal/collector/dfsr/dfsr.go index 99888d97..e10e81cb 100644 --- a/internal/collector/dfsr/dfsr.go +++ b/internal/collector/dfsr/dfsr.go @@ -206,63 +206,63 @@ func (c *Collector) buildDescriptors() { c.connectionBandwidthSavingsUsingDFSReplicationRatio = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_bandwidth_savings_using_dfs_replication_ratio"), "Share of bandwidth saved by DFS Replication for this connection using RDC and other compression, compared to transferring the files uncompressed (0-1)", - []string{"name"}, + []string{"connection"}, nil, ) c.connectionBytesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_bytes_received_total"), "Total bytes received for connection", - []string{"name"}, + []string{"connection"}, nil, ) c.connectionCompressedSizeOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_compressed_size_of_files_received_bytes_total"), "Total compressed size of files received on the connection, in bytes", - []string{"name"}, + []string{"connection"}, nil, ) c.connectionFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_received_files_total"), "Total number of files received for connection", - []string{"name"}, + []string{"connection"}, nil, ) c.connectionRDCBytesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_rdc_received_bytes_total"), "Total bytes received on the connection while replicating files using Remote Differential Compression", - []string{"name"}, + []string{"connection"}, nil, ) c.connectionRDCCompressedSizeOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_rdc_compressed_size_of_received_files_bytes_total"), "Total compressed size of files received with Remote Differential Compression on the connection, in bytes. This is the number of bytes that would have been received had RDC not been used", - []string{"name"}, + []string{"connection"}, nil, ) c.connectionRDCNumberOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_rdc_received_files_total"), "Total number of files received using remote differential compression", - []string{"name"}, + []string{"connection"}, nil, ) c.connectionRDCSizeOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_rdc_size_of_received_files_bytes_total"), "Total size of received Remote Differential Compression files, in bytes.", - []string{"name"}, + []string{"connection"}, nil, ) c.connectionSizeOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "connection_files_received_bytes_total"), "Total size of files received, in bytes", - []string{"name"}, + []string{"connection"}, nil, ) @@ -270,189 +270,189 @@ func (c *Collector) buildDescriptors() { c.folderBandwidthSavingsUsingDFSReplicationRatio = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_bandwidth_savings_using_dfs_replication_ratio"), "Share of bandwidth saved by DFS Replication for this replicated folder using RDC and other compression, compared to transferring the files uncompressed (0-1)", - []string{"name"}, + []string{"folder"}, nil, ) c.folderCompressedSizeOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_compressed_size_of_received_files_bytes_total"), "Total compressed size of files received on the folder, in bytes", - []string{"name"}, + []string{"folder"}, nil, ) c.folderConflictBytesCleanedUpTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_conflict_cleaned_up_bytes_total"), "Total size of conflict loser files and folders deleted from the Conflict and Deleted folder, in bytes", - []string{"name"}, + []string{"folder"}, nil, ) c.folderConflictBytesGeneratedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_conflict_generated_bytes_total"), "Total size of conflict loser files and folders moved to the Conflict and Deleted folder, in bytes", - []string{"name"}, + []string{"folder"}, nil, ) c.folderConflictFilesCleanedUpTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_conflict_cleaned_up_files_total"), "Number of conflict loser files deleted from the Conflict and Deleted folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderConflictFilesGeneratedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_conflict_generated_files_total"), "Number of files and folders moved to the Conflict and Deleted folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderConflictFolderCleanupsCompletedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_conflict_folder_cleanups_total"), "Number of deletions of conflict loser files and folders in the Conflict and Deleted", - []string{"name"}, + []string{"folder"}, nil, ) c.folderConflictSpaceInUse = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_conflict_space_in_use_bytes"), "Total size of the conflict loser files and folders currently in the Conflict and Deleted folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderDeletedSpaceInUse = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_deleted_space_in_use_bytes"), "Total size (in bytes) of the deleted files and folders currently in the Conflict and Deleted folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderDeletedBytesCleanedUpTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_deleted_cleaned_up_bytes_total"), "Total size (in bytes) of replicating deleted files and folders that were cleaned up from the Conflict and Deleted folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderDeletedBytesGeneratedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_deleted_generated_bytes_total"), "Total size (in bytes) of replicated deleted files and folders that were moved to the Conflict and Deleted folder after they were deleted from a replicated folder on a sending member", - []string{"name"}, + []string{"folder"}, nil, ) c.folderDeletedFilesCleanedUpTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_deleted_cleaned_up_files_total"), "Number of files and folders that were cleaned up from the Conflict and Deleted folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderDeletedFilesGeneratedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_deleted_generated_files_total"), "Number of deleted files and folders that were moved to the Conflict and Deleted folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderFileInstallsRetriedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_file_installs_retried_total"), "Total number of file installs that are being retried due to sharing violations or other errors encountered when installing the files", - []string{"name"}, + []string{"folder"}, nil, ) c.folderFileInstallsSucceededTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_file_installs_succeeded_total"), "Total number of files that were successfully received from sending members and installed locally on this server", - []string{"name"}, + []string{"folder"}, nil, ) c.folderFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_received_files_total"), "Total number of files received", - []string{"name"}, + []string{"folder"}, nil, ) c.folderRDCBytesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_rdc_received_bytes_total"), "Total number of bytes received in replicating files using Remote Differential Compression", - []string{"name"}, + []string{"folder"}, nil, ) c.folderRDCCompressedSizeOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_rdc_compressed_size_of_received_files_bytes_total"), "Total compressed size (in bytes) of the files received with Remote Differential Compression", - []string{"name"}, + []string{"folder"}, nil, ) c.folderRDCNumberOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_rdc_received_files_total"), "Total number of files received with Remote Differential Compression", - []string{"name"}, + []string{"folder"}, nil, ) c.folderRDCSizeOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_rdc_files_received_bytes_total"), "Total uncompressed size (in bytes) of the files received with Remote Differential Compression", - []string{"name"}, + []string{"folder"}, nil, ) c.folderSizeOfFilesReceivedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_files_received_bytes_total"), "Total uncompressed size (in bytes) of the files received", - []string{"name"}, + []string{"folder"}, nil, ) c.folderStagingSpaceInUse = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_staging_space_in_use_bytes"), "Total size of files and folders currently in the staging folder.", - []string{"name"}, + []string{"folder"}, nil, ) c.folderStagingBytesCleanedUpTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_staging_cleaned_up_bytes_total"), "Total size (in bytes) of the files and folders that have been cleaned up from the staging folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderStagingBytesGeneratedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_staging_generated_bytes_total"), "Total size (in bytes) of replicated files and folders in the staging folder created by the DFS Replication service since last restart", - []string{"name"}, + []string{"folder"}, nil, ) c.folderStagingFilesCleanedUpTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_staging_cleaned_up_files_total"), "Total number of files and folders that have been cleaned up from the staging folder", - []string{"name"}, + []string{"folder"}, nil, ) c.folderStagingFilesGeneratedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_staging_generated_files_total"), "Total number of times replicated files and folders have been staged by the DFS Replication service", - []string{"name"}, + []string{"folder"}, nil, ) c.folderUpdatesDroppedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "folder_dropped_updates_total"), "Total number of redundant file replication update records that have been ignored by the DFS Replication service because they did not change the replicated file or folder", - []string{"name"}, + []string{"folder"}, nil, ) @@ -460,35 +460,35 @@ func (c *Collector) buildDescriptors() { c.volumeDatabaseCommitsTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "volume_database_commits_total"), "Total number of DFSR volume database commits", - []string{"name"}, + []string{"volume"}, nil, ) c.volumeDatabaseLookupsTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "volume_database_lookups_total"), "Total number of DFSR volume database lookups", - []string{"name"}, + []string{"volume"}, nil, ) c.volumeUSNJournalUnreadRatio = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "volume_usn_journal_unread_ratio"), "Share of the volume USN journal that DFS Replication has not read and processed yet (0-1). A journal wrap occurs at 1", - []string{"name"}, + []string{"volume"}, nil, ) c.volumeUSNJournalRecordsAcceptedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "volume_usn_journal_accepted_records_total"), "Total number of USN journal records accepted", - []string{"name"}, + []string{"volume"}, nil, ) c.volumeUSNJournalRecordsReadTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "volume_usn_journal_read_records_total"), "Total number of DFSR volume USN journal records read", - []string{"name"}, + []string{"volume"}, nil, ) } diff --git a/internal/collector/dhcp/dhcp.go b/internal/collector/dhcp/dhcp.go index 1f4770fe..faca5f55 100644 --- a/internal/collector/dhcp/dhcp.go +++ b/internal/collector/dhcp/dhcp.go @@ -193,7 +193,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { c.scopeInfo = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "scope_info"), "DHCP Scope information", - []string{"name", "superscope_name", "superscope_id", "scope"}, + []string{"scope_name", "superscope_name", "superscope_id", "scope"}, nil, ) diff --git a/internal/collector/dhcp/dhcp_test.go b/internal/collector/dhcp/dhcp_test.go index d8704363..5f8d6c4e 100644 --- a/internal/collector/dhcp/dhcp_test.go +++ b/internal/collector/dhcp/dhcp_test.go @@ -31,5 +31,5 @@ func BenchmarkCollector(b *testing.B) { func TestCollector(t *testing.T) { metrics := testutils.TestCollector(t, dhcp.New, nil) - testutils.RequireFixtureMetric(t, metrics, dhcp.Name, "windows_dhcp_scope_info", prometheus.Labels{"name": "GitHubActions", "scope": "192.0.2.0/24"}) + testutils.RequireFixtureMetric(t, metrics, dhcp.Name, "windows_dhcp_scope_info", prometheus.Labels{"scope_name": "GitHubActions", "scope": "192.0.2.0/24"}) } diff --git a/internal/collector/diskdrive/diskdrive.go b/internal/collector/diskdrive/diskdrive.go index 2f48ab28..77e8f473 100644 --- a/internal/collector/diskdrive/diskdrive.go +++ b/internal/collector/diskdrive/diskdrive.go @@ -86,32 +86,31 @@ func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error { "device_id", "model", "caption", - "name", }, nil, ) c.status = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "status"), "Status of the drive", - []string{"name", "status"}, + []string{"device_id", "status"}, nil, ) c.size = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "size_bytes"), "Size of the disk drive. It is calculated by multiplying the total number of cylinders, tracks in each cylinder, sectors in each track, and bytes in each sector.", - []string{"name"}, + []string{"device_id"}, nil, ) c.partitions = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "partitions"), "Number of partitions", - []string{"name"}, + []string{"device_id"}, nil, ) c.availability = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "availability"), "Availability Status", - []string{"name", "availability"}, + []string{"device_id", "availability"}, nil, ) @@ -119,7 +118,7 @@ func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error { return errors.New("miSession is nil") } - miQuery, err := mi.NewQuery("SELECT DeviceID, Model, Caption, Name, Partitions, Size, Status, Availability FROM WIN32_DiskDrive") + miQuery, err := mi.NewQuery("SELECT DeviceID, Model, Caption, Partitions, Size, Status, Availability FROM WIN32_DiskDrive") if err != nil { return fmt.Errorf("failed to create WMI query: %w", err) } @@ -137,7 +136,6 @@ type diskDrive struct { DeviceID string `mi:"DeviceID"` Model string `mi:"Model"` Size uint64 `mi:"Size"` - Name string `mi:"Name"` Caption string `mi:"Caption"` Partitions uint32 `mi:"Partitions"` Status string `mi:"Status"` @@ -198,16 +196,15 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric, maxScrapeDuration time. } for _, disk := range dst { - distName := strings.Trim(disk.Name, `\.`) + deviceID := strings.Trim(disk.DeviceID, `\.`) ch <- prometheus.MustNewConstMetric( c.diskInfo, prometheus.GaugeValue, 1.0, - strings.Trim(disk.DeviceID, `\.`), + deviceID, strings.TrimRight(disk.Model, " "), strings.TrimRight(disk.Caption, " "), - distName, ) for _, status := range allDiskStatus { @@ -220,7 +217,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric, maxScrapeDuration time. c.status, prometheus.GaugeValue, isCurrentState, - distName, + deviceID, status, ) } @@ -229,14 +226,14 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric, maxScrapeDuration time. c.size, prometheus.GaugeValue, float64(disk.Size), - distName, + deviceID, ) ch <- prometheus.MustNewConstMetric( c.partitions, prometheus.GaugeValue, float64(disk.Partitions), - distName, + deviceID, ) for availNum, val := range availMap { @@ -249,7 +246,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric, maxScrapeDuration time. c.availability, prometheus.GaugeValue, isCurrentState, - distName, + deviceID, val, ) } diff --git a/internal/collector/dns/dns.go b/internal/collector/dns/dns.go index c0695cec..d6933fbf 100644 --- a/internal/collector/dns/dns.go +++ b/internal/collector/dns/dns.go @@ -307,7 +307,7 @@ func (c *Collector) buildDescriptors() { c.dnsWMIStats = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "wmi_stats_total"), "DNS WMI statistics from MicrosoftDNS_Statistic", - []string{"name", "collection_name", "dns_server"}, + []string{"statistic", "collection_name", "dns_server"}, nil, ) } diff --git a/internal/collector/exchange/exchange_ad_access_processes.go b/internal/collector/exchange/exchange_ad_access_processes.go index b2564821..49692e38 100644 --- a/internal/collector/exchange/exchange_ad_access_processes.go +++ b/internal/collector/exchange/exchange_ad_access_processes.go @@ -67,49 +67,49 @@ func (c *Collector) buildADAccessProcesses() error { c.ldapReadTime = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "ldap_read_time_seconds_total"), "Total time in seconds to send an LDAP read request and receive a response", - []string{"name"}, + []string{"process"}, nil, ) c.ldapReadOperations = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "ldap_read_operations_total"), "Total number of LDAP read operations", - []string{"name"}, + []string{"process"}, nil, ) c.ldapSearchTime = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "ldap_search_time_seconds_total"), "Total time in seconds to send an LDAP search request and receive a response", - []string{"name"}, + []string{"process"}, nil, ) c.ldapSearchOperations = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "ldap_search_operations_total"), "Total number of LDAP search operations", - []string{"name"}, + []string{"process"}, nil, ) c.ldapWriteTime = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "ldap_write_time_seconds_total"), "Total time in seconds to send an LDAP Add/Modify/Delete request and receive a response", - []string{"name"}, + []string{"process"}, nil, ) c.ldapWriteOperations = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "ldap_write_operations_total"), "Total number of LDAP Add/Modify/Delete operations", - []string{"name"}, + []string{"process"}, nil, ) c.ldapTimeoutErrorsPerSec = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "ldap_timeout_errors_total"), "Total number of LDAP timeout errors", - []string{"name"}, + []string{"process"}, nil, ) c.longRunningLDAPOperationsPerMin = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "ldap_long_running_operations_per_second"), "Long running LDAP operations per second, averaged over the last minute. Exchange reports the per-minute value as a raw count (Windows has no per-minute counter type); the collector divides it by 60", - []string{"name"}, + []string{"process"}, nil, ) diff --git a/internal/collector/exchange/exchange_http_proxy.go b/internal/collector/exchange/exchange_http_proxy.go index 10fcfd99..79082d8d 100644 --- a/internal/collector/exchange/exchange_http_proxy.go +++ b/internal/collector/exchange/exchange_http_proxy.go @@ -60,37 +60,37 @@ func (c *Collector) buildHTTPProxy() error { c.mailboxServerLocatorAverageLatency = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "http_proxy_mailbox_server_locator_avg_latency_seconds"), "Average latency in seconds of MailboxServerLocator web service calls", - []string{"name"}, + []string{"protocol"}, nil, ) c.averageAuthenticationLatency = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "http_proxy_avg_auth_latency_seconds"), "Average time in seconds spent authenticating CAS requests over the last 200 samples", - []string{"name"}, + []string{"protocol"}, nil, ) c.outstandingProxyRequests = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "http_proxy_outstanding_proxy_requests"), "Number of concurrent outstanding proxy requests", - []string{"name"}, + []string{"protocol"}, nil, ) c.proxyRequestsPerSec = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "http_proxy_requests_total"), "Number of proxy requests processed each second", - []string{"name"}, + []string{"protocol"}, nil, ) c.averageCASProcessingLatency = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "http_proxy_avg_cas_processing_latency_seconds"), "Average latency in seconds of CAS processing time over the last 200 reqs", - []string{"name"}, + []string{"protocol"}, nil, ) c.mailboxServerProxyFailureRate = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "http_proxy_mailbox_proxy_failure_ratio"), "Ratio (0-1) of failures between this CAS and MBX servers over the last 200 samples", - []string{"name"}, + []string{"protocol"}, nil, ) diff --git a/internal/collector/exchange/exchange_transport_queues.go b/internal/collector/exchange/exchange_transport_queues.go index 982e70bd..74c70655 100644 --- a/internal/collector/exchange/exchange_transport_queues.go +++ b/internal/collector/exchange/exchange_transport_queues.go @@ -85,115 +85,115 @@ func (c *Collector) buildTransportQueues() error { c.externalActiveRemoteDeliveryQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_external_active_remote_delivery"), "External Active Remote Delivery Queue length", - []string{"name"}, + []string{"queue"}, nil, ) c.internalActiveRemoteDeliveryQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_internal_active_remote_delivery"), "Internal Active Remote Delivery Queue length", - []string{"name"}, + []string{"queue"}, nil, ) c.activeMailboxDeliveryQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_active_mailbox_delivery"), "Active Mailbox Delivery Queue length", - []string{"name"}, + []string{"queue"}, nil, ) c.retryMailboxDeliveryQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_retry_mailbox_delivery"), "Retry Mailbox Delivery Queue length", - []string{"name"}, + []string{"queue"}, nil, ) c.unreachableQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_unreachable"), "Unreachable Queue length", - []string{"name"}, + []string{"queue"}, nil, ) c.externalLargestDeliveryQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_external_largest_delivery"), "External Largest Delivery Queue length", - []string{"name"}, + []string{"queue"}, nil, ) c.internalLargestDeliveryQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_internal_largest_delivery"), "Internal Largest Delivery Queue length", - []string{"name"}, + []string{"queue"}, nil, ) c.poisonQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_poison"), "Poison Queue length", - []string{"name"}, + []string{"queue"}, nil, ) c.messagesQueuedForDeliveryTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_messages_queued_for_delivery_total"), "Messages Queued For Delivery Total", - []string{"name"}, + []string{"queue"}, nil, ) c.messagesSubmittedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_messages_submitted_total"), "Messages Submitted Total", - []string{"name"}, + []string{"queue"}, nil, ) c.messagesDelayedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_messages_delayed_total"), "Messages Delayed Total", - []string{"name"}, + []string{"queue"}, nil, ) c.messagesCompletedDeliveryTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_messages_completed_delivery_total"), "Messages Completed Delivery Total", - []string{"name"}, + []string{"queue"}, nil, ) c.aggregateShadowQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_aggregate_shadow_queue_length"), "The current number of messages in shadow queues.", - []string{"name"}, + []string{"queue"}, nil, ) c.submissionQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_submission_queue_length"), "Submission Queue Length", - []string{"name"}, + []string{"queue"}, nil, ) c.delayQueueLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_delay_queue_length"), "Delay Queue Length", - []string{"name"}, + []string{"queue"}, nil, ) c.itemsCompletedDeliveryTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_items_completed_delivery_total"), "Items Completed Delivery Total", - []string{"name"}, + []string{"queue"}, nil, ) c.itemsQueuedForDeliveryExpiredTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_items_queued_for_delivery_expired_total"), "Items Queued For Delivery Expired Total", - []string{"name"}, + []string{"queue"}, nil, ) c.itemsQueuedForDeliveryTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_items_queued_for_delivery_total"), "Items Queued For Delivery Total", - []string{"name"}, + []string{"queue"}, nil, ) c.itemsResubmittedTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "transport_queues_items_resubmitted_total"), "Items Resubmitted Total", - []string{"name"}, + []string{"queue"}, nil, ) diff --git a/internal/collector/exchange/exchange_workload_management.go b/internal/collector/exchange/exchange_workload_management.go index fa722d06..70d2b9e7 100644 --- a/internal/collector/exchange/exchange_workload_management.go +++ b/internal/collector/exchange/exchange_workload_management.go @@ -57,31 +57,31 @@ func (c *Collector) buildWorkloadManagementWorkloads() error { c.activeTasks = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "workload_active_tasks"), "Number of active tasks currently running in the background for workload management", - []string{"name"}, + []string{"workload"}, nil, ) c.completedTasks = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "workload_completed_tasks_total"), "Number of workload management tasks that have been completed", - []string{"name"}, + []string{"workload"}, nil, ) c.queuedTasks = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "workload_queued_tasks"), "Number of workload management tasks that are currently queued up waiting to be processed", - []string{"name"}, + []string{"workload"}, nil, ) c.yieldedTasks = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "workload_yielded_tasks_total"), "The total number of tasks that have been yielded by a workload", - []string{"name"}, + []string{"workload"}, nil, ) c.isActive = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "workload_is_active"), "Active indicates whether the workload is in an active (1) or paused (0) state", - []string{"name"}, + []string{"workload"}, nil, ) diff --git a/internal/collector/hyperv/hyperv_virtual_smb.go b/internal/collector/hyperv/hyperv_virtual_smb.go index adfb6ef3..7cb52d8a 100644 --- a/internal/collector/hyperv/hyperv_virtual_smb.go +++ b/internal/collector/hyperv/hyperv_virtual_smb.go @@ -83,103 +83,103 @@ func (c *Collector) buildVirtualSMB() error { c.virtualSMBDirectMappedSections = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_direct_mapped_sections"), "Represents the number of direct-mapped sections in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBDirectMappedPages = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_direct_mapped_pages"), "Represents the number of direct-mapped pages in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBWriteBytesRDMA = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_rdma_write_bytes_total"), "Represents the total number of bytes written using RDMA in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBWriteBytes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_write_bytes_total"), "Represents the total number of bytes written in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBReadBytesRDMA = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_rdma_read_bytes_total"), "Represents the total number of bytes read using RDMA in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBReadBytes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_read_bytes_total"), "Represents the total number of bytes read in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBFlushRequests = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_flush_requests_total"), "Represents the total number of flush requests in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBWriteRequestsRDMA = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_rdma_write_requests_total"), "Represents the total number of write requests using RDMA in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBWriteRequests = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_write_requests_total"), "Represents the total number of write requests in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBReadRequestsRDMA = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_rdma_read_requests_total"), "Represents the total number of read requests using RDMA in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBReadRequests = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_read_requests_total"), "Represents the total number of read requests in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBCurrentPendingRequests = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_current_pending_requests"), "Represents the current number of pending requests in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBCurrentOpenFileCount = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_open_files"), "Represents the current number of open files in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBTreeConnectCount = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_tree_connects_total"), "Represents the total number of tree connects in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBRequests = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_requests_total"), "Represents the total number of requests in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBSentBytes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_sent_bytes_total"), "Represents the total number of bytes sent in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) c.virtualSMBReceivedBytes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_received_bytes_total"), "Represents the total number of bytes received in the virtual SMB", - []string{"instance"}, + []string{"vm"}, nil, ) diff --git a/internal/collector/mscluster/mscluster_cluster.go b/internal/collector/mscluster/mscluster_cluster.go index 7468645b..a95f7e61 100644 --- a/internal/collector/mscluster/mscluster_cluster.go +++ b/internal/collector/mscluster/mscluster_cluster.go @@ -216,451 +216,451 @@ func (c *Collector) buildClusterDescriptors() { c.clusterAddEvictDelay = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "add_evict_delay_seconds"), "Provides access to the cluster's AddEvictDelay property, which is the number of seconds that a new node is delayed after an eviction of another node.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterAdminAccessPoint = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "admin_access_point"), "The type of the cluster administrative access point.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterAutoAssignNodeSite = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "auto_assign_node_site"), "Determines whether or not the cluster will attempt to automatically assign nodes to sites based on networks and Active Directory Site information.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterAutoBalancerLevel = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "auto_balancer_level"), "Determines the level of aggressiveness of AutoBalancer.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterAutoBalancerMode = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "auto_balancer_mode"), "Determines whether or not the auto balancer is enabled.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterBackupInProgress = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "backup_in_progress"), "Indicates whether a backup is in progress.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterBlockCacheSize = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "block_cache_size_bytes"), "CSV BlockCache size in bytes.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusSvcHangTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_hang_timeout_seconds"), "Controls how long, in seconds, the cluster network driver waits between Failover Cluster Service heartbeats before it determines that the Failover Cluster Service has stopped responding.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusSvcRegroupOpeningTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_regroup_opening_timeout_seconds"), "Controls how long, in seconds, a node will wait on other nodes in the opening stage before deciding that they failed.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusSvcRegroupPruningTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_regroup_pruning_timeout_seconds"), "Controls how long, in seconds, the membership leader will wait to reach full connectivity between cluster nodes.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusSvcRegroupStageTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_regroup_stage_timeout_seconds"), "Controls how long, in seconds, a node will wait on other nodes in a membership stage before deciding that they failed.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusSvcRegroupTickInMilliseconds = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_regroup_tick_seconds"), "Controls how frequently, in seconds, the membership algorithm is sending periodic membership messages.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusterEnforcedAntiAffinity = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cluster_enforced_anti_affinity"), "Enables or disables hard enforcement of group anti-affinity classes.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusterFunctionalLevel = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cluster_functional_level"), "The functional level the cluster is currently running in.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusterGroupWaitDelay = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cluster_group_wait_delay_seconds"), "Maximum time in seconds that a group waits for its preferred node to come online during cluster startup before coming online on a different node.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusterLogLevel = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cluster_log_level"), "Controls the level of cluster logging.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusterLogSize = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cluster_log_size_bytes"), "Controls the maximum size, in bytes, of the cluster log files on each of the nodes.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterClusterUpgradeVersion = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cluster_upgrade_version"), "Specifies the upgrade version the cluster is currently running in.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterCrossSiteDelay = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cross_site_delay_seconds"), "Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats across sites.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterCrossSiteThreshold = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cross_site_threshold"), "Controls how many Cluster Service heartbeats can be missed across sites before it determines that Cluster Service has stopped responding.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterCrossSubnetDelay = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cross_subnet_delay_seconds"), "Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats across subnets.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterCrossSubnetThreshold = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "cross_subnet_threshold"), "Controls how many Cluster Service heartbeats can be missed across subnets before it determines that Cluster Service has stopped responding.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterCsvBalancer = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "csv_balancer"), "Whether automatic balancing for CSV is enabled.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterDatabaseReadWriteMode = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "database_read_write_mode"), "Sets the database read and write mode.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterDefaultNetworkRole = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "default_network_role"), "Provides access to the cluster's DefaultNetworkRole property.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterDetectedCloudPlatform = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "detected_cloud_platform"), "(DetectedCloudPlatform)", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterDetectManagedEvents = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "detect_managed_events"), "(DetectManagedEvents)", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterDetectManagedEventsThreshold = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "detect_managed_events_threshold"), "(DetectManagedEventsThreshold)", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterDisableGroupPreferredOwnerRandomization = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "disable_group_preferred_owner_randomization"), "(DisableGroupPreferredOwnerRandomization)", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterDrainOnShutdown = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "drain_on_shutdown"), "Whether to drain the node when cluster service is being stopped.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterDynamicQuorumEnabled = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "dynamic_quorum_enabled"), "Allows cluster service to adjust node weights as needed to increase availability.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterEnableSharedVolumes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "enable_shared_volumes"), "Enables or disables cluster shared volumes on this cluster.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterFixQuorum = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "fix_quorum"), "Provides access to the cluster's FixQuorum property, which specifies if the cluster is in a fix quorum state.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterGracePeriodEnabled = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "grace_period_enabled"), "Whether the node grace period feature of this cluster is enabled.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterGracePeriodTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "grace_period_timeout_seconds"), "The grace period timeout in seconds.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterGroupDependencyTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "group_dependency_timeout_seconds"), "The timeout in seconds after which a group will be brought online despite unsatisfied dependencies", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterHangRecoveryAction = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "hang_recovery_action"), "Controls the action to take if the user-mode processes have stopped responding.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterIgnorePersistentStateOnStartup = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "ignore_persistent_state_on_startup"), "Provides access to the cluster's IgnorePersistentStateOnStartup property, which specifies whether the cluster will bring online groups that were online when the cluster was shut down.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterLogResourceControls = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "log_resource_controls"), "Controls the logging of resource controls.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterLowerQuorumPriorityNodeId = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "lower_quorum_priority_node_id"), "Specifies the Node ID that has a lower priority when voting for quorum is performed. If the quorum vote is split 50/50%, the specified node's vote would be ignored to break the tie. If this is not set then the cluster will pick a node at random to break the tie.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterMaxNumberOfNodes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "max_number_of_nodes"), "Indicates the maximum number of nodes that may participate in the Cluster.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterMessageBufferLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "message_buffer_length"), "The maximum unacknowledged message count for GEM.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterMinimumNeverPreemptPriority = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "minimum_never_preempt_priority"), "Groups with this priority or higher cannot be preempted.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterMinimumPreemptorPriority = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "minimum_preemptor_priority"), "Minimum priority a cluster group must have to be able to preempt another group.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterNetftIPSecEnabled = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "netft_ip_sec_enabled"), "Whether IPSec is enabled for cluster internal traffic.cluster", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterPlacementOptions = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "placement_options"), "Various option flags to modify default placement behavior.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterPlumbAllCrossSubnetRoutes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "plumb_all_cross_subnet_routes"), "Plumbs all possible cross subnet routes to all nodes.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterPreventQuorum = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "prevent_quorum"), "Whether the cluster will ignore group persistent state on startup.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterQuarantineDuration = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "quarantine_duration_seconds"), "The quarantine period timeout in seconds.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterQuarantineThreshold = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "quarantine_threshold"), "Number of node failures before it will be quarantined.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterQuorumArbitrationTimeMax = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "quorum_arbitration_time_max_seconds"), "Controls the maximum time, in seconds, necessary to decide the Quorum owner node.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterQuorumArbitrationTimeMin = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "quorum_arbitration_time_min_seconds"), "Controls the minimum time, in seconds, necessary to decide the Quorum owner node.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterQuorumTypeValue = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "quorum_type_value"), "Get the current quorum type value. -1: Unknown; 1: Node; 2: FileShareWitness; 3: Storage; 4: None", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterRequestReplyTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "request_reply_timeout_seconds"), "Controls the request reply time-out period in seconds.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterResiliencyDefaultPeriod = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "resiliency_default_period_seconds"), "The default resiliency period, in seconds, for the cluster.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterResiliencyLevel = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "resiliency_level"), "The resiliency level for the cluster.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterRootMemoryReserved = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "root_memory_reserved_bytes"), "Controls the amount of memory, in bytes, reserved for the parent partition on all cluster nodes.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterRouteHistoryLength = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "route_history_length"), "The history length for routes to help finding network issues.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterS2DBusTypes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_bus_types"), "Bus types for storage spaces direct.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterS2DCacheDesiredState = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_cache_desired_state"), "Desired state of the storage spaces direct cache.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterS2DCacheFlashReservePercent = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_cache_flash_reserve_ratio"), "Ratio (0-1) of allocated flash space to utilize when caching.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterS2DCachePageSizeKBytes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_cache_page_size_bytes"), "Page size in bytes used by S2D cache.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterS2DEnabled = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_enabled"), "Whether direct attached storage (DAS) is enabled.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterS2DIOLatencyThreshold = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "s2dio_latency_threshold_seconds"), "The I/O latency threshold in seconds for storage spaces direct.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterS2DOptimizations = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_optimizations"), "Optimization flags for storage spaces direct.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterSameSubnetDelay = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "same_subnet_delay_seconds"), "Controls how long the cluster network driver waits in seconds between sending Cluster Service heartbeats on the same subnet.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterSameSubnetThreshold = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "same_subnet_threshold"), "Controls how many Cluster Service heartbeats can be missed on the same subnet before it determines that Cluster Service has stopped responding.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterSecurityLevel = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "security_level"), "Controls the level of security that should apply to intracluster messages. 0: Clear Text; 1: Sign; 2: Encrypt ", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterSecurityLevelForStorage = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "security_level_for_storage"), "(SecurityLevelForStorage)", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterSharedVolumeVssWriterOperationTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "shared_volume_vss_writer_operation_timeout_seconds"), "CSV VSS Writer operation timeout in seconds.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterShutdownTimeoutInMinutes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "shutdown_timeout_seconds"), "The maximum time in seconds allowed for cluster resources to come offline during cluster service shutdown.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterUseClientAccessNetworksForSharedVolumes = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "use_client_access_networks_for_shared_volumes"), "Whether the use of client access networks for cluster shared volumes feature of this cluster is enabled. 0: Disabled; 1: Enabled; 2: Auto", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterWitnessDatabaseWriteTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "witness_database_write_timeout_seconds"), "Controls the maximum time in seconds that a cluster database write to a witness can take before the write is abandoned.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterWitnessDynamicWeight = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "witness_dynamic_weight"), "The weight of the configured witness.", - []string{"name"}, + []string{"cluster"}, nil, ) c.clusterWitnessRestartInterval = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameCluster, "witness_restart_interval_seconds"), "Controls the witness restart interval in seconds.", - []string{"name"}, + []string{"cluster"}, nil, ) } diff --git a/internal/collector/mscluster/mscluster_cluster_native_test.go b/internal/collector/mscluster/mscluster_cluster_native_test.go index 0e76b44c..75ade95b 100644 --- a/internal/collector/mscluster/mscluster_cluster_native_test.go +++ b/internal/collector/mscluster/mscluster_cluster_native_test.go @@ -111,7 +111,7 @@ func TestClusterNativeMetricContract(t *testing.T) { t.Fatalf("invalid family %s", name) } - if !maps.Equal(metricLabels(family.GetMetric()[0]), map[string]string{"name": "CICluster"}) { + if !maps.Equal(metricLabels(family.GetMetric()[0]), map[string]string{"cluster": "CICluster"}) { t.Fatalf("%s labels = %v", name, metricLabels(family.GetMetric()[0])) } } diff --git a/internal/collector/mscluster/mscluster_network.go b/internal/collector/mscluster/mscluster_network.go index 41bbc578..08757c42 100644 --- a/internal/collector/mscluster/mscluster_network.go +++ b/internal/collector/mscluster/mscluster_network.go @@ -75,31 +75,31 @@ func (c *Collector) buildNetworkDescriptors() { c.networkCharacteristics = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNetwork, "characteristics"), "Provides the characteristics of the network.", - []string{"name"}, + []string{"network"}, nil, ) c.networkFlags = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNetwork, "flags"), "Provides access to the flags set for the node. ", - []string{"name"}, + []string{"network"}, nil, ) c.networkMetric = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNetwork, "metric"), "The metric of a cluster network (networks with lower values are used first). If this value is set, then the AutoMetric property is set to false.", - []string{"name"}, + []string{"network"}, nil, ) c.networkRole = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNetwork, "role"), "Provides access to the network's Role property. The Role property describes the role of the network in the cluster. 0: None; 1: Cluster; 2: Client; 3: Both ", - []string{"name"}, + []string{"network"}, nil, ) c.networkState = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNetwork, "state"), "Provides the current state of the network. 1-1: Unknown; 0: Unavailable; 1: Down; 2: Partitioned; 3: Up", - []string{"name"}, + []string{"network"}, nil, ) } diff --git a/internal/collector/mscluster/mscluster_network_native_test.go b/internal/collector/mscluster/mscluster_network_native_test.go index 29d133dd..ebe784fb 100644 --- a/internal/collector/mscluster/mscluster_network_native_test.go +++ b/internal/collector/mscluster/mscluster_network_native_test.go @@ -71,7 +71,7 @@ func TestNetworkNativeMetricContract(t *testing.T) { t.Errorf("%s value = %v, want %v", suffix, metric.GetGauge().GetValue(), value) } - if !maps.Equal(metricLabels(metric), map[string]string{"name": "Cluster Network 1"}) { + if !maps.Equal(metricLabels(metric), map[string]string{"network": "Cluster Network 1"}) { t.Fatalf("labels = %v", metricLabels(metric)) } } diff --git a/internal/collector/mscluster/mscluster_node.go b/internal/collector/mscluster/mscluster_node.go index eea41cd5..d3a616c6 100644 --- a/internal/collector/mscluster/mscluster_node.go +++ b/internal/collector/mscluster/mscluster_node.go @@ -94,85 +94,85 @@ func (c *Collector) buildNodeDescriptors() { c.nodeBuildNumber = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "build_number"), "Provides access to the node's BuildNumber property.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeCharacteristics = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "characteristics"), "Provides access to the characteristics set for the node.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeDetectedCloudPlatform = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "detected_cloud_platform"), "(DetectedCloudPlatform)", - []string{"name"}, + []string{"node"}, nil, ) c.nodeDynamicWeight = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "dynamic_weight"), "The dynamic vote weight of the node adjusted by dynamic quorum feature.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeFlags = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "flags"), "Provides access to the flags set for the node.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeMajorVersion = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "major_version"), "Provides access to the node's MajorVersion property, which specifies the major portion of the Windows version installed.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeMinorVersion = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "minor_version"), "Provides access to the node's MinorVersion property, which specifies the minor portion of the Windows version installed.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeNeedsPreventQuorum = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "needs_prevent_quorum"), "Whether the cluster service on that node should be started with prevent quorum flag.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeNodeDrainStatus = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "node_drain_status"), "The current node drain status of a node. 0: Not Initiated; 1: In Progress; 2: Completed; 3: Failed", - []string{"name"}, + []string{"node"}, nil, ) c.nodeNodeHighestVersion = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "node_highest_version"), "Provides access to the node's NodeHighestVersion property, which specifies the highest possible version of the cluster service with which the node can join or communicate.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeNodeLowestVersion = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "node_lowest_version"), "Provides access to the node's NodeLowestVersion property, which specifies the lowest possible version of the cluster service with which the node can join or communicate.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeNodeWeight = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "node_weight"), "The vote weight of the node.", - []string{"name"}, + []string{"node"}, nil, ) c.nodeState = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "state"), "Returns the current state of a node. -1: Unknown; 0: Up; 1: Down; 2: Paused; 3: Joining", - []string{"name"}, + []string{"node"}, nil, ) c.nodeStatusInformation = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameNode, "status_information"), "The isolation or quarantine status of the node.", - []string{"name"}, + []string{"node"}, nil, ) } diff --git a/internal/collector/mscluster/mscluster_node_native_test.go b/internal/collector/mscluster/mscluster_node_native_test.go index a3464b22..f6db4f63 100644 --- a/internal/collector/mscluster/mscluster_node_native_test.go +++ b/internal/collector/mscluster/mscluster_node_native_test.go @@ -87,7 +87,7 @@ func TestNodeNativeMetricContract(t *testing.T) { t.Errorf("%s value = %v, want %v", suffix, metric.GetGauge().GetValue(), value) } - if !maps.Equal(metricLabels(metric), map[string]string{"name": "nodeA"}) { + if !maps.Equal(metricLabels(metric), map[string]string{"node": "nodeA"}) { t.Fatalf("labels = %v", metricLabels(metric)) } } @@ -178,7 +178,7 @@ func TestNodeNamesFeedOwnerMetrics(t *testing.T) { for _, metric := range owners.GetMetric() { want := 0.0 - if metricLabels(metric)["node_name"] == "nodeB" { + if metricLabels(metric)["node"] == "nodeB" { want = 1 } diff --git a/internal/collector/mscluster/mscluster_resource.go b/internal/collector/mscluster/mscluster_resource.go index 3eebc208..c8f77118 100644 --- a/internal/collector/mscluster/mscluster_resource.go +++ b/internal/collector/mscluster/mscluster_resource.go @@ -106,109 +106,109 @@ func (c *Collector) buildResourceDescriptors() { c.resourceCharacteristics = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "characteristics"), "Provides the characteristics of the object.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceDeadlockTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "deadlock_timeout_seconds"), "Indicates the length of time to wait, in seconds, before declaring a deadlock in any call into a resource.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceEmbeddedFailureAction = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "embedded_failure_action"), "The time, in milliseconds, that a resource should remain in a failed state before the Cluster service attempts to restart it.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceFlags = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "flags"), "Provides access to the flags set for the object.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceIsAlivePollInterval = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "is_alive_poll_interval_seconds"), "Provides access to the resource's IsAlivePollInterval property, which is the recommended interval in seconds at which the Cluster Service should poll the resource to determine whether it is operational. The series is omitted while the resource uses the interval of its resource type (0xFFFFFFFF).", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceLooksAlivePollInterval = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "looks_alive_poll_interval_seconds"), "Provides access to the resource's LooksAlivePollInterval property, which is the recommended interval in seconds at which the Cluster Service should poll the resource to determine whether it appears operational. The series is omitted while the resource uses the interval of its resource type (0xFFFFFFFF).", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceMonitorProcessId = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "monitor_process_id"), "Provides the process ID of the resource host service that is currently hosting the resource.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceOwnerNode = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "owner_node"), "The node hosting the resource. 0: Not hosted; 1: Hosted", - []string{"type", "owner_group", "node_name", "name"}, + []string{"type", "resource_group", "node", "resource"}, nil, ) c.resourceOwnerNode = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "owner_node"), "The node hosting the resource. 0: Not hosted; 1: Hosted", - []string{"type", "owner_group", "node_name", "name"}, + []string{"type", "resource_group", "node", "resource"}, nil, ) c.resourcePendingTimeout = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "pending_timeout_seconds"), "Provides access to the resource's PendingTimeout property. If a resource cannot be brought online or taken offline in the number of seconds specified by the PendingTimeout property, the resource is forcibly terminated.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceResourceClass = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "resource_class"), "Gets or sets the resource class of a resource. 0: Unknown; 1: Storage; 2: Network; 32768: Unknown ", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceRestartAction = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "restart_action"), "Provides access to the resource's RestartAction property, which is the action to be taken by the Cluster Service if the resource fails.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceRestartDelay = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "restart_delay_seconds"), "Indicates the time delay in seconds before a failed resource is restarted.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceRestartPeriod = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "restart_period_seconds"), "Provides access to the resource's RestartPeriod property, which is interval of time, in seconds, during which a specified number of restart attempts can be made on a nonresponsive resource.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceRestartThreshold = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "restart_threshold"), "Provides access to the resource's RestartThreshold property which is the maximum number of restart attempts that can be made on a resource within an interval defined by the RestartPeriod property before the Cluster Service initiates the action specified by the RestartAction property.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceRetryPeriodOnFailure = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "retry_period_on_failure_seconds"), "Provides access to the resource's RetryPeriodOnFailure property, which is the interval of time (in seconds) that a resource should remain in a failed state before the Cluster service attempts to restart it.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceState = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "state"), "The current state of the resource. -1: Unknown; 0: Inherited; 1: Initializing; 2: Online; 3: Offline; 4: Failed; 128: Pending; 129: Online Pending; 130: Offline Pending ", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) c.resourceSubClass = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResource, "subclass"), "Provides the list of references to nodes that can be the owner of this resource.", - []string{"type", "owner_group", "name"}, + []string{"type", "resource_group", "resource"}, nil, ) } diff --git a/internal/collector/mscluster/mscluster_resource_native_test.go b/internal/collector/mscluster/mscluster_resource_native_test.go index 43cab7c9..14cefc52 100644 --- a/internal/collector/mscluster/mscluster_resource_native_test.go +++ b/internal/collector/mscluster/mscluster_resource_native_test.go @@ -158,7 +158,7 @@ func TestResourceNativeMetricContract(t *testing.T) { t.Errorf("%s value = %v, want %v", suffix, metric.GetGauge().GetValue(), value) } - if !maps.Equal(metricLabels(metric), map[string]string{"type": "Physical Disk", "owner_group": "Cluster Group", "name": "Disk"}) { + if !maps.Equal(metricLabels(metric), map[string]string{"type": "Physical Disk", "resource_group": "Cluster Group", "resource": "Disk"}) { t.Fatalf("labels = %v", metricLabels(metric)) } } @@ -172,7 +172,7 @@ func TestResourceNativeMetricContract(t *testing.T) { labels := metricLabels(metric) value := 0.0 - if labels["node_name"] == "nodeB" { + if labels["node"] == "nodeB" { value = 1 } @@ -180,7 +180,7 @@ func TestResourceNativeMetricContract(t *testing.T) { t.Fatal("invalid owner value") } - if !maps.Equal(labels, map[string]string{"type": "Physical Disk", "owner_group": "Cluster Group", "name": "Disk", "node_name": labels["node_name"]}) { + if !maps.Equal(labels, map[string]string{"type": "Physical Disk", "resource_group": "Cluster Group", "resource": "Disk", "node": labels["node"]}) { t.Fatal("invalid owner labels") } } @@ -206,7 +206,7 @@ func TestResourcePartialResultsAndJoinedErrors(t *testing.T) { for _, family := range families { for _, metric := range family.GetMetric() { - if metricLabels(metric)["name"] != "Disk" { + if metricLabels(metric)["resource"] != "Disk" { t.Fatal("published invalid identity") } } @@ -372,7 +372,7 @@ func TestResourceMetricCache(t *testing.T) { } for _, metric := range families["windows_mscluster_resource_owner_node"].GetMetric() { - if hosted := metricLabels(metric)["node_name"] == "nodeC"; (metric.GetGauge().GetValue() == 1) != hosted { + if hosted := metricLabels(metric)["node"] == "nodeC"; (metric.GetGauge().GetValue() == 1) != hosted { t.Fatal("reused the owner node of a changed resource") } } diff --git a/internal/collector/mscluster/mscluster_resourcegroup.go b/internal/collector/mscluster/mscluster_resourcegroup.go index be47d792..75fd7aac 100644 --- a/internal/collector/mscluster/mscluster_resourcegroup.go +++ b/internal/collector/mscluster/mscluster_resourcegroup.go @@ -94,85 +94,85 @@ func (c *Collector) buildResourceGroupDescriptors() { c.resourceGroupAutoFailbackType = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "auto_failback_type"), "Provides access to the group's AutoFailbackType property.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupCharacteristics = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "characteristics"), "Provides the characteristics of the group.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupColdStartSetting = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "cold_start_setting"), "Indicates whether a group can start after a cluster cold start.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupDefaultOwner = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "default_owner"), "Number of the last node the resource group was activated on or explicitly moved to.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupFailbackWindowEnd = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "failback_window_end"), "The FailbackWindowEnd property provides the latest time that the group can be moved back to the node identified as its preferred node.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupFailbackWindowStart = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "failback_window_start"), "The FailbackWindowStart property provides the earliest time (that is, local time as kept by the cluster) that the group can be moved back to the node identified as its preferred node.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupFailOverPeriod = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "failover_period_seconds"), "The FailoverPeriod property specifies a number of seconds during which a maximum number of failover attempts, specified by the FailoverThreshold property, can occur. Windows stores it in hours.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupFailOverThreshold = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "failover_threshold"), "The FailoverThreshold property specifies the maximum number of failover attempts.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupFlags = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "flags"), "Provides access to the flags set for the group. ", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupGroupType = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "group_type"), "The Type of the resource group.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupOwnerNode = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "owner_node"), "The node hosting the resource group. 0: Not hosted; 1: Hosted", - []string{"node_name", "name"}, + []string{"node", "resource_group"}, nil, ) c.resourceGroupPriority = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "priority"), "Priority value of the resource group", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupResiliencyPeriod = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "resiliency_period_seconds"), "The resiliency period for this group, in seconds.", - []string{"name"}, + []string{"resource_group"}, nil, ) c.resourceGroupState = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameResourceGroup, "state"), "The current state of the resource group. -1: Unknown; 0: Online; 1: Offline; 2: Failed; 3: Partial Online; 4: Pending", - []string{"name"}, + []string{"resource_group"}, nil, ) } diff --git a/internal/collector/mscluster/mscluster_resourcegroup_native_test.go b/internal/collector/mscluster/mscluster_resourcegroup_native_test.go index 296404e5..a40b0084 100644 --- a/internal/collector/mscluster/mscluster_resourcegroup_native_test.go +++ b/internal/collector/mscluster/mscluster_resourcegroup_native_test.go @@ -153,7 +153,7 @@ func TestResourceGroupNativeMetricContract(t *testing.T) { t.Errorf("%s value = %v, want %v", suffix, metric.GetGauge().GetValue(), value) } - if !maps.Equal(metricLabels(metric), map[string]string{"name": "Cluster Group"}) { + if !maps.Equal(metricLabels(metric), map[string]string{"resource_group": "Cluster Group"}) { t.Fatalf("labels = %v", metricLabels(metric)) } } @@ -167,7 +167,7 @@ func TestResourceGroupNativeMetricContract(t *testing.T) { labels := metricLabels(metric) value := 0.0 - if labels["node_name"] == "nodeB" { + if labels["node"] == "nodeB" { value = 1 } @@ -175,7 +175,7 @@ func TestResourceGroupNativeMetricContract(t *testing.T) { t.Fatal("invalid owner value") } - if !maps.Equal(labels, map[string]string{"name": "Cluster Group", "node_name": labels["node_name"]}) { + if !maps.Equal(labels, map[string]string{"resource_group": "Cluster Group", "node": labels["node"]}) { t.Fatalf("invalid owner labels: %v", labels) } } @@ -206,7 +206,7 @@ func TestResourceGroupPartialResultsAndJoinedErrors(t *testing.T) { for _, family := range families { for _, metric := range family.GetMetric() { - if metricLabels(metric)["name"] != "Cluster Group" { + if metricLabels(metric)["resource_group"] != "Cluster Group" { t.Fatal("published invalid identity") } } diff --git a/internal/collector/mscluster/mscluster_shared_volumes.go b/internal/collector/mscluster/mscluster_shared_volumes.go index abde4fcc..dd2b9f62 100644 --- a/internal/collector/mscluster/mscluster_shared_volumes.go +++ b/internal/collector/mscluster/mscluster_shared_volumes.go @@ -71,21 +71,21 @@ func (c *Collector) buildSharedVolumesDescriptors() { c.sharedVolumesInfo = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameSharedVolumes, "info"), "Cluster Shared Volumes information (value is always 1)", - []string{"name", "path", "volume_guid"}, + []string{"shared_volume", "path", "volume_guid"}, nil, ) c.sharedVolumesTotalSize = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameSharedVolumes, "total_bytes"), "Total size of the Cluster Shared Volume in bytes", - []string{"name", "volume_guid"}, + []string{"shared_volume", "volume_guid"}, nil, ) c.sharedVolumesFreeSpace = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameSharedVolumes, "free_bytes"), "Free space on the Cluster Shared Volume in bytes", - []string{"name", "volume_guid"}, + []string{"shared_volume", "volume_guid"}, nil, ) } diff --git a/internal/collector/mscluster/mscluster_shared_volumes_native_test.go b/internal/collector/mscluster/mscluster_shared_volumes_native_test.go index 07bce4fe..cb606f3d 100644 --- a/internal/collector/mscluster/mscluster_shared_volumes_native_test.go +++ b/internal/collector/mscluster/mscluster_shared_volumes_native_test.go @@ -86,7 +86,7 @@ func TestSharedVolumesNativeMetricContract(t *testing.T) { t.Fatalf("families = %d", len(families)) } - labels := map[string]string{"name": "ClusterPerformanceHistory", "volume_guid": "d3dbada3-448f-4c4c-be4d-122b7f296007"} + labels := map[string]string{"shared_volume": "ClusterPerformanceHistory", "volume_guid": "d3dbada3-448f-4c4c-be4d-122b7f296007"} for name, want := range map[string]float64{"total_bytes": 21474836480, "free_bytes": 1.9008585728e+10} { family := families["windows_mscluster_shared_volumes_"+name] @@ -105,7 +105,7 @@ func TestSharedVolumesNativeMetricContract(t *testing.T) { } info := families["windows_mscluster_shared_volumes_info"].GetMetric()[0] - if info.GetGauge().GetValue() != 1 || !maps.Equal(metricLabels(info), map[string]string{"name": "ClusterPerformanceHistory", "path": `C:\ClusterStorage\Volume1`, "volume_guid": "d3dbada3-448f-4c4c-be4d-122b7f296007"}) { + if info.GetGauge().GetValue() != 1 || !maps.Equal(metricLabels(info), map[string]string{"shared_volume": "ClusterPerformanceHistory", "path": `C:\ClusterStorage\Volume1`, "volume_guid": "d3dbada3-448f-4c4c-be4d-122b7f296007"}) { t.Fatalf("info = %v", metricLabels(info)) } } diff --git a/internal/collector/mscluster/mscluster_test.go b/internal/collector/mscluster/mscluster_test.go index 5f7314ed..7e2a0487 100644 --- a/internal/collector/mscluster/mscluster_test.go +++ b/internal/collector/mscluster/mscluster_test.go @@ -39,7 +39,7 @@ func TestCollector(t *testing.T) { "CI Offline IP Address": 3, // Offline "CI Failed Service": 4, // Failed } { - metric := testutils.RequireFixtureMetric(t, metrics, mscluster.Name, "windows_mscluster_resource_state", prometheus.Labels{"name": name}) + metric := testutils.RequireFixtureMetric(t, metrics, mscluster.Name, "windows_mscluster_resource_state", prometheus.Labels{"resource": name}) if metric != nil && metric.GetGauge().GetValue() != state { t.Errorf("resource %q state = %v, want %v", name, metric.GetGauge().GetValue(), state) } diff --git a/internal/collector/msmq/AGENTS.md b/internal/collector/msmq/AGENTS.md index 675c5743..2299c7e4 100644 --- a/internal/collector/msmq/AGENTS.md +++ b/internal/collector/msmq/AGENTS.md @@ -12,7 +12,7 @@ installed. It is multi-instance. These notes were recorded on Windows Server `\private$\` in lower case. A fresh install already has the internal queues `server2025\private$\admin_queue$` and `server2025\private$\order_queue$`. The collector uses the instance name - unchanged as the `name` label. + unchanged as the `queue` label. - For `Computer Queues`, `Messages/Bytes in Queue` is the dead-letter queue and `Messages/Bytes in Journal Queue` is the computer journal. - All values were 0 on the recording host. diff --git a/internal/collector/msmq/msmq.go b/internal/collector/msmq/msmq.go index 08f63805..cf803ecd 100644 --- a/internal/collector/msmq/msmq.go +++ b/internal/collector/msmq/msmq.go @@ -82,25 +82,25 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { c.bytesInJournalQueue = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "journal_queue_bytes"), "Size of queue journal in bytes", - []string{"name"}, + []string{"queue"}, nil, ) c.bytesInQueue = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "queue_bytes"), "Size of queue in bytes", - []string{"name"}, + []string{"queue"}, nil, ) c.messagesInJournalQueue = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "messages_in_journal_queue"), "Count messages in queue journal", - []string{"name"}, + []string{"queue"}, nil, ) c.messagesInQueue = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "messages_in_queue"), "Count messages in queue", - []string{"name"}, + []string{"queue"}, nil, ) diff --git a/internal/collector/performancecounter/performancecounter.go b/internal/collector/performancecounter/performancecounter.go index d5b65443..1aa8c473 100644 --- a/internal/collector/performancecounter/performancecounter.go +++ b/internal/collector/performancecounter/performancecounter.go @@ -207,7 +207,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { } if object.InstanceLabel == "" { - object.InstanceLabel = "instance" + object.InstanceLabel = "object_instance" } object.collector = collector diff --git a/internal/collector/performancecounter/performancecounter_test_test.go b/internal/collector/performancecounter/performancecounter_test_test.go index ab0a8e76..ec1b54a4 100644 --- a/internal/collector/performancecounter/performancecounter_test_test.go +++ b/internal/collector/performancecounter/performancecounter_test_test.go @@ -93,7 +93,7 @@ windows_performancecounter_collector_duration_seconds\{collector="process"} [0-9 windows_performancecounter_collector_success\{collector="process"} 1 # HELP windows_performancecounter_process_thread_count windows_exporter: custom Performance Counter metric # TYPE windows_performancecounter_process_thread_count counter -windows_performancecounter_process_thread_count\{instance=".+"} [0-9.e+-]+ +windows_performancecounter_process_thread_count\{object_instance=".+"} [0-9.e+-]+ .*`), }, { @@ -373,7 +373,7 @@ func TestCollectorDuplicateInstances(t *testing.T) { for _, metric := range family.GetMetric() { for _, label := range metric.GetLabel() { - if label.GetName() == "instance" { + if label.GetName() == "object_instance" { instances[label.GetValue()] = true } } diff --git a/internal/collector/registry/registry.go b/internal/collector/registry/registry.go index 2d53eb97..b1fd99a7 100644 --- a/internal/collector/registry/registry.go +++ b/internal/collector/registry/registry.go @@ -125,7 +125,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { c.keySuccessDesc = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "key_success"), "Whether the registry key could be read successfully.", - []string{"name"}, + []string{"key"}, nil, ) diff --git a/internal/collector/registry/registry_output_test.go b/internal/collector/registry/registry_output_test.go index 82c39ff1..f59d9abb 100644 --- a/internal/collector/registry/registry_output_test.go +++ b/internal/collector/registry/registry_output_test.go @@ -132,8 +132,8 @@ func TestCollectorMetrics(t *testing.T) { // precedes "testgroup" (1). expected := `# HELP windows_registry_key_success Whether the registry key could be read successfully. # TYPE windows_registry_key_success gauge -windows_registry_key_success{name="missing_group"} 0 -windows_registry_key_success{name="testgroup"} 1 +windows_registry_key_success{key="missing_group"} 0 +windows_registry_key_success{key="testgroup"} 1 # HELP windows_registry_test_custom_metric custom registry help text # TYPE windows_registry_test_custom_metric counter windows_registry_test_custom_metric{foo="bar"} 5e+09 diff --git a/internal/collector/service/service.go b/internal/collector/service/service.go index f5304fa6..ccfce198 100644 --- a/internal/collector/service/service.go +++ b/internal/collector/service/service.go @@ -196,25 +196,25 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { c.info = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "info"), "A metric with a constant '1' value labeled with service information", - []string{"name", "display_name", "run_as", "path_name"}, + []string{"service", "display_name", "run_as", "path_name"}, nil, ) c.state = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "state"), "The state of the service (State)", - []string{"name", "state"}, + []string{"service", "state"}, nil, ) c.startMode = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "start_mode"), "The start mode of the service (StartMode)", - []string{"name", "start_mode"}, + []string{"service", "start_mode"}, nil, ) c.processID = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "process"), "Process of started service. The value is the creation time of the process as a unix timestamp.", - []string{"name", "process_id"}, + []string{"service", "process_id"}, nil, ) diff --git a/internal/collector/service/service_internal_test.go b/internal/collector/service/service_internal_test.go index 6833b74f..8e91185e 100644 --- a/internal/collector/service/service_internal_test.go +++ b/internal/collector/service/service_internal_test.go @@ -80,7 +80,7 @@ func serviceMetrics(t assert.TestingT, c *Collector, name string) map[string]flo ) for _, label := range metric.GetLabel() { - if label.GetName() == "name" { + if label.GetName() == "service" { matches = label.GetValue() == name continue diff --git a/internal/collector/storage_spaces/storage_spaces_pool.go b/internal/collector/storage_spaces/storage_spaces_pool.go index c8718f5f..ce622a80 100644 --- a/internal/collector/storage_spaces/storage_spaces_pool.go +++ b/internal/collector/storage_spaces/storage_spaces_pool.go @@ -66,42 +66,42 @@ func (c *Collector) buildStoragePool() error { c.storagePoolInfo = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameStoragePool, "info"), "Storage pool information (value is always 1). primordial is true for the built-in primordial pool", - []string{"name", "unique_id", "primordial"}, + []string{"pool", "unique_id", "primordial"}, nil, ) c.storagePoolHealthStatus = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameStoragePool, "health_status"), "Health status of the storage pool. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown", - []string{"name", "unique_id"}, + []string{"pool", "unique_id"}, nil, ) c.storagePoolSize = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameStoragePool, "size_bytes"), "Total size of the storage pool in bytes", - []string{"name", "unique_id"}, + []string{"pool", "unique_id"}, nil, ) c.storagePoolAllocatedSize = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameStoragePool, "allocated_size_bytes"), "Allocated size of the storage pool in bytes", - []string{"name", "unique_id"}, + []string{"pool", "unique_id"}, nil, ) c.storagePoolOperationalStatus = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameStoragePool, "operational_status"), "Operational status codes reported for the storage pool (one series per status value)", - []string{"name", "unique_id", "status"}, + []string{"pool", "unique_id", "status"}, nil, ) c.storagePoolThinProvisioningAlertThresholds = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameStoragePool, "thin_provisioning_alert_thresholds"), "Thin provisioning alert thresholds configured for the storage pool, in percent (one series per configured threshold)", - []string{"name", "unique_id", "threshold"}, + []string{"pool", "unique_id", "threshold"}, nil, ) diff --git a/internal/collector/storage_spaces/storage_spaces_test.go b/internal/collector/storage_spaces/storage_spaces_test.go index bacf4575..0ab8834a 100644 --- a/internal/collector/storage_spaces/storage_spaces_test.go +++ b/internal/collector/storage_spaces/storage_spaces_test.go @@ -33,10 +33,10 @@ func BenchmarkCollector(b *testing.B) { func TestCollector(t *testing.T) { metrics := testutils.TestCollector(t, storage_spaces.New, nil) - pool := prometheus.Labels{"name": "GitHubActions"} - virtualDisk := prometheus.Labels{"name": "CIVirtualDisk"} + pool := prometheus.Labels{"pool": "GitHubActions"} + virtualDisk := prometheus.Labels{"virtual_disk": "CIVirtualDisk"} - testutils.RequireFixtureMetric(t, metrics, storage_spaces.Name, "windows_storage_spaces_pool_info", prometheus.Labels{"name": "GitHubActions", "primordial": "false"}) + testutils.RequireFixtureMetric(t, metrics, storage_spaces.Name, "windows_storage_spaces_pool_info", prometheus.Labels{"pool": "GitHubActions", "primordial": "false"}) testutils.RequireFixtureMetric(t, metrics, storage_spaces.Name, "windows_storage_spaces_virtual_disk_info", virtualDisk) for _, tc := range []struct { diff --git a/internal/collector/storage_spaces/storage_spaces_virtual_disk.go b/internal/collector/storage_spaces/storage_spaces_virtual_disk.go index 09cb06ee..e4ba5fe8 100644 --- a/internal/collector/storage_spaces/storage_spaces_virtual_disk.go +++ b/internal/collector/storage_spaces/storage_spaces_virtual_disk.go @@ -63,42 +63,42 @@ func (c *Collector) buildVirtualDisk() error { c.virtualDiskInfo = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameVirtualDisk, "info"), "Virtual disk information (value is always 1)", - []string{"name", "unique_id"}, + []string{"virtual_disk", "unique_id"}, nil, ) c.virtualDiskHealthStatus = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameVirtualDisk, "health_status"), "Health status of the virtual disk. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown", - []string{"name", "unique_id"}, + []string{"virtual_disk", "unique_id"}, nil, ) c.virtualDiskSize = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameVirtualDisk, "size_bytes"), "Total size of the virtual disk in bytes", - []string{"name", "unique_id"}, + []string{"virtual_disk", "unique_id"}, nil, ) c.virtualDiskAllocatedSize = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameVirtualDisk, "allocated_size_bytes"), "Allocated size of the virtual disk in bytes (capacity actually provisioned, excludes thin-provisioned unused capacity)", - []string{"name", "unique_id"}, + []string{"virtual_disk", "unique_id"}, nil, ) c.virtualDiskFootprintOnPool = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameVirtualDisk, "footprint_on_pool_bytes"), "Physical storage consumed by the virtual disk on the storage pool in bytes", - []string{"name", "unique_id"}, + []string{"virtual_disk", "unique_id"}, nil, ) c.virtualDiskStorageEfficiency = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, nameVirtualDisk, "storage_efficiency_ratio"), "Storage efficiency ratio (AllocatedSize / FootprintOnPool), omitted while FootprintOnPool is 0", - []string{"name", "unique_id"}, + []string{"virtual_disk", "unique_id"}, nil, ) diff --git a/internal/collector/wmi/wmi.go b/internal/collector/wmi/wmi.go index 0425db74..c59a0766 100644 --- a/internal/collector/wmi/wmi.go +++ b/internal/collector/wmi/wmi.go @@ -163,13 +163,13 @@ func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error { c.querySuccessDesc = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "query_success"), "Whether the WMI query and all of its configured properties could be read successfully.", - []string{"name"}, + []string{"query"}, nil, ) c.queryDurationDesc = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "query_duration_seconds"), "Duration of the WMI query.", - []string{"name"}, + []string{"query"}, nil, ) diff --git a/internal/collector/wmi/wmi_output_test.go b/internal/collector/wmi/wmi_output_test.go index 3c48dfe3..37818ba8 100644 --- a/internal/collector/wmi/wmi_output_test.go +++ b/internal/collector/wmi/wmi_output_test.go @@ -201,13 +201,13 @@ windows_wmi_os_primary 1 windows_wmi_partial_primary 1 # HELP windows_wmi_query_success Whether the WMI query and all of its configured properties could be read successfully. # TYPE windows_wmi_query_success gauge -windows_wmi_query_success{name="kernel"} 1 -windows_wmi_query_success{name="missing_class"} 0 -windows_wmi_query_success{name="os"} 1 -windows_wmi_query_success{name="partial"} 0 -windows_wmi_query_success{name="shared_a"} 1 -windows_wmi_query_success{name="shared_b"} 1 -windows_wmi_query_success{name="unsupported_label"} 0 +windows_wmi_query_success{query="kernel"} 1 +windows_wmi_query_success{query="missing_class"} 0 +windows_wmi_query_success{query="os"} 1 +windows_wmi_query_success{query="partial"} 0 +windows_wmi_query_success{query="shared_a"} 1 +windows_wmi_query_success{query="shared_b"} 1 +windows_wmi_query_success{query="unsupported_label"} 0 # HELP windows_wmi_test_parent_pid custom wmi help text # TYPE windows_wmi_test_parent_pid counter windows_wmi_test_parent_pid{foo="bar",handle="0",path="",pid="0",process="System Idle Process"} 0 @@ -233,7 +233,7 @@ windows_wmi_test_shared{query="b"} 1 require.Equal(t, expected, strings.Join(lines, "\n")) for _, name := range []string{"kernel", "missing_class", "os", "partial", "shared_a", "shared_b", "unsupported_label"} { - require.Regexp(t, `(?m)^windows_wmi_query_duration_seconds\{name="`+name+`"\} \d`, got) + require.Regexp(t, `(?m)^windows_wmi_query_duration_seconds\{query="`+name+`"\} \d`, got) } } } @@ -302,8 +302,8 @@ func TestCollectScrapeTimeout(t *testing.T) { got := scrapeWithTimeout(t, c, time.Nanosecond) - require.Contains(t, got, `windows_wmi_query_success{name="a"} 0`) - require.Contains(t, got, `windows_wmi_query_success{name="b"} 0`) + require.Contains(t, got, `windows_wmi_query_success{query="a"} 0`) + require.Contains(t, got, `windows_wmi_query_success{query="b"} 0`) require.NotContains(t, got, "windows_wmi_a_primary") require.NotContains(t, got, "windows_wmi_b_primary") diff --git a/internal/metriccontract/compatibility_rules_test.go b/internal/metriccontract/compatibility_rules_test.go new file mode 100644 index 00000000..9204c3bf --- /dev/null +++ b/internal/metriccontract/compatibility_rules_test.go @@ -0,0 +1,325 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metriccontract_test + +import ( + "fmt" + "os" + "path/filepath" + "regexp" + "slices" + "strings" + "testing" + + "github.com/stretchr/testify/require" +) + +// compatibilityRulesFile holds recording rules that publish the metrics of +// 0.32 under their 0.31 names and labels. It is generated from the rename +// tables of UPGRADE.md; set UPDATE_COMPATIBILITY_RULES=1 to regenerate it. +const compatibilityRulesFile = "docs/example-0.32-compatibility-rules-new-to-old.yml" + +// renameRow matches a row of a rename table in UPGRADE.md: the 0.31 name, the +// 0.32 name and a note. +var renameRow = regexp.MustCompile("^\\|\\s*`(windows_[A-Za-z0-9_]+)`\\s*\\|\\s*`(windows_[A-Za-z0-9_]+)`\\s*\\|\\s*(.*?)\\s*\\|\\s*$") + +// labelRow matches a row of the instance label table in UPGRADE.md. +var labelRow = regexp.MustCompile("^\\|\\s*`([a-z_]+)`\\s*\\|([^|]*)\\|([^|]*)\\|([^|]*)\\|\\s*$") + +var backticked = regexp.MustCompile("`([^`]+)`") + +// conversion turns the value of a 0.32 metric back into its 0.31 value. +type conversion struct { + // match is a lowercase part of the note of a rename. + match string + // expr formats the 0.31 value of the metric %s. + expr string +} + +// conversions are tried in order. The first match wins. +// +//nolint:gochecknoglobals +var conversions = []conversion{ + {"seconds instead of milliseconds", "%s * 1000"}, + {"now in seconds, was milliseconds", "%s * 1000"}, + {"seconds instead of microseconds", "%s * 1e6"}, + {"seconds instead of minutes", "%s / 60"}, + {"seconds instead of hours", "%s / 3600"}, + {"bytes instead of kilobytes", "%s / 1024"}, + {"was kilobytes, now bytes", "%s / 1024"}, + {"bytes instead of megabytes", "%s / 1048576"}, + {"hertz instead of megahertz", "%s / 1e6"}, + {"instead of percent", "%s * 100"}, + {"instead of parts per billion", "%s * 1e9"}, + {"instead of the per-minute value", "%s * 3600"}, + {"same value", "%s"}, + {"unit suffix added", "%s"}, + {"now a counter", "%s"}, + {"now a gauge", "%s"}, + {"was a running count", "%s"}, +} + +// unconvertible are lowercase parts of notes whose 0.31 value can't be +// computed from the 0.32 metric. They are checked before conversions. +// +//nolint:gochecknoglobals +var unconvertible = []string{ + "removed", + "see [", + "see below", + "0.31 divided", + "raw millisecond", + "divide its `rate()` by that", + "label `", +} + +type labelRename struct { + metrics *regexp.Regexp + // prefix is the longest literal prefix of the metric names, which + // decides between overlapping rows like windows_mscluster_resource_* and + // windows_mscluster_resourcegroup_*. + prefix string + old []string + new []string +} + +// labelRenameOf returns the most specific label rename of the metric name. +func labelRenameOf(renames []labelRename, name string) (labelRename, bool) { + var ( + best labelRename + found bool + ) + + for _, rename := range renames { + if rename.metrics.MatchString(name) && (!found || len(rename.prefix) > len(best.prefix)) { + best, found = rename, true + } + } + + return best, found +} + +type compatibilityRule struct { + record string + expr string +} + +// TestCompatibilityRules checks that the compatibility recording rules are +// generated from the current UPGRADE.md, read only metrics the exporter +// emits and record no name it emits itself. +func TestCompatibilityRules(t *testing.T) { + t.Parallel() + + upgrade, err := os.ReadFile(filepath.Join(repoRoot, "UPGRADE.md")) + require.NoError(t, err) + + rules := compatibilityRules(t, strings.Split(strings.ReplaceAll(string(upgrade), "\r\n", "\n"), "\n")) + require.NotEmpty(t, rules) + + generated := formatCompatibilityRules(rules) + path := filepath.Join(repoRoot, filepath.FromSlash(compatibilityRulesFile)) + + if os.Getenv("UPDATE_COMPATIBILITY_RULES") != "" { + require.NoError(t, os.WriteFile(path, []byte(generated), 0o644)) //nolint:gosec // a documentation file + } + + committed, err := os.ReadFile(path) + require.NoError(t, err) + require.Equal(t, generated, strings.ReplaceAll(string(committed), "\r\n", "\n"), + "%s is out of date with UPGRADE.md. Run: UPDATE_COMPATIBILITY_RULES=1 go test ./internal/metriccontract/", compatibilityRulesFile) + + emitted := emittedMetricPatterns(t) + matcher := regexp.MustCompile("^(?:" + strings.Join(emitted, "|") + ")$") + + for _, rules := range rules { + for _, rule := range rules { + source := referencePattern.FindStringSubmatch(rule.expr) + require.NotNil(t, source, rule.expr) + require.True(t, matcher.MatchString(source[1]), "%s reads %s, which the exporter does not emit", rule.record, source[1]) + require.False(t, matcher.MatchString(rule.record), "%s is emitted by the exporter, a recording rule would duplicate it", rule.record) + } + } +} + +// compatibilityRules returns the rules by collector. +func compatibilityRules(t *testing.T, upgrade []string) map[string][]compatibilityRule { + t.Helper() + + labels := labelRenames(t, upgrade) + rules := map[string][]compatibilityRule{} + seen := map[string]bool{} + + for _, line := range upgrade { + m := renameRow.FindStringSubmatch(line) + if m == nil { + continue + } + + oldName, newName, note := m[1], m[2], strings.ToLower(m[3]) + + if seen[oldName] || slices.ContainsFunc(unconvertible, func(s string) bool { return strings.Contains(note, s) }) { + continue + } + + i := slices.IndexFunc(conversions, func(c conversion) bool { return strings.Contains(note, c.match) }) + if i < 0 { + t.Logf("%s: no conversion for the note %q, left out", oldName, m[3]) + + continue + } + + seen[oldName] = true + + expr := fmt.Sprintf(conversions[i].expr, newName) + + var dropped []string + + if rename, ok := labelRenameOf(labels, newName); ok { + for j, oldLabel := range rename.old { + expr = fmt.Sprintf(`label_replace(%s, "%s", "$1", "%s", "(.+)")`, expr, oldLabel, rename.new[j]) + dropped = append(dropped, rename.new[j]) + } + } + + if len(dropped) > 0 { + expr = fmt.Sprintf("max without (%s) (%s)", strings.Join(dropped, ", "), expr) + } + + collector := collectorOf(t, newName) + rules[collector] = append(rules[collector], compatibilityRule{record: oldName, expr: expr}) + } + + return rules +} + +// labelRenames returns the instance label renames of UPGRADE.md. A label +// named instance in 0.31 is restored as exported_instance, the name under +// which Prometheus stored it next to the target label. +func labelRenames(t *testing.T, upgrade []string) []labelRename { + t.Helper() + + var renames []labelRename + + for _, line := range upgrade { + m := labelRow.FindStringSubmatch(line) + if m == nil { + continue + } + + var ( + patterns []string + prefix string + ) + + for _, metric := range backticked.FindAllStringSubmatch(m[2], -1) { + if strings.HasPrefix(metric[1], "windows_") { + patterns = append(patterns, strings.ReplaceAll(regexp.QuoteMeta(metric[1]), `\*`, "[a-zA-Z0-9_]*")) + prefix, _, _ = strings.Cut(metric[1], "*") + } + } + + if len(patterns) == 0 { + continue + } + + var oldLabels, newLabels []string + + for _, label := range backticked.FindAllStringSubmatch(m[3], -1) { + name := label[1] + if name == "instance" { + name = "exported_instance" + } + + oldLabels = append(oldLabels, name) + } + + for _, label := range backticked.FindAllStringSubmatch(m[4], -1) { + newLabels = append(newLabels, label[1]) + } + + require.GreaterOrEqual(t, len(newLabels), len(oldLabels), line) + + renames = append(renames, labelRename{ + metrics: regexp.MustCompile("^(?:" + strings.Join(patterns, "|") + ")$"), + prefix: prefix, + old: oldLabels, + new: newLabels[:len(oldLabels)], + }) + } + + require.NotEmpty(t, renames, "the instance label table of UPGRADE.md was not found") + + return renames +} + +func formatCompatibilityRules(rules map[string][]compatibilityRule) string { + var b strings.Builder + + b.WriteString(`# Recording rules that publish the metrics of windows_exporter 0.32 under +# their 0.31 names, units and instance labels, for dashboards and alerts that +# have not been migrated yet. Load them into Prometheus next to the scrape of +# the new exporter and remove them once the queries use the new names. +# +# Generated from UPGRADE.md by internal/metriccontract; do not edit. +# +# Not covered: +# - Metrics that only renamed their instance label, e.g. windows_service_*. +# Recording them under the same name would duplicate every series. +# - Metrics whose 0.31 value can't be computed from 0.32, e.g. removed +# metrics, split metrics and ratios that 0.31 computed wrongly. +# - Series that 0.32 leaves out, e.g. mscluster settings that are zero. +groups: +`) + + collectors := make([]string, 0, len(rules)) + for collector := range rules { + collectors = append(collectors, collector) + } + + slices.Sort(collectors) + + for _, collector := range collectors { + fmt.Fprintf(&b, " - name: windows_exporter-0.32-%s\n rules:\n", collector) + + for _, rule := range rules[collector] { + fmt.Fprintf(&b, " - record: %s\n expr: %s\n", rule.record, rule.expr) + } + } + + return b.String() +} + +// collectorOf returns the collector that emits the metric name: the longest +// directory name in internal/collector that prefixes the name, e.g. container +// for windows_containers. +func collectorOf(t *testing.T, name string) string { + t.Helper() + + entries, err := os.ReadDir(filepath.Join(repoRoot, "internal", "collector")) + require.NoError(t, err) + + var collector string + + for _, entry := range entries { + if entry.IsDir() && len(entry.Name()) > len(collector) && strings.HasPrefix(name, "windows_"+entry.Name()) { + collector = entry.Name() + } + } + + require.NotEmpty(t, collector, "no collector for %s", name) + + return collector +} diff --git a/internal/metriccontract/metrics_test.go b/internal/metriccontract/metrics_test.go index f6ef1fdd..84802187 100644 --- a/internal/metriccontract/metrics_test.go +++ b/internal/metriccontract/metrics_test.go @@ -220,6 +220,12 @@ func metricReferences(t *testing.T) []reference { return filepath.SkipDir } + // The test of the compatibility rules queries the 0.31 names they + // record; TestCompatibilityRules checks those. + if entry.Name() == "compatibility_rules.test.yaml" { + return nil + } + switch filepath.Ext(path) { case ".jsonnet", ".libsonnet", ".yaml", ".yml": files = append(files, path) diff --git a/tools/e2e-output.txt b/tools/e2e-output.txt index 4dec5eab..91c9afad 100644 --- a/tools/e2e-output.txt +++ b/tools/e2e-output.txt @@ -347,25 +347,25 @@ windows_scheduled_task_state{state="running",task="/Microsoft/Windows/PLA/GAEven windows_scheduled_task_state{state="unknown",task="/Microsoft/Windows/PLA/GAEvents"} 0 # HELP windows_service_info A metric with a constant '1' value labeled with service information # TYPE windows_service_info gauge -windows_service_info{display_name="Themes",name="Themes",path_name="C:\\Windows\\System32\\svchost.exe -k netsvcs -p",run_as="LocalSystem"} 1 +windows_service_info{display_name="Themes",path_name="C:\\Windows\\System32\\svchost.exe -k netsvcs -p",run_as="LocalSystem",service="Themes"} 1 # HELP windows_service_process Process of started service. The value is the creation time of the process as a unix timestamp. # TYPE windows_service_process gauge # HELP windows_service_start_mode The start mode of the service (StartMode) # TYPE windows_service_start_mode gauge -windows_service_start_mode{name="Themes",start_mode="auto"} 1 -windows_service_start_mode{name="Themes",start_mode="boot"} 0 -windows_service_start_mode{name="Themes",start_mode="disabled"} 0 -windows_service_start_mode{name="Themes",start_mode="manual"} 0 -windows_service_start_mode{name="Themes",start_mode="system"} 0 +windows_service_start_mode{service="Themes",start_mode="auto"} 1 +windows_service_start_mode{service="Themes",start_mode="boot"} 0 +windows_service_start_mode{service="Themes",start_mode="disabled"} 0 +windows_service_start_mode{service="Themes",start_mode="manual"} 0 +windows_service_start_mode{service="Themes",start_mode="system"} 0 # HELP windows_service_state The state of the service (State) # TYPE windows_service_state gauge -windows_service_state{name="Themes",state="continue pending"} 0 -windows_service_state{name="Themes",state="pause pending"} 0 -windows_service_state{name="Themes",state="paused"} 0 -windows_service_state{name="Themes",state="running"} 1 -windows_service_state{name="Themes",state="start pending"} 0 -windows_service_state{name="Themes",state="stop pending"} 0 -windows_service_state{name="Themes",state="stopped"} 0 +windows_service_state{service="Themes",state="continue pending"} 0 +windows_service_state{service="Themes",state="pause pending"} 0 +windows_service_state{service="Themes",state="paused"} 0 +windows_service_state{service="Themes",state="running"} 1 +windows_service_state{service="Themes",state="start pending"} 0 +windows_service_state{service="Themes",state="stop pending"} 0 +windows_service_state{service="Themes",state="stopped"} 0 # HELP windows_system_boot_time_timestamp Unix timestamp of system boot time # TYPE windows_system_boot_time_timestamp gauge # HELP windows_system_context_switches_total Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec)