From 3fb18521f6bf7c92d379e7185468340c66e78b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 16 Oct 2026 10:48:26 +0200 Subject: [PATCH] collector: publish base units and _total counter names (#2743) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke --- AGENTS.md | 9 +- UPGRADE.md | 390 ++++++++++++++++-- cmd/windows_exporter/main_test.go | 2 +- contrib/mixin/dashboards/cpu.libsonnet | 16 +- contrib/mixin/dashboards/disk.libsonnet | 6 +- contrib/mixin/dashboards/fleet.libsonnet | 6 +- contrib/mixin/dashboards/gpu.libsonnet | 8 +- contrib/mixin/dashboards/hyper_v.libsonnet | 20 +- contrib/mixin/dashboards/mssql.libsonnet | 68 +-- contrib/mixin/dashboards/network.libsonnet | 2 +- contrib/mixin/dashboards/overview.libsonnet | 4 +- contrib/mixin/dashboards/processes.libsonnet | 4 +- contrib/mixin/dashboards/smb.libsonnet | 8 +- contrib/mixin/lib/queries.libsonnet | 2 +- contrib/mixin/rules/rules.libsonnet | 4 +- contrib/mixin/tests/alerts.test.yaml | 4 +- contrib/mixin/tests/custom.test.yaml | 2 +- contrib/mixin/tests/rules.test.yaml | 10 +- dashboard/windows-exporter-cpu.json | 18 +- dashboard/windows-exporter-dashboard.json | 76 ++-- dashboard/windows-exporter-disk.json | 6 +- dashboard/windows-exporter-fleet.json | 6 +- dashboard/windows-exporter-gpu.json | 8 +- dashboard/windows-exporter-hyper-v.json | 20 +- dashboard/windows-exporter-mssql.json | 68 +-- dashboard/windows-exporter-network.json | 2 +- dashboard/windows-exporter-overview.json | 4 +- dashboard/windows-exporter-processes.json | 4 +- dashboard/windows-exporter-smb.json | 8 +- docs/collector.ad.md | 2 +- docs/collector.cache.md | 3 - docs/collector.container.md | 8 +- docs/collector.cpu.md | 18 +- docs/collector.cpu_info.md | 16 +- docs/collector.diskdrive.md | 2 +- docs/collector.exchange.md | 34 +- docs/collector.fsrmquota.md | 2 +- docs/collector.gpu.md | 14 +- docs/collector.hyperv.md | 159 ++++--- docs/collector.iis.md | 20 +- docs/collector.mscluster.md | 74 ++-- docs/collector.msmq.md | 4 +- docs/collector.mssql.md | 267 ++++++------ docs/collector.netframework.md | 8 +- docs/collector.nps.md | 54 +-- docs/collector.performancecounter.md | 121 +++--- docs/collector.printer.md | 2 +- docs/collector.process.md | 2 +- docs/collector.scheduled_task.md | 23 +- docs/collector.smb.md | 4 +- docs/collector.storage_spaces.md | 4 +- docs/collector.tcp.md | 2 +- docs/collector.time.md | 2 +- docs/collector.vmware.md | 8 +- internal/collector/ad/ad.go | 2 +- internal/collector/cache/cache.go | 13 - .../collector/cache/data_map_hits_test.go | 5 +- internal/collector/container/container.go | 6 +- internal/collector/cpu/AGENTS.md | 3 +- internal/collector/cpu/cpu.go | 14 +- internal/collector/cpu_info/cpu_info.go | 12 +- internal/collector/diskdrive/diskdrive.go | 2 +- .../exchange/exchange_ad_access_processes.go | 20 +- .../exchange/exchange_availability_service.go | 4 +- .../collector/exchange/exchange_http_proxy.go | 20 +- .../exchange/exchange_mapi_http_emsmdb.go | 2 +- .../exchange/exchange_rpc_client_access.go | 10 +- .../exchange/exchange_workload_management.go | 6 +- internal/collector/fsrmquota/fsrmquota.go | 2 +- internal/collector/gpu/gpu.go | 2 +- internal/collector/hyperv/AGENTS.md | 3 +- internal/collector/hyperv/hyperv_datastore.go | 114 ++--- internal/collector/hyperv/hyperv_host.go | 6 +- .../hyperv_hypervisor_logical_processor.go | 4 +- .../hyperv_hypervisor_root_partition.go | 12 +- ...yperv_hypervisor_root_virtual_processor.go | 4 +- .../hyperv_hypervisor_virtual_processor.go | 62 +-- internal/collector/hyperv/hyperv_test.go | 37 +- .../hyperv_virtual_machine_health_summary.go | 4 +- ...rv_virtual_network_adapter_drop_reasons.go | 4 +- .../collector/hyperv/hyperv_virtual_smb.go | 56 +-- .../hyperv/hyperv_virtual_storage_device.go | 68 +-- internal/collector/iis/iis_app_pool_was.go | 12 +- internal/collector/iis/iis_w3svc_w3wp.go | 2 +- internal/collector/iis/iis_web_service.go | 4 +- .../collector/iis/iis_web_service_cache.go | 2 +- internal/collector/iis/metric_types_test.go | 2 +- internal/collector/mscluster/AGENTS.md | 10 + .../collector/mscluster/mscluster_cluster.go | 142 +++---- .../mscluster_cluster_native_test.go | 33 +- .../mscluster_cluster_parity_test.go | 2 +- .../collector/mscluster/mscluster_objects.go | 7 + .../collector/mscluster/mscluster_resource.go | 65 ++- .../mscluster_resource_native_test.go | 26 +- .../mscluster/mscluster_resourcegroup.go | 8 +- .../mscluster_resourcegroup_native_test.go | 2 +- internal/collector/msmq/msmq.go | 4 +- .../collector/mssql/counter_units_test.go | 12 +- .../collector/mssql/mssql_access_methods.go | 84 ++-- .../mssql/mssql_availability_replica.go | 18 +- .../collector/mssql/mssql_buffer_manager.go | 30 +- internal/collector/mssql/mssql_database.go | 62 +-- .../collector/mssql/mssql_database_replica.go | 28 +- .../mssql/mssql_general_statistics.go | 10 +- internal/collector/mssql/mssql_locks.go | 27 +- internal/collector/mssql/mssql_sql_stats.go | 22 +- .../collector/mssql/mssql_transactions.go | 4 +- .../collector/netframework/netframework.go | 21 +- .../netframework/netframework_clrjit.go | 21 +- .../netframework/netframework_clrmemory.go | 6 +- .../netframework/netframework_clrsecurity.go | 31 +- .../netframework_counter_paths_test.go | 4 +- .../netframework/netframework_pdh_test.go | 61 ++- internal/collector/nps/AGENTS.md | 2 + internal/collector/nps/nps.go | 66 +-- internal/collector/printer/printer.go | 6 +- internal/collector/printer/printer_test.go | 2 +- internal/collector/process/process.go | 2 +- internal/collector/process/process_test.go | 2 +- .../scheduled_task/scheduled_task.go | 21 - .../scheduled_task_internal_test.go | 20 +- .../scheduled_task_native_test.go | 4 +- internal/collector/smb/smb.go | 4 +- internal/collector/smb/smb_test.go | 4 +- .../storage_spaces/storage_spaces_test.go | 4 +- .../storage_spaces_virtual_disk.go | 6 +- internal/collector/tcp/tcp.go | 2 +- internal/collector/time/time.go | 6 +- internal/collector/vmware/vmware.go | 54 +-- kubernetes/kubernetes.md | 2 +- tools/e2e-output.txt | 29 +- 131 files changed, 1674 insertions(+), 1459 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d30e7640..c893a530 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -107,7 +107,14 @@ exercised a live Windows role. - Preserve metric names, label sets, types, units, defaults and configuration compatibility unless the change intentionally updates that contract. Update the corresponding collector documentation and affected queries together. - Follow existing deprecation patterns when replacing published metrics. + Replace published metrics with a hard rename: do not keep deprecated copies + or aliases, and list the change in `UPGRADE.md`. +- Name metrics after the Prometheus conventions: publish base units (seconds, + bytes, hertz, ratios from 0 to 1) and put the unit in the name (`_seconds`, + `_bytes`, `_hertz`, `_ratio`), never `_mhz`, `_percent`, `_minutes`, + `_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`. - 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 ee037321..6acfca8b 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -17,7 +17,8 @@ Most installations need no changes. Go through the checklist below and read the | You use the `container` collector | Replace `containerd-state-dir` with `cri-endpoint` | [container collector](#container-collector) | | You query `windows_gpu_info` | Replace the `phys` label with `device_number` | [GPU collector](#gpu-collector) | | You alert on BitLocker status | Replace `status="disabled"` with `status="off"` | [BitLocker status](#bitlocker-status) | -| You query 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, deprecated and retyped metrics](#renamed-deprecated-and-retyped-metrics) | +| 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 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) | @@ -213,7 +214,7 @@ The `status` values are unchanged, but `disabled` is never reported anymore and Alerts on `windows_logical_disk_bitlocker_status{status="disabled"}` won't fire anymore. To find unencrypted volumes, use `status="off"`. See [the logical_disk documentation](docs/collector.logical_disk.md#bitlocker-status) for all values. -## Renamed, deprecated and retyped metrics +## Renamed, removed and retyped metrics Renamed: @@ -239,6 +240,7 @@ Renamed: | `windows_smb_server_shares_write_requests_count_total` | `windows_smb_server_shares_write_requests_total` | Same value | | `windows_smb_server_shares_metadata_requests_count_total` | `windows_smb_server_shares_metadata_requests_total` | Same value | | `windows_smb_server_shares_files_opened_count_total` | `windows_smb_server_shares_files_opened_total` | Same value | +| `windows_iis_ipapi_extension_requests_total` | `windows_iis_isapi_extension_requests_total` | Same value; the old name was misspelled | | `windows_remote_fx_net_current_tcp_bandwidth` | `windows_remote_fx_net_current_tcp_bandwidth_bytes_per_second` | Unit suffix added, same value | | `windows_remote_fx_net_current_udp_bandwidth` | `windows_remote_fx_net_current_udp_bandwidth_bytes_per_second` | Unit suffix added, same value | | `windows_remote_fx_gfx_frame_quality` | `windows_remote_fx_gfx_frame_quality_ratio` | Ratio from 0 to 1 instead of percent | @@ -266,8 +268,8 @@ Renamed: | `windows_mssql_databases_log_shrinks` | `windows_mssql_databases_log_shrinks_total` | Now a counter, use `increase()` | | `windows_mssql_databases_log_truncations` | `windows_mssql_databases_log_truncations_total` | Now a counter, use `increase()` | | `windows_mssql_databases_xtp_controller_dlc_fetch_latency_seconds` | `windows_mssql_databases_xtp_controller_dlc_fetch_latency_seconds_total` | Now a counter in seconds; divide its `rate()` by that of the new `windows_mssql_databases_xtp_controller_dlc_fetches_total` | -| `windows_mssql_dbreplica_database_flow_control_wait_seconds` | `windows_mssql_dbreplica_database_flow_control_wait_seconds_total` | Now a counter, use `rate()` | -| `windows_mssql_dbreplica_group_commit_stall_seconds` | `windows_mssql_dbreplica_group_commit_stall_seconds_total` | Now a counter, use `rate()` | +| `windows_mssql_dbreplica_database_flow_control_wait_seconds` | `windows_mssql_dbreplica_database_flow_control_wait_seconds_total` | Seconds instead of microseconds, now a counter, use `rate()` | +| `windows_mssql_dbreplica_group_commit_stall_seconds` | `windows_mssql_dbreplica_group_commit_stall_seconds_total` | Seconds instead of microseconds, now a counter, use `rate()` | | `windows_mssql_dbreplica_transaction_delay_seconds` | `windows_mssql_dbreplica_transaction_delay_seconds_total` | Now a counter, use `rate()` | | `windows_mssql_dbreplica_recovery_queue_records` | `windows_mssql_dbreplica_recovery_queue_bytes` | Was kilobytes, now bytes | | `windows_mssql_dbreplica_log_send_queue` | `windows_mssql_dbreplica_log_send_queue_bytes` | Was kilobytes, now bytes | @@ -275,7 +277,7 @@ Renamed: | `windows_mssql_dbreplica_total_log_requiring_undo` | `windows_mssql_dbreplica_total_log_requiring_undo_bytes` | Was kilobytes, now bytes | | `windows_mssql_genstats_http_authenticated_requests`, `windows_mssql_genstats_mars_deadlocks`, `windows_mssql_genstats_soap_empty_requests`, `windows_mssql_genstats_soap_method_invocations`, `windows_mssql_genstats_soap_session_initiate_requests`, `windows_mssql_genstats_soap_session_terminate_requests`, `windows_mssql_genstats_soapsql_requests`, `windows_mssql_genstats_soapwsdl_requests`, `windows_mssql_genstats_sql_trace_io_provider_lock_waits`, `windows_mssql_genstats_tempdb_recovery_unit_ids_generated`, `windows_mssql_genstats_tempdb_rowset_ids_generated` | The same names with a `_total` suffix | Now counters, use `rate()` | | `windows_mssql_locks_wait_time_seconds` | `windows_mssql_locks_wait_time_seconds_total` | Now a counter, use `rate()` | -| `windows_mssql_locks_count` | `windows_mssql_locks_count_total` | Now a counter, use `rate()` | +| `windows_mssql_locks_count` | `windows_mssql_locks_lock_waits_total` | Removed: it was the base of the average wait time and equals the lock wait count, use `rate()` | | `windows_mssql_locks_lock_wait_seconds` | `windows_mssql_locks_lock_wait_seconds_total` | Now a counter, use `rate()` | | `windows_mssql_transactions_nonsnapshot_version_active_total` | `windows_mssql_transactions_nonsnapshot_version_active` | Now a gauge, query it directly | | `windows_mssql_transactions_snapshot_active_total` | `windows_mssql_transactions_snapshot_active` | Now a gauge, query it directly | @@ -296,21 +298,17 @@ Removed: | `windows_memory_free_system_page_table_entries` | Saturates near 2^32 on 64-bit Windows, where system PTEs are not a scarce resource | | `windows_logical_disk_avg_read_requests_queued` | Running sum that only grew, never an average queue length. Use `rate(windows_logical_disk_read_seconds_total[5m])` | | `windows_logical_disk_avg_write_requests_queued` | Running sum that only grew, never an average queue length. Use `rate(windows_logical_disk_write_seconds_total[5m])` | +| `windows_cache_data_map_hits_percent` | Deprecated in earlier 0.32 builds. It was the raw hit count, not a percentage. Use `rate(windows_cache_data_map_hits_total[5m]) / rate(windows_cache_data_maps_total[5m])` | +| `windows_mscluster_cluster_quorum_log_file_size`, `windows_mscluster_cluster_resource_dll_deadlock_period` | Obsolete cluster properties without a meaning on supported Windows versions | +| `windows_hyperv_hypervisor_virtual_processor_time_total` | Duplicate. Use `windows_hyperv_hypervisor_virtual_processor_mode_time_seconds_total` | +| `windows_hyperv_hypervisor_virtual_processor_total_run_time_total` | Duplicate. Use `windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total` | +| `windows_hyperv_virtual_storage_device_latency_seconds` | Running sum in 100ns ticks. Use `rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total[5m]) / rate(windows_hyperv_virtual_storage_device_throughput_total[5m])` | +| `windows_hyperv_virtual_storage_device_lower_latency_seconds` | Running sum in 100ns ticks. Use `windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total` the same way | +| `windows_hyperv_virtual_storage_device_queue_length` | Running sum in 100ns ticks. Use `rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total[5m])` | +| `windows_hyperv_virtual_storage_device_lower_queue_length` | Running sum in 100ns ticks. Use `rate(windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total[5m])` | +| `windows_scheduled_task_last_result` | Use `windows_scheduled_task_last_result_status{status="success"}` | -Deprecated. These are still exported in 0.32 and will be removed in a later release: - -| Deprecated | Use instead | -|--------------------------------------------------------------------|-----------------------------------------------------------| -| `windows_hyperv_hypervisor_virtual_processor_time_total` | `windows_hyperv_hypervisor_virtual_processor_mode_time_total` | -| `windows_hyperv_hypervisor_virtual_processor_total_run_time_total` | `windows_hyperv_hypervisor_virtual_processor_run_time_total` | -| `windows_hyperv_virtual_storage_device_latency_seconds` | `rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total[5m]) / rate(windows_hyperv_virtual_storage_device_throughput_total[5m])` | -| `windows_hyperv_virtual_storage_device_lower_latency_seconds` | `windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total`, used the same way | -| `windows_hyperv_virtual_storage_device_queue_length` | `rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total[5m])` | -| `windows_hyperv_virtual_storage_device_lower_queue_length` | `rate(windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total[5m])` | -| `windows_cache_data_map_hits_percent` | `windows_cache_data_map_hits_total` | -| `windows_scheduled_task_last_result` | `windows_scheduled_task_last_result_status` | - -The deprecated Hyper-V storage latency and queue gauges and the removed logical disk `avg_*_requests_queued` gauges never held current values. +The removed Hyper-V storage latency and queue gauges and logical disk `avg_*_requests_queued` gauges never held current values. They exported a running sum that only grows, so graphs of them rise steadily. The replacements give the actual average latency and queue length. Changed type, same name: @@ -320,7 +318,6 @@ Changed type, same name: | `windows_iis_server_output_cache_items`, `windows_iis_worker_output_cache_items` | counter | gauge | | `windows_iis_server_output_cache_memory_bytes`, `windows_iis_worker_output_cache_memory_bytes` | counter | gauge | | `windows_iis_server_output_cache_active_flushed_items`, `windows_iis_worker_output_cache_active_flushed_items` | counter | gauge | -| `windows_smb_server_shares_current_open_file_count`, `windows_smb_server_shares_tree_connect_count` | counter | gauge | | `windows_iis_worker_current_requests`, `windows_iis_worker_current_websocket_requests` | counter | gauge | | `windows_iis_worker_max_threads` | counter | gauge | | `windows_cache_copy_read_hits_total` | gauge | counter | @@ -328,12 +325,16 @@ Changed type, same name: | `windows_hyperv_legacy_network_adapter_bytes_dropped_total` | gauge | counter | | `windows_mssql_waitstats_*` (all 12 wait types) | counter | gauge | | `windows_mssql_transactions_version_store_units` | counter | gauge | +| `windows_exchange_workload_queued_tasks` | counter | gauge | +| `windows_iis_server_file_cache_max_memory_bytes`, `windows_iis_worker_file_cache_max_memory_bytes` | counter | gauge | +| `windows_netframework_clrjit_jit_standard_failures_total` | gauge | counter | -The IIS and SMB values are current occupancy or, for `worker_max_threads`, the configured thread pool limit, so query them directly instead of with `rate()`. -If Prometheus scrapes with OpenMetrics, the IIS, SMB and SQL Server metrics above were stored with a `_total` suffix, which counters get in that format. They now arrive without it. +The IIS values are current occupancy or, for `worker_max_threads`, the configured thread pool limit, so query them directly instead of with `rate()`. +If Prometheus scrapes with OpenMetrics, the IIS and SQL Server metrics above were stored with a `_total` suffix, which counters get in that format. They now arrive without it. The cache, UDP and Hyper-V metrics already end in `_total`, so only their type metadata changes; `rate()` queries keep working. The SQL Server wait statistics hold values that SQL Server computes over its last sampling interval (the `item` label names the statistic), and the version store unit count is a current value. Query them directly instead of with `rate()`. The SQL Server metrics that gained a `_total` suffix hold running totals since the instance started, which 0.31 published as gauges. +The Exchange queued task count is the current queue length. The IIS file cache maximum is the peak of the current file cache memory usage, not a running total. The .NET JIT failure count is a running total since the process started, so use `rate()` or `increase()` on it. Label changes on existing metrics: @@ -347,6 +348,342 @@ Label changes on existing metrics: Retired: `windows_net_route_info` was documented but never exported. It was removed from the documentation. +## Base units and counter names + +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. + +### 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. + +| 0.31 | 0.32 | Change | +|-------------------------------------------------------------------------|---------------------------------------------------------------------------------|--------| +| `windows_cpu_core_frequency_mhz` | `windows_cpu_core_frequency_hertz` | Hertz instead of megahertz: multiply the old value by 1e6 | +| `windows_cpu_info_l2_cache_size` | `windows_cpu_info_l2_cache_size_bytes` | Bytes instead of kilobytes | +| `windows_cpu_info_l3_cache_size` | `windows_cpu_info_l3_cache_size_bytes` | Bytes instead of kilobytes | +| `windows_exchange_http_proxy_avg_auth_latency` | `windows_exchange_http_proxy_avg_auth_latency_seconds` | Seconds instead of milliseconds | +| `windows_exchange_http_proxy_mailbox_proxy_failure_rate` | `windows_exchange_http_proxy_mailbox_proxy_failure_ratio` | Ratio from 0 to 1 instead of percent: divide the old value by 100 | +| `windows_exchange_ldap_long_running_ops_per_sec` | `windows_exchange_ldap_long_running_operations_per_second` | Per second instead of the per-minute value, which 0.31 multiplied by 60: divide the old value by 3600; Now a gauge, query it without `rate()` | +| `windows_hyperv_datastore_cache_update_operation_latency_microseconds` | `windows_hyperv_datastore_cache_update_operation_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_commit_byte_latency_microseconds` | `windows_hyperv_datastore_commit_byte_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_commit_operation_latency_microseconds` | `windows_hyperv_datastore_commit_operation_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_compact_operation_latency_microseconds` | `windows_hyperv_datastore_compact_operation_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_load_file_operation_latency_microseconds` | `windows_hyperv_datastore_load_file_operation_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_query_size_operation_latency_microseconds` | `windows_hyperv_datastore_query_size_operation_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_read_from_file_byte_latency_microseconds` | `windows_hyperv_datastore_read_from_file_byte_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_read_from_storage_byte_latency_microseconds` | `windows_hyperv_datastore_read_from_storage_byte_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_reconnect_latency_microseconds` | `windows_hyperv_datastore_reconnect_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_remove_operation_latency_microseconds` | `windows_hyperv_datastore_remove_operation_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_set_operation_latency_microseconds` | `windows_hyperv_datastore_set_operation_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_write_to_file_byte_latency_microseconds` | `windows_hyperv_datastore_write_to_file_byte_latency_seconds` | Seconds instead of microseconds | +| `windows_hyperv_datastore_write_to_storage_byte_latency_microseconds` | `windows_hyperv_datastore_write_to_storage_byte_latency_seconds` | Seconds instead of microseconds | +| `windows_mscluster_cluster_block_cache_size` | `windows_mscluster_cluster_block_cache_size_bytes` | Bytes instead of megabytes | +| `windows_mscluster_cluster_clus_svc_regroup_tick_in_milliseconds` | `windows_mscluster_cluster_clus_svc_regroup_tick_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_cluster_cluster_log_size` | `windows_mscluster_cluster_cluster_log_size_bytes` | Bytes instead of megabytes | +| `windows_mscluster_cluster_cross_site_delay` | `windows_mscluster_cluster_cross_site_delay_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_cluster_cross_subnet_delay` | `windows_mscluster_cluster_cross_subnet_delay_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_cluster_grace_period_timeout` | `windows_mscluster_cluster_grace_period_timeout_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_cluster_root_memory_reserved` | `windows_mscluster_cluster_root_memory_reserved_bytes` | Bytes instead of megabytes | +| `windows_mscluster_cluster_s2d_cache_flash_reserve_percent` | `windows_mscluster_cluster_s2d_cache_flash_reserve_ratio` | Ratio from 0 to 1 instead of percent: divide the old value by 100 | +| `windows_mscluster_cluster_s2d_cache_page_size_k_bytes` | `windows_mscluster_cluster_s2d_cache_page_size_bytes` | Bytes instead of kilobytes | +| `windows_mscluster_cluster_s2dio_latency_threshold` | `windows_mscluster_cluster_s2dio_latency_threshold_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_cluster_same_subnet_delay` | `windows_mscluster_cluster_same_subnet_delay_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_cluster_shutdown_timeout_in_minutes` | `windows_mscluster_cluster_shutdown_timeout_seconds` | Seconds instead of minutes | +| `windows_mscluster_resource_deadlock_timeout` | `windows_mscluster_resource_deadlock_timeout_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_resource_is_alive_poll_interval` | `windows_mscluster_resource_is_alive_poll_interval_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_resource_looks_alive_poll_interval` | `windows_mscluster_resource_looks_alive_poll_interval_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_resource_pending_timeout` | `windows_mscluster_resource_pending_timeout_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_resource_restart_delay` | `windows_mscluster_resource_restart_delay_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_resource_restart_period` | `windows_mscluster_resource_restart_period_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_resource_retry_period_on_failure` | `windows_mscluster_resource_retry_period_on_failure_seconds` | Seconds instead of milliseconds | +| `windows_mscluster_resourcegroup_failover_period` | `windows_mscluster_resourcegroup_failover_period_seconds` | Seconds instead of hours | +| `windows_mssql_bufman_extension_in_use_as_percentage` | `windows_mssql_bufman_extension_in_use_ratio` | Ratio from 0 to 1 instead of percent: divide the old value by 100 | +| `windows_mssql_databases_log_used_percent` | `windows_mssql_databases_log_used_ratio` | Ratio from 0 to 1 instead of percent: divide the old value by 100 | +| `windows_netframework_clrjit_jit_time_percent` | `windows_netframework_clrjit_jit_time_ratio` | Ratio from 0 to 1. 0.31 divided the raw counter by the performance counter frequency, which was neither a percentage nor a ratio | +| `windows_netframework_clrmemory_gc_time_percent` | `windows_netframework_clrmemory_gc_time_ratio` | Ratio from 0 to 1 instead of percent: divide the old value by 100 | +| `windows_netframework_clrsecurity_rt_checks_time_percent` | `windows_netframework_clrsecurity_rt_checks_time_ratio` | Ratio from 0 to 1. 0.31 divided the raw counter by the performance counter frequency, which was neither a percentage nor a ratio | +| `windows_storage_spaces_virtual_disk_storage_efficiency_percent` | `windows_storage_spaces_virtual_disk_storage_efficiency_ratio` | Ratio from 0 to 1 instead of percent: divide the old value by 100 | +| `windows_time_clock_frequency_adjustment_ppb` | `windows_time_clock_frequency_adjustment_ratio` | Ratio instead of parts per billion: multiply the old value by 1e-9 | +| `windows_vmware_cpu_effective_vm_speed_mhz_total` | `windows_vmware_cpu_effective_vm_speed_hertz` | Hertz instead of megahertz: multiply the old value by 1e6 | +| `windows_vmware_cpu_limit_mhz` | `windows_vmware_cpu_limit_hertz` | Hertz instead of megahertz: multiply the old value by 1e6 | +| `windows_vmware_cpu_reservation_mhz` | `windows_vmware_cpu_reservation_hertz` | Hertz instead of megahertz: multiply the old value by 1e6 | +| `windows_vmware_host_processor_speed_mhz` | `windows_vmware_host_processor_speed_hertz` | Hertz instead of megahertz: multiply the old value by 1e6 | + +Examples: `windows_cpu_core_frequency_mhz * 1e6` becomes `windows_cpu_core_frequency_hertz`; an alert on `windows_mssql_databases_log_used_percent > 90` becomes `windows_mssql_databases_log_used_ratio > 0.9`. +The `.NET CLR` JIT and security time ratios are now the raw value divided by its base, like `windows_netframework_clrmemory_gc_time_ratio`, and are left out while Windows reports no base value. + +### Other renames + +These metrics keep their values. The name changed to add the unit, to describe the value or, for counters, to put the unit before the `_total` suffix. If Prometheus scrapes with OpenMetrics, the stored names of these counters change as well. + +| 0.31 | 0.32 | Note | +|-------------------------------------------------------------------------|---------------------------------------------------------------------------------|------| +| `windows_container_count` | `windows_containers` | Same value | +| `windows_container_cpu_usage_seconds_kernelmode` | `windows_container_cpu_usage_kernelmode_seconds_total` | Same value | +| `windows_container_cpu_usage_seconds_usermode` | `windows_container_cpu_usage_usermode_seconds_total` | Same value | +| `windows_cpu_time_total` | `windows_cpu_time_seconds_total` | Same value | +| `windows_diskdrive_size` | `windows_diskdrive_size_bytes` | Same value | +| `windows_exchange_availability_service_requests_per_sec` | `windows_exchange_availability_service_requests_total` | Same value | +| `windows_exchange_http_proxy_avg_cas_processing_latency_sec` | `windows_exchange_http_proxy_avg_cas_processing_latency_seconds` | Same value | +| `windows_exchange_http_proxy_mailbox_server_locator_avg_latency_sec` | `windows_exchange_http_proxy_mailbox_server_locator_avg_latency_seconds` | Same value | +| `windows_exchange_ldap_read_time_sec` | `windows_exchange_ldap_read_time_seconds_total` | Same value | +| `windows_exchange_ldap_search_time_sec` | `windows_exchange_ldap_search_time_seconds_total` | Same value | +| `windows_exchange_ldap_write_time_sec` | `windows_exchange_ldap_write_time_seconds_total` | Same value | +| `windows_exchange_mapihttp_emsmdb_active_user_count` | `windows_exchange_mapihttp_emsmdb_active_users` | Same value | +| `windows_exchange_rpc_active_user_count` | `windows_exchange_rpc_active_users` | Same value | +| `windows_exchange_rpc_avg_latency_sec` | `windows_exchange_rpc_avg_latency_seconds` | Same value | +| `windows_exchange_rpc_connection_count` | `windows_exchange_rpc_connections` | Same value | +| `windows_exchange_rpc_user_count` | `windows_exchange_rpc_users` | Same value | +| `windows_fsrmquota_count` | `windows_fsrmquota_quotas` | Same value | +| `windows_hyperv_datastore_cache_update_operation_count` | `windows_hyperv_datastore_cache_update_operations_total` | Same value | +| `windows_hyperv_datastore_commit_byte_count` | `windows_hyperv_datastore_commit_bytes_total` | Same value | +| `windows_hyperv_datastore_commit_count` | `windows_hyperv_datastore_commits_total` | Same value | +| `windows_hyperv_datastore_commit_operation_count` | `windows_hyperv_datastore_commit_operations_total` | Same value | +| `windows_hyperv_datastore_compact_operation_count` | `windows_hyperv_datastore_compact_operations_total` | Same value | +| `windows_hyperv_datastore_disconnect_count` | `windows_hyperv_datastore_disconnects_total` | Same value | +| `windows_hyperv_datastore_load_file_operation_count` | `windows_hyperv_datastore_load_file_operations_total` | Same value | +| `windows_hyperv_datastore_query_size_operation_count` | `windows_hyperv_datastore_query_size_operations_total` | Same value | +| `windows_hyperv_datastore_read_from_file_byte_count` | `windows_hyperv_datastore_read_from_file_bytes_total` | Same value | +| `windows_hyperv_datastore_read_from_file_count` | `windows_hyperv_datastore_read_from_file_operations_total` | Same value | +| `windows_hyperv_datastore_read_from_storage_byte_count` | `windows_hyperv_datastore_read_from_storage_bytes_total` | Same value | +| `windows_hyperv_datastore_read_from_storage_count` | `windows_hyperv_datastore_read_from_storage_operations_total` | Same value | +| `windows_hyperv_datastore_remove_operation_count` | `windows_hyperv_datastore_remove_operations_total` | Same value | +| `windows_hyperv_datastore_set_operation_count` | `windows_hyperv_datastore_set_operations_total` | Same value | +| `windows_hyperv_datastore_write_to_file_byte_count` | `windows_hyperv_datastore_write_to_file_bytes_total` | Same value | +| `windows_hyperv_datastore_write_to_file_count` | `windows_hyperv_datastore_write_to_file_operations_total` | Same value | +| `windows_hyperv_datastore_write_to_storage_byte_count` | `windows_hyperv_datastore_write_to_storage_bytes_total` | Same value | +| `windows_hyperv_datastore_write_to_storage_count` | `windows_hyperv_datastore_write_to_storage_operations_total` | Same value | +| `windows_hyperv_host_logical_processor_count` | `windows_hyperv_host_logical_processors` | Same value | +| `windows_hyperv_hypervisor_logical_processor_time_total` | `windows_hyperv_hypervisor_logical_processor_time_seconds_total` | Same value | +| `windows_hyperv_hypervisor_logical_processor_total_run_time_total` | `windows_hyperv_hypervisor_logical_processor_total_run_time_seconds_total` | Same value | +| `windows_hyperv_hypervisor_root_virtual_processor_time_total` | `windows_hyperv_hypervisor_root_virtual_processor_time_seconds_total` | Same value | +| `windows_hyperv_hypervisor_root_virtual_processor_total_run_time_total` | `windows_hyperv_hypervisor_root_virtual_processor_total_run_time_seconds_total` | Same value | +| `windows_hyperv_hypervisor_virtual_processor_mode_time_total` | `windows_hyperv_hypervisor_virtual_processor_mode_time_seconds_total` | Same value | +| `windows_hyperv_hypervisor_virtual_processor_run_time_total` | `windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total` | Same value | +| `windows_hyperv_root_partition_1G_device_pages` | `windows_hyperv_root_partition_1g_device_pages` | Same value | +| `windows_hyperv_root_partition_1G_gpa_pages` | `windows_hyperv_root_partition_1g_gpa_pages` | Same value | +| `windows_hyperv_root_partition_2M_device_pages` | `windows_hyperv_root_partition_2m_device_pages` | Same value | +| `windows_hyperv_root_partition_2M_gpa_pages` | `windows_hyperv_root_partition_2m_gpa_pages` | Same value | +| `windows_hyperv_root_partition_4K_device_pages` | `windows_hyperv_root_partition_4k_device_pages` | Same value | +| `windows_hyperv_root_partition_4K_gpa_pages` | `windows_hyperv_root_partition_4k_gpa_pages` | Same value | +| `windows_hyperv_total_vm_processor_count` | `windows_hyperv_assigned_vm_processors` | Same value | +| `windows_hyperv_virtual_machine_health_total_count` | `windows_hyperv_virtual_machines` | Same value | +| `windows_hyperv_virtual_smb_current_open_file_count` | `windows_hyperv_virtual_smb_open_files` | Same value | +| `windows_hyperv_virtual_smb_read_bytes_rdma` | `windows_hyperv_virtual_smb_rdma_read_bytes_total` | Same value | +| `windows_hyperv_virtual_smb_read_requests_rdma` | `windows_hyperv_virtual_smb_rdma_read_requests_total` | Same value | +| `windows_hyperv_virtual_smb_tree_connect_count` | `windows_hyperv_virtual_smb_tree_connects_total` | Same value. Now a counter, use `rate()` | +| `windows_hyperv_virtual_smb_write_bytes_rdma` | `windows_hyperv_virtual_smb_rdma_write_bytes_total` | Same value | +| `windows_hyperv_virtual_smb_write_requests_rdma` | `windows_hyperv_virtual_smb_rdma_write_requests_total` | Same value | +| `windows_hyperv_virtual_storage_device_bytes_read` | `windows_hyperv_virtual_storage_device_read_bytes_total` | Same value | +| `windows_hyperv_virtual_storage_device_bytes_written` | `windows_hyperv_virtual_storage_device_written_bytes_total` | Same value | +| `windows_hyperv_virtual_storage_device_error_count_total` | `windows_hyperv_virtual_storage_device_errors_total` | Same value | +| `windows_hyperv_vm_processor_count` | `windows_hyperv_vm_processors` | Same value | +| `windows_iis_service_uptime` | `windows_iis_service_uptime_seconds` | Same value | +| `windows_iis_total_application_pool_recycles` | `windows_iis_application_pool_recycles_total` | Same value | +| `windows_iis_total_worker_process_failures` | `windows_iis_worker_process_failures_total` | Same value | +| `windows_iis_total_worker_process_ping_failures` | `windows_iis_worker_process_ping_failures_total` | Same value | +| `windows_iis_total_worker_process_shutdown_failures` | `windows_iis_worker_process_shutdown_failures_total` | Same value | +| `windows_iis_total_worker_process_startup_failures` | `windows_iis_worker_process_startup_failures_total` | Same value | +| `windows_iis_total_worker_processes_created` | `windows_iis_worker_processes_created_total` | Same value | +| `windows_mscluster_cluster_add_evict_delay` | `windows_mscluster_cluster_add_evict_delay_seconds` | Same value | +| `windows_mscluster_cluster_clus_svc_hang_timeout` | `windows_mscluster_cluster_clus_svc_hang_timeout_seconds` | Same value | +| `windows_mscluster_cluster_clus_svc_regroup_opening_timeout` | `windows_mscluster_cluster_clus_svc_regroup_opening_timeout_seconds` | Same value | +| `windows_mscluster_cluster_clus_svc_regroup_pruning_timeout` | `windows_mscluster_cluster_clus_svc_regroup_pruning_timeout_seconds` | Same value | +| `windows_mscluster_cluster_clus_svc_regroup_stage_timeout` | `windows_mscluster_cluster_clus_svc_regroup_stage_timeout_seconds` | Same value | +| `windows_mscluster_cluster_cluster_group_wait_delay` | `windows_mscluster_cluster_cluster_group_wait_delay_seconds` | Same value | +| `windows_mscluster_cluster_group_dependency_timeout` | `windows_mscluster_cluster_group_dependency_timeout_seconds` | Same value | +| `windows_mscluster_cluster_quarantine_duration` | `windows_mscluster_cluster_quarantine_duration_seconds` | Same value | +| `windows_mscluster_cluster_quorum_arbitration_time_max` | `windows_mscluster_cluster_quorum_arbitration_time_max_seconds` | Same value | +| `windows_mscluster_cluster_quorum_arbitration_time_min` | `windows_mscluster_cluster_quorum_arbitration_time_min_seconds` | Same value | +| `windows_mscluster_cluster_request_reply_timeout` | `windows_mscluster_cluster_request_reply_timeout_seconds` | Same value | +| `windows_mscluster_cluster_resiliency_default_period` | `windows_mscluster_cluster_resiliency_default_period_seconds` | Same value | +| `windows_mscluster_cluster_shared_volume_vss_writer_operation_timeout` | `windows_mscluster_cluster_shared_volume_vss_writer_operation_timeout_seconds` | Same value | +| `windows_mscluster_cluster_witness_database_write_timeout` | `windows_mscluster_cluster_witness_database_write_timeout_seconds` | Same value | +| `windows_mscluster_cluster_witness_restart_interval` | `windows_mscluster_cluster_witness_restart_interval_seconds` | Same value | +| `windows_mscluster_resourcegroup_resiliency_period` | `windows_mscluster_resourcegroup_resiliency_period_seconds` | Same value | +| `windows_msmq_bytes_in_journal_queue` | `windows_msmq_journal_queue_bytes` | Same value | +| `windows_msmq_bytes_in_queue` | `windows_msmq_queue_bytes` | Same value | +| `windows_mssql_locks_lock_timeouts_excluding_NOWAIT` | `windows_mssql_locks_lock_timeouts_excluding_nowait_total` | Same value | +| `windows_nps_access_server_reset_time` | `windows_nps_access_server_reset_time_seconds` | Same value. Now a gauge, query it without `rate()` | +| `windows_nps_access_server_up_time` | `windows_nps_access_server_up_time_seconds` | Same value. Now a gauge, query it without `rate()` | +| `windows_nps_accounting_server_reset_time` | `windows_nps_accounting_server_reset_time_seconds` | Same value. Now a gauge, query it without `rate()` | +| `windows_nps_accounting_server_up_time` | `windows_nps_accounting_server_up_time_seconds` | Same value. Now a gauge, query it without `rate()` | +| `windows_printer_job_count` | `windows_printer_jobs` | Same value. Now a gauge, query it without `rate()` | +| `windows_process_cpu_time_total` | `windows_process_cpu_time_seconds_total` | Same value | +| `windows_smb_server_shares_current_open_file_count` | `windows_smb_server_shares_open_files` | Same value. Now a gauge, query it without `rate()` | +| `windows_smb_server_shares_tree_connect_count` | `windows_smb_server_shares_tree_connects` | Same value. Now a gauge, query it without `rate()` | +| `windows_tcp_connections_state_count` | `windows_tcp_connections` | Same value | + +### Counters with a `_total` suffix + +These counters keep their values and type; only the `_total` suffix was added. `rate()` and `increase()` queries only need the new name. +If Prometheus scrapes with OpenMetrics, it already stored exactly these names, because OpenMetrics adds `_total` to counters. + +| 0.31 | 0.32 | Note | +|-------------------------------------------------------------------------|---------------------------------------------------------------------------------|------| +| `windows_ad_replication_highest_usn` | `windows_ad_replication_highest_usn_total` | Same value | +| `windows_exchange_workload_completed_tasks` | `windows_exchange_workload_completed_tasks_total` | Same value | +| `windows_exchange_workload_yielded_tasks` | `windows_exchange_workload_yielded_tasks_total` | Same value | +| `windows_gpu_engine_time_seconds` | `windows_gpu_engine_time_seconds_total` | Same value | +| `windows_hyperv_virtual_network_adapter_drop_reasons` | `windows_hyperv_virtual_network_adapter_drop_reasons_total` | Same value | +| `windows_hyperv_virtual_smb_flush_requests` | `windows_hyperv_virtual_smb_flush_requests_total` | Same value | +| `windows_hyperv_virtual_smb_read_bytes` | `windows_hyperv_virtual_smb_read_bytes_total` | Same value | +| `windows_hyperv_virtual_smb_read_requests` | `windows_hyperv_virtual_smb_read_requests_total` | Same value | +| `windows_hyperv_virtual_smb_received_bytes` | `windows_hyperv_virtual_smb_received_bytes_total` | Same value | +| `windows_hyperv_virtual_smb_requests` | `windows_hyperv_virtual_smb_requests_total` | Same value | +| `windows_hyperv_virtual_smb_sent_bytes` | `windows_hyperv_virtual_smb_sent_bytes_total` | Same value | +| `windows_hyperv_virtual_smb_write_bytes` | `windows_hyperv_virtual_smb_write_bytes_total` | Same value | +| `windows_hyperv_virtual_smb_write_requests` | `windows_hyperv_virtual_smb_write_requests_total` | Same value | +| `windows_mssql_accessmethods_au_batch_cleanup_failures` | `windows_mssql_accessmethods_au_batch_cleanup_failures_total` | Same value | +| `windows_mssql_accessmethods_au_batch_cleanups` | `windows_mssql_accessmethods_au_batch_cleanups_total` | Same value | +| `windows_mssql_accessmethods_au_cleanups` | `windows_mssql_accessmethods_au_cleanups_total` | Same value | +| `windows_mssql_accessmethods_by_reference_lob_creates` | `windows_mssql_accessmethods_by_reference_lob_creates_total` | Same value | +| `windows_mssql_accessmethods_by_reference_lob_uses` | `windows_mssql_accessmethods_by_reference_lob_uses_total` | Same value | +| `windows_mssql_accessmethods_column_value_pulls` | `windows_mssql_accessmethods_column_value_pulls_total` | Same value | +| `windows_mssql_accessmethods_column_value_pushes` | `windows_mssql_accessmethods_column_value_pushes_total` | Same value | +| `windows_mssql_accessmethods_dropped_rowset_cleanups` | `windows_mssql_accessmethods_dropped_rowset_cleanups_total` | Same value | +| `windows_mssql_accessmethods_dropped_rowset_skips` | `windows_mssql_accessmethods_dropped_rowset_skips_total` | Same value | +| `windows_mssql_accessmethods_extent_allocations` | `windows_mssql_accessmethods_extent_allocations_total` | Same value | +| `windows_mssql_accessmethods_extent_deallocations` | `windows_mssql_accessmethods_extent_deallocations_total` | Same value | +| `windows_mssql_accessmethods_forwarded_records` | `windows_mssql_accessmethods_forwarded_records_total` | Same value | +| `windows_mssql_accessmethods_free_space_page_fetches` | `windows_mssql_accessmethods_free_space_page_fetches_total` | Same value | +| `windows_mssql_accessmethods_free_space_scans` | `windows_mssql_accessmethods_free_space_scans_total` | Same value | +| `windows_mssql_accessmethods_full_scans` | `windows_mssql_accessmethods_full_scans_total` | Same value | +| `windows_mssql_accessmethods_ghost_record_skips` | `windows_mssql_accessmethods_ghost_record_skips_total` | Same value | +| `windows_mssql_accessmethods_index_searches` | `windows_mssql_accessmethods_index_searches_total` | Same value | +| `windows_mssql_accessmethods_insysxact_waits` | `windows_mssql_accessmethods_insysxact_waits_total` | Same value | +| `windows_mssql_accessmethods_leaf_page_cookie_failures` | `windows_mssql_accessmethods_leaf_page_cookie_failures_total` | Same value | +| `windows_mssql_accessmethods_leaf_page_cookie_uses` | `windows_mssql_accessmethods_leaf_page_cookie_uses_total` | Same value | +| `windows_mssql_accessmethods_lob_handle_creates` | `windows_mssql_accessmethods_lob_handle_creates_total` | Same value | +| `windows_mssql_accessmethods_lob_handle_destroys` | `windows_mssql_accessmethods_lob_handle_destroys_total` | Same value | +| `windows_mssql_accessmethods_lob_read_aheads` | `windows_mssql_accessmethods_lob_read_aheads_total` | Same value | +| `windows_mssql_accessmethods_lob_ss_provider_creates` | `windows_mssql_accessmethods_lob_ss_provider_creates_total` | Same value | +| `windows_mssql_accessmethods_lob_ss_provider_destroys` | `windows_mssql_accessmethods_lob_ss_provider_destroys_total` | Same value | +| `windows_mssql_accessmethods_lob_ss_provider_truncations` | `windows_mssql_accessmethods_lob_ss_provider_truncations_total` | Same value | +| `windows_mssql_accessmethods_mixed_page_allocations` | `windows_mssql_accessmethods_mixed_page_allocations_total` | Same value | +| `windows_mssql_accessmethods_page_allocations` | `windows_mssql_accessmethods_page_allocations_total` | Same value | +| `windows_mssql_accessmethods_page_compression_attempts` | `windows_mssql_accessmethods_page_compression_attempts_total` | Same value | +| `windows_mssql_accessmethods_page_compressions` | `windows_mssql_accessmethods_page_compressions_total` | Same value | +| `windows_mssql_accessmethods_page_deallocations` | `windows_mssql_accessmethods_page_deallocations_total` | Same value | +| `windows_mssql_accessmethods_page_splits` | `windows_mssql_accessmethods_page_splits_total` | Same value | +| `windows_mssql_accessmethods_probe_scans` | `windows_mssql_accessmethods_probe_scans_total` | Same value | +| `windows_mssql_accessmethods_range_scans` | `windows_mssql_accessmethods_range_scans_total` | Same value | +| `windows_mssql_accessmethods_scan_point_revalidations` | `windows_mssql_accessmethods_scan_point_revalidations_total` | Same value | +| `windows_mssql_accessmethods_table_lock_escalations` | `windows_mssql_accessmethods_table_lock_escalations_total` | Same value | +| `windows_mssql_accessmethods_tree_page_cookie_failures` | `windows_mssql_accessmethods_tree_page_cookie_failures_total` | Same value | +| `windows_mssql_accessmethods_tree_page_cookie_uses` | `windows_mssql_accessmethods_tree_page_cookie_uses_total` | Same value | +| `windows_mssql_accessmethods_workfile_creates` | `windows_mssql_accessmethods_workfile_creates_total` | Same value | +| `windows_mssql_accessmethods_worktables_creates` | `windows_mssql_accessmethods_worktables_creates_total` | Same value | +| `windows_mssql_accessmethods_worktables_from_cache_hits` | `windows_mssql_accessmethods_worktables_from_cache_hits_total` | Same value | +| `windows_mssql_accessmethods_worktables_from_cache_lookups` | `windows_mssql_accessmethods_worktables_from_cache_lookups_total` | Same value | +| `windows_mssql_availreplica_flow_control_wait_seconds` | `windows_mssql_availreplica_flow_control_wait_seconds_total` | Same value | +| `windows_mssql_availreplica_initiated_flow_controls` | `windows_mssql_availreplica_initiated_flow_controls_total` | Same value | +| `windows_mssql_availreplica_received_from_replica_bytes` | `windows_mssql_availreplica_received_from_replica_bytes_total` | Same value | +| `windows_mssql_availreplica_receives_from_replica` | `windows_mssql_availreplica_receives_from_replica_total` | Same value | +| `windows_mssql_availreplica_resent_messages` | `windows_mssql_availreplica_resent_messages_total` | Same value | +| `windows_mssql_availreplica_sends_to_replica` | `windows_mssql_availreplica_sends_to_replica_total` | Same value | +| `windows_mssql_availreplica_sends_to_transport` | `windows_mssql_availreplica_sends_to_transport_total` | Same value | +| `windows_mssql_availreplica_sent_to_replica_bytes` | `windows_mssql_availreplica_sent_to_replica_bytes_total` | Same value | +| `windows_mssql_availreplica_sent_to_transport_bytes` | `windows_mssql_availreplica_sent_to_transport_bytes_total` | Same value | +| `windows_mssql_bufman_background_writer_pages` | `windows_mssql_bufman_background_writer_pages_total` | Same value | +| `windows_mssql_bufman_checkpoint_pages` | `windows_mssql_bufman_checkpoint_pages_total` | Same value | +| `windows_mssql_bufman_extension_page_evictions` | `windows_mssql_bufman_extension_page_evictions_total` | Same value | +| `windows_mssql_bufman_extension_page_reads` | `windows_mssql_bufman_extension_page_reads_total` | Same value | +| `windows_mssql_bufman_extension_page_writes` | `windows_mssql_bufman_extension_page_writes_total` | Same value | +| `windows_mssql_bufman_free_list_stalls` | `windows_mssql_bufman_free_list_stalls_total` | Same value | +| `windows_mssql_bufman_lazywrites` | `windows_mssql_bufman_lazywrites_total` | Same value | +| `windows_mssql_bufman_page_lookups` | `windows_mssql_bufman_page_lookups_total` | Same value | +| `windows_mssql_bufman_page_reads` | `windows_mssql_bufman_page_reads_total` | Same value | +| `windows_mssql_bufman_page_writes` | `windows_mssql_bufman_page_writes_total` | Same value | +| `windows_mssql_bufman_read_ahead_issuing_seconds` | `windows_mssql_bufman_read_ahead_issuing_seconds_total` | Seconds instead of microseconds | +| `windows_mssql_bufman_read_ahead_pages` | `windows_mssql_bufman_read_ahead_pages_total` | Same value | +| `windows_mssql_databases_backup_restore_operations` | `windows_mssql_databases_backup_restore_operations_total` | Same value | +| `windows_mssql_databases_bulk_copy_bytes` | `windows_mssql_databases_bulk_copy_bytes_total` | Same value | +| `windows_mssql_databases_bulk_copy_rows` | `windows_mssql_databases_bulk_copy_rows_total` | Same value | +| `windows_mssql_databases_dbcc_logical_scan_bytes` | `windows_mssql_databases_dbcc_logical_scan_bytes_total` | Same value | +| `windows_mssql_databases_group_commit_stall_seconds` | `windows_mssql_databases_group_commit_stall_seconds_total` | Same value | +| `windows_mssql_databases_log_cache_reads` | `windows_mssql_databases_log_cache_reads_total` | Same value | +| `windows_mssql_databases_log_flush_waits` | `windows_mssql_databases_log_flush_waits_total` | Same value | +| `windows_mssql_databases_log_flushed_bytes` | `windows_mssql_databases_log_flushed_bytes_total` | Same value | +| `windows_mssql_databases_log_flushes` | `windows_mssql_databases_log_flushes_total` | Same value | +| `windows_mssql_databases_log_pool_cache_misses` | `windows_mssql_databases_log_pool_cache_misses_total` | Same value | +| `windows_mssql_databases_log_pool_disk_reads` | `windows_mssql_databases_log_pool_disk_reads_total` | Same value | +| `windows_mssql_databases_log_pool_empty_free_pool_pushes` | `windows_mssql_databases_log_pool_empty_free_pool_pushes_total` | Same value | +| `windows_mssql_databases_log_pool_hash_deletes` | `windows_mssql_databases_log_pool_hash_deletes_total` | Same value | +| `windows_mssql_databases_log_pool_hash_inserts` | `windows_mssql_databases_log_pool_hash_inserts_total` | Same value | +| `windows_mssql_databases_log_pool_invalid_hash_entries` | `windows_mssql_databases_log_pool_invalid_hash_entries_total` | Same value | +| `windows_mssql_databases_log_pool_log_scan_pushes` | `windows_mssql_databases_log_pool_log_scan_pushes_total` | Same value | +| `windows_mssql_databases_log_pool_log_writer_pushes` | `windows_mssql_databases_log_pool_log_writer_pushes_total` | Same value | +| `windows_mssql_databases_log_pool_low_memory_pushes` | `windows_mssql_databases_log_pool_low_memory_pushes_total` | Same value | +| `windows_mssql_databases_log_pool_no_free_buffer_pushes` | `windows_mssql_databases_log_pool_no_free_buffer_pushes_total` | Same value | +| `windows_mssql_databases_log_pool_req_behind_trunc` | `windows_mssql_databases_log_pool_req_behind_trunc_total` | Same value | +| `windows_mssql_databases_log_pool_requests` | `windows_mssql_databases_log_pool_requests_total` | Same value | +| `windows_mssql_databases_log_pool_requests_old_vlf` | `windows_mssql_databases_log_pool_requests_old_vlf_total` | Same value | +| `windows_mssql_databases_repl_transactions` | `windows_mssql_databases_repl_transactions_total` | Same value | +| `windows_mssql_databases_shrink_data_movement_bytes` | `windows_mssql_databases_shrink_data_movement_bytes_total` | Same value | +| `windows_mssql_databases_tracked_transactions` | `windows_mssql_databases_tracked_transactions_total` | Same value | +| `windows_mssql_databases_transactions` | `windows_mssql_databases_transactions_total` | Same value | +| `windows_mssql_databases_write_transactions` | `windows_mssql_databases_write_transactions_total` | Same value | +| `windows_mssql_databases_xtp_controller_log_processed_bytes` | `windows_mssql_databases_xtp_controller_log_processed_bytes_total` | Same value | +| `windows_mssql_dbreplica_database_initiated_flow_controls` | `windows_mssql_dbreplica_database_initiated_flow_controls_total` | Same value | +| `windows_mssql_dbreplica_group_commits` | `windows_mssql_dbreplica_group_commits_total` | Same value | +| `windows_mssql_dbreplica_log_compressed_bytes` | `windows_mssql_dbreplica_log_compressed_bytes_total` | Same value | +| `windows_mssql_dbreplica_log_compression_cachehits` | `windows_mssql_dbreplica_log_compression_cachehits_total` | Same value | +| `windows_mssql_dbreplica_log_compression_cachemisses` | `windows_mssql_dbreplica_log_compression_cachemisses_total` | Same value | +| `windows_mssql_dbreplica_log_compressions` | `windows_mssql_dbreplica_log_compressions_total` | Same value | +| `windows_mssql_dbreplica_log_decompressed_bytes` | `windows_mssql_dbreplica_log_decompressed_bytes_total` | Same value | +| `windows_mssql_dbreplica_log_decompressions` | `windows_mssql_dbreplica_log_decompressions_total` | Same value | +| `windows_mssql_dbreplica_log_received_bytes` | `windows_mssql_dbreplica_log_received_bytes_total` | Same value | +| `windows_mssql_dbreplica_mirrored_write_transactions` | `windows_mssql_dbreplica_mirrored_write_transactions_total` | Same value | +| `windows_mssql_dbreplica_received_file_bytes` | `windows_mssql_dbreplica_received_file_bytes_total` | Same value | +| `windows_mssql_dbreplica_redo_blocks` | `windows_mssql_dbreplica_redo_blocks_total` | Same value | +| `windows_mssql_dbreplica_redone_bytes` | `windows_mssql_dbreplica_redone_bytes_total` | Same value | +| `windows_mssql_dbreplica_redones` | `windows_mssql_dbreplica_redones_total` | Same value | +| `windows_mssql_genstats_connection_resets` | `windows_mssql_genstats_connection_resets_total` | Same value | +| `windows_mssql_genstats_logins` | `windows_mssql_genstats_logins_total` | Same value | +| `windows_mssql_genstats_logouts` | `windows_mssql_genstats_logouts_total` | Same value | +| `windows_mssql_genstats_non_atomic_yields` | `windows_mssql_genstats_non_atomic_yields_total` | Same value | +| `windows_mssql_genstats_temp_tables_creations` | `windows_mssql_genstats_temp_tables_creations_total` | Same value | +| `windows_mssql_locks_deadlocks` | `windows_mssql_locks_deadlocks_total` | Same value | +| `windows_mssql_locks_lock_requests` | `windows_mssql_locks_lock_requests_total` | Same value | +| `windows_mssql_locks_lock_timeouts` | `windows_mssql_locks_lock_timeouts_total` | Same value | +| `windows_mssql_locks_lock_waits` | `windows_mssql_locks_lock_waits_total` | Same value | +| `windows_mssql_sqlstats_auto_parameterization_attempts` | `windows_mssql_sqlstats_auto_parameterization_attempts_total` | Same value | +| `windows_mssql_sqlstats_batch_requests` | `windows_mssql_sqlstats_batch_requests_total` | Same value | +| `windows_mssql_sqlstats_failed_auto_parameterization_attempts` | `windows_mssql_sqlstats_failed_auto_parameterization_attempts_total` | Same value | +| `windows_mssql_sqlstats_forced_parameterizations` | `windows_mssql_sqlstats_forced_parameterizations_total` | Same value | +| `windows_mssql_sqlstats_guided_plan_executions` | `windows_mssql_sqlstats_guided_plan_executions_total` | Same value | +| `windows_mssql_sqlstats_misguided_plan_executions` | `windows_mssql_sqlstats_misguided_plan_executions_total` | Same value | +| `windows_mssql_sqlstats_safe_auto_parameterization_attempts` | `windows_mssql_sqlstats_safe_auto_parameterization_attempts_total` | Same value | +| `windows_mssql_sqlstats_sql_attentions` | `windows_mssql_sqlstats_sql_attentions_total` | Same value | +| `windows_mssql_sqlstats_sql_compilations` | `windows_mssql_sqlstats_sql_compilations_total` | Same value | +| `windows_mssql_sqlstats_sql_recompilations` | `windows_mssql_sqlstats_sql_recompilations_total` | Same value | +| `windows_mssql_sqlstats_unsafe_auto_parameterization_attempts` | `windows_mssql_sqlstats_unsafe_auto_parameterization_attempts_total` | Same value | +| `windows_mssql_transactions_version_store_creation_units` | `windows_mssql_transactions_version_store_creation_units_total` | Same value | +| `windows_mssql_transactions_version_store_truncation_units` | `windows_mssql_transactions_version_store_truncation_units_total` | Same value | +| `windows_nps_access_accepts` | `windows_nps_access_accepts_total` | Same value | +| `windows_nps_access_bad_authenticators` | `windows_nps_access_bad_authenticators_total` | Same value | +| `windows_nps_access_challenges` | `windows_nps_access_challenges_total` | Same value | +| `windows_nps_access_dropped_packets` | `windows_nps_access_dropped_packets_total` | Same value | +| `windows_nps_access_invalid_requests` | `windows_nps_access_invalid_requests_total` | Same value | +| `windows_nps_access_malformed_packets` | `windows_nps_access_malformed_packets_total` | Same value | +| `windows_nps_access_packets_received` | `windows_nps_access_packets_received_total` | Same value | +| `windows_nps_access_packets_sent` | `windows_nps_access_packets_sent_total` | Same value | +| `windows_nps_access_rejects` | `windows_nps_access_rejects_total` | Same value | +| `windows_nps_access_requests` | `windows_nps_access_requests_total` | Same value | +| `windows_nps_access_unknown_type` | `windows_nps_access_unknown_type_total` | Same value | +| `windows_nps_accounting_bad_authenticators` | `windows_nps_accounting_bad_authenticators_total` | Same value | +| `windows_nps_accounting_dropped_packets` | `windows_nps_accounting_dropped_packets_total` | Same value | +| `windows_nps_accounting_invalid_requests` | `windows_nps_accounting_invalid_requests_total` | Same value | +| `windows_nps_accounting_malformed_packets` | `windows_nps_accounting_malformed_packets_total` | Same value | +| `windows_nps_accounting_no_record` | `windows_nps_accounting_no_record_total` | Same value | +| `windows_nps_accounting_packets_received` | `windows_nps_accounting_packets_received_total` | Same value | +| `windows_nps_accounting_packets_sent` | `windows_nps_accounting_packets_sent_total` | Same value | +| `windows_nps_accounting_requests` | `windows_nps_accounting_requests_total` | Same value | +| `windows_nps_accounting_responses` | `windows_nps_accounting_responses_total` | Same value | +| `windows_nps_accounting_unknown_type` | `windows_nps_accounting_unknown_type_total` | Same value | + ## Corrected values These metrics keep their names, but 0.31 reported wrong values. Graphs show a step at the upgrade. @@ -354,14 +691,13 @@ These metrics keep their names, but 0.31 reported wrong values. Graphs show a st - `windows_ad_directory_operations_total{operation="write",origin="local_security_authority"}` now counts directory writes from the LSA. In 0.31 it repeated the LSA search count. - `windows_ad_sam_computer_creation_requests_total` and `windows_ad_sam_computer_creation_successful_requests_total` were swapped in 0.31. Requests now count all attempts, successful requests only the successful ones. - `windows_adfs_db_artifact_query_time_seconds_total` and `windows_adfs_db_config_query_time_seconds_total` are now in seconds. 0.31 scaled the raw ticks by a fixed `1e-8`, so on a typical 10 MHz time base the values were 10 times too small. The new `windows_adfs_db_artifact_queries_total` and `windows_adfs_db_config_queries_total` count the queries, so you can compute the average query time. -- `windows_mssql_databases_xtp_controller_dlc_peak_latency_seconds`, `windows_mssql_bufman_read_ahead_issuing_seconds`, `windows_mssql_dbreplica_database_flow_control_wait_seconds_total` and `windows_mssql_dbreplica_group_commit_stall_seconds_total` (renamed, see above) are now in seconds. SQL Server reports microseconds, which 0.31 did not convert correctly. `windows_mssql_databases_xtp_controller_dlc_fetch_latency_seconds_total` is converted from microseconds as well. -- `windows_mssql_locks_count_total` (renamed from `windows_mssql_locks_count`) is no longer divided by 1000. -- `windows_mssql_dbreplica_redo_remaining_bytes` is now in bytes. 0.31 exported kilobytes. The other renamed `windows_mssql_dbreplica_*_bytes` metrics are converted from kilobytes too. +- `windows_mssql_databases_xtp_controller_dlc_peak_latency_seconds`, `windows_mssql_bufman_read_ahead_issuing_seconds_total` (renamed, see [Base units and counter names](#base-units-and-counter-names)), `windows_mssql_dbreplica_database_flow_control_wait_seconds_total` and `windows_mssql_dbreplica_group_commit_stall_seconds_total` (renamed, see above) are now in seconds. SQL Server reports microseconds, which 0.31 did not convert correctly. `windows_mssql_databases_xtp_controller_dlc_fetch_latency_seconds_total` is converted from microseconds as well. +- `windows_mssql_dbreplica_redo_remaining_bytes` is now in bytes. 0.31 exported kilobytes. The queue and undo metrics renamed to `windows_mssql_dbreplica_*_bytes` are converted from kilobytes too; the `_bytes_total` counters are unchanged. - `windows_dhcp_denied_due_to_nonmatch_total` now counts denials due to a non-match. In 0.31 it repeated the match denial count. - `windows_remote_fx_gfx_frames_skipped_insufficient_resource_total` with `resource="client"` and `resource="server"` now count the matching frames. In 0.31 the two label values were swapped. - `windows_dns_zone_transfer_requests_sent_total{qtype="soa"}` now counts zone transfer SOA requests sent. In 0.31 it reported zone transfer requests received. - `windows_dns_zone_transfer_success_received_total{qtype="incremental",protocol="udp"}` now counts successful UDP incremental zone transfers. In 0.31 it repeated the TCP count. -- `windows_netframework_clrmemory_gc_time_percent` no longer overflows, and it is left out when Windows reports no base value. The `netframework` collector now reads the CLR counters through PDH instead of WMI; names, labels and types are unchanged. +- `windows_netframework_clrmemory_gc_time_ratio` (renamed from `windows_netframework_clrmemory_gc_time_percent`) no longer overflows, and it is left out when Windows reports no base value. The `netframework` collector now reads the CLR counters through PDH instead of WMI; labels are unchanged, see [Base units and counter names](#base-units-and-counter-names) for the renamed metrics. - The IIS URI cache flush and kernel cache item metrics read the right Windows counters, and the metadata cache hit metrics are no longer always `0`. - `windows_pagefile_limit_bytes` and `windows_pagefile_free_bytes` read the paging file size from the `Paging File` counter instead of the file system. In 0.31 a paging file that could not be read reported a size of `0` and a negative free space; it is now left out. - `windows_logical_disk_readonly`, the FSRM quota template information, the SMTP general failure totals and the Hyper-V root partition interrupt mappings were documented but never exported. They are exported now. @@ -397,7 +733,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. -Metric names, labels and configuration are unchanged. A property that can't be read is left out and reported as a collection error, instead of being exported as `0`. +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`. ## Scrape timeouts diff --git a/cmd/windows_exporter/main_test.go b/cmd/windows_exporter/main_test.go index 34302d24..be5408fd 100644 --- a/cmd/windows_exporter/main_test.go +++ b/cmd/windows_exporter/main_test.go @@ -330,7 +330,7 @@ func TestScrapeStdout(t *testing.T) { output := buf.String() // Must contain collector metrics. - require.Contains(t, output, "windows_cpu_time_total") + require.Contains(t, output, "windows_cpu_time_seconds_total") // Must contain exporter build info (proves the HTTP handler path is used). require.Contains(t, output, "windows_exporter_build_info") // Must contain collector success metadata. diff --git a/contrib/mixin/dashboards/cpu.libsonnet b/contrib/mixin/dashboards/cpu.libsonnet index a4efb5d9..01552d25 100644 --- a/contrib/mixin/dashboards/cpu.libsonnet +++ b/contrib/mixin/dashboards/cpu.libsonnet @@ -1,7 +1,7 @@ local b = import 'builders.libsonnet'; local host = '{job=~"$job", instance="$instance"}'; local cores = 'scalar(max(windows_cpu_logical_processor' + host + '))'; -local mode(m) = 'sum(rate(windows_cpu_time_total{job=~"$job", instance="$instance", mode="' + m + '"}[$__rate_interval])) / ' + cores; +local mode(m) = 'sum(rate(windows_cpu_time_seconds_total{job=~"$job", instance="$instance", mode="' + m + '"}[$__rate_interval])) / ' + cores; function(on) b.tab( @@ -13,7 +13,7 @@ function(on) if on('cpu') then b.row('System calls and frequency', b.flow([if on('system') then [29, 12, 8], [30, 12, 8]])), ]), [ - b.stat(160, 'CPU busy', 'Non-idle CPU time averaged across logical processors.', '1 - avg(clamp_max(rate(windows_cpu_time_total{job=~"$job", instance="$instance", mode="idle"}[$__rate_interval]), 1))', 'percentunit', steps=b.levels(0.8, 0.9)) + b.stat(160, 'CPU busy', 'Non-idle CPU time averaged across logical processors.', '1 - avg(clamp_max(rate(windows_cpu_time_seconds_total{job=~"$job", instance="$instance", mode="idle"}[$__rate_interval]), 1))', 'percentunit', steps=b.levels(0.8, 0.9)) + b.panel.withDefaults({ decimals: 1, max: 1, min: 0 }), b.stat(161, 'User', 'CPU time spent in user mode, as a share of all logical processors.', mode('user'), 'percentunit') + b.panel.withDefaults({ decimals: 1, min: 0 }), @@ -22,12 +22,12 @@ function(on) b.stat(163, 'Queue per CPU', 'Threads waiting for a CPU per logical processor. A sustained value above 2 indicates CPU contention.', 'windows_system_processor_queue_length' + host + ' / ' + cores, 'short', steps=b.levels(1, 2)) + b.panel.withDefaults({ decimals: 2, min: 0 }), b.stat(164, 'Ctx switches', 'Context switches per second across the host.', 'rate(windows_system_context_switches_total' + host + '[$__rate_interval])', 'ops'), - b.stat(165, 'Frequency', 'Average effective frequency across logical processors. Values above the nominal frequency mean turbo boost.', 'avg(1e4 * windows_cpu_core_frequency_mhz' + host + ' * rate(windows_cpu_processor_performance_total' + host + '[$__rate_interval]) / rate(windows_cpu_processor_mperf_total' + host + '[$__rate_interval]))', 'hertz'), + b.stat(165, 'Frequency', 'Average effective frequency across logical processors. Values above the nominal frequency mean turbo boost.', 'avg(1e-2 * windows_cpu_core_frequency_hertz' + host + ' * rate(windows_cpu_processor_performance_total' + host + '[$__rate_interval]) / rate(windows_cpu_processor_mperf_total' + host + '[$__rate_interval]))', 'hertz'), b.panel.new(24, 'CPU utilization by mode', 'timeseries') + b.panel.withDescription('Share of total CPU time across all logical processors.') + b.panel.withQueries([ - b.query.new('sum by (mode) (rate(windows_cpu_time_total{job=~"$job", instance="$instance", mode!="idle"}[$__rate_interval])) / scalar(count(windows_cpu_time_total{job=~"$job", instance="$instance", mode="idle"}))', 'A') + b.query.new('sum by (mode) (rate(windows_cpu_time_seconds_total{job=~"$job", instance="$instance", mode!="idle"}[$__rate_interval])) / scalar(count(windows_cpu_time_seconds_total{job=~"$job", instance="$instance", mode="idle"}))', 'A') + b.query.withLegendFormat('{{mode}}'), ]) + b.panel.withDefaults({ @@ -44,7 +44,7 @@ function(on) b.panel.new(25, 'CPU utilization per core', 'state-timeline') + b.panel.withDescription('Busy time of each logical processor, labelled processor group,core. Green is idle, red is fully busy.') + b.panel.withQueries([ - b.query.new('label_replace(clamp(1 - rate(windows_cpu_time_total{job=~"$job", instance="$instance", mode="idle"}[$__rate_interval]), 0, 1), "core", "$1,0$2", "core", "(\\\\d+),(\\\\d)")', 'A') + b.query.new('label_replace(clamp(1 - rate(windows_cpu_time_seconds_total{job=~"$job", instance="$instance", mode="idle"}[$__rate_interval]), 0, 1), "core", "$1,0$2", "core", "(\\\\d+),(\\\\d)")', 'A') + b.query.withLegendFormat('{{core}}'), ]) + b.panel.withDefaults({ @@ -151,11 +151,11 @@ function(on) b.panel.new(30, 'CPU frequency', 'timeseries') + b.panel.withDescription('Effective frequency from the APERF/MPERF counters, averaged and maximum across logical processors, against the nominal frequency. Values above nominal mean turbo boost.') + b.panel.withQueries([ - b.query.new('avg(1e4 * windows_cpu_core_frequency_mhz{job=~"$job", instance="$instance"} * rate(windows_cpu_processor_performance_total{job=~"$job", instance="$instance"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~"$job", instance="$instance"}[$__rate_interval]))', 'A') + b.query.new('avg(1e-2 * windows_cpu_core_frequency_hertz{job=~"$job", instance="$instance"} * rate(windows_cpu_processor_performance_total{job=~"$job", instance="$instance"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~"$job", instance="$instance"}[$__rate_interval]))', 'A') + b.query.withLegendFormat('average'), - b.query.new('max(1e4 * windows_cpu_core_frequency_mhz{job=~"$job", instance="$instance"} * rate(windows_cpu_processor_performance_total{job=~"$job", instance="$instance"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~"$job", instance="$instance"}[$__rate_interval]))', 'B') + b.query.new('max(1e-2 * windows_cpu_core_frequency_hertz{job=~"$job", instance="$instance"} * rate(windows_cpu_processor_performance_total{job=~"$job", instance="$instance"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~"$job", instance="$instance"}[$__rate_interval]))', 'B') + b.query.withLegendFormat('maximum'), - b.query.new('avg(windows_cpu_core_frequency_mhz{job=~"$job", instance="$instance"}) * 1e6', 'C') + b.query.new('avg(windows_cpu_core_frequency_hertz{job=~"$job", instance="$instance"})', 'C') + b.query.withLegendFormat('nominal'), ]) + b.panel.withDefaults({ diff --git a/contrib/mixin/dashboards/disk.libsonnet b/contrib/mixin/dashboards/disk.libsonnet index 033bfb90..4d32382b 100644 --- a/contrib/mixin/dashboards/disk.libsonnet +++ b/contrib/mixin/dashboards/disk.libsonnet @@ -392,7 +392,7 @@ function(on) b.joinedTable(202, 'Drives', 'Model, size, partitions and operational status of each drive. Requires the diskdrive collector.', 'disk', [ 'max by (disk, model) (' + drive('info') + ')', - 'max by (disk) (' + drive('size') + ')', + 'max by (disk) (' + drive('size_bytes') + ')', 'max by (disk) (' + drive('partitions') + ')', 'max by (disk, status) (' + drive('status') + ' == 1)', ], [['disk', 'Disk'], ['model', 'Model'], ['Value #B', 'Size'], ['Value #C', 'Partitions'], ['status', 'Status']], [ @@ -444,10 +444,10 @@ function(on) '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_percent') + ')', + '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']], [ health, - { matcher: { id: 'byName', options: 'Efficiency' }, properties: [{ id: 'unit', value: 'percent' }, { id: 'decimals', value: 1 }] }, + { 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}}']]) diff --git a/contrib/mixin/dashboards/fleet.libsonnet b/contrib/mixin/dashboards/fleet.libsonnet index 43c01d60..4d436c65 100644 --- a/contrib/mixin/dashboards/fleet.libsonnet +++ b/contrib/mixin/dashboards/fleet.libsonnet @@ -2,7 +2,7 @@ local b = import 'builders.libsonnet'; local hosts = 'windows_os_hostname{job=~"$job", hostname=~"$hostname"}'; // Counts hosts matching expr, a vector by instance. Falls back to 0 while hosts are selected. local countHosts(expr) = 'count((' + expr + ') and on (instance) ' + hosts + ') or (0 * count(' + hosts + '))'; -local cpuBusy = '100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~"$job", mode="idle"}[$__rate_interval]), 1)))'; +local cpuBusy = '100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~"$job", mode="idle"}[$__rate_interval]), 1)))'; local memoryUsed = '100 * (1 - windows_memory_physical_free_bytes{job=~"$job"} / windows_memory_physical_total_bytes{job=~"$job"})'; local volumeFree = '100 * windows_logical_disk_free_bytes{job=~"$job", volume!~"HarddiskVolume.*"} / windows_logical_disk_size_bytes{job=~"$job", volume!~"HarddiskVolume.*"}'; local attention = [{ color: 'green', value: null }, { color: 'orange', value: 1 }]; @@ -49,7 +49,7 @@ function(on, config, overview=null) b.query.new('(max by (instance) (windows_cpu_logical_processor{job=~"$job"})) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'D') + b.query.withInstant() + b.query.withFormat('table'), - b.query.new('(100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~"$job", mode="idle"}[$__rate_interval]), 1)))) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'E') + b.query.new('(100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~"$job", mode="idle"}[$__rate_interval]), 1)))) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'E') + b.query.withInstant() + b.query.withFormat('table'), b.query.new('(max by (instance) (windows_memory_physical_total_bytes{job=~"$job"})) and on (instance) windows_os_hostname{job=~"$job", hostname=~"$hostname"}', 'F') @@ -643,7 +643,7 @@ function(on, config, overview=null) b.panel.new(3, 'CPU utilization', 'timeseries') + b.panel.withDescription('Shows the 25 highest hosts at each point in time.') + b.panel.withQueries([ - b.query.new('topk(25, (100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~"$job", mode="idle"}[$__rate_interval]), 1)))) * on (instance) group_left (hostname) max by (instance, hostname) (windows_os_hostname{job=~"$job", hostname=~"$hostname"}))', 'A') + b.query.new('topk(25, (100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~"$job", mode="idle"}[$__rate_interval]), 1)))) * on (instance) group_left (hostname) max by (instance, hostname) (windows_os_hostname{job=~"$job", hostname=~"$hostname"}))', 'A') + b.query.withLegendFormat('{{hostname}}'), ]) + b.panel.withDefaults({ diff --git a/contrib/mixin/dashboards/gpu.libsonnet b/contrib/mixin/dashboards/gpu.libsonnet index 6cf91372..f8fdd89d 100644 --- a/contrib/mixin/dashboards/gpu.libsonnet +++ b/contrib/mixin/dashboards/gpu.libsonnet @@ -12,7 +12,7 @@ function(on) if on('gpu') then b.row('Processes', b.flow([[60, 12, 8], [61, 12, 8], [128, 12, 8], [129, 12, 8], [130, 12, 8], [131, 12, 8]])), ]), [ - b.stat(184, 'Utilization', 'Utilization of the busiest engine on the busiest GPU.', 'max(clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(' + metric('engine_time_seconds') + '[$__rate_interval]))), 1))', 'percentunit', steps=b.levels(0.8, 0.9)) + b.stat(184, 'Utilization', 'Utilization of the busiest engine on the busiest GPU.', 'max(clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(' + metric('engine_time_seconds_total') + '[$__rate_interval]))), 1))', 'percentunit', steps=b.levels(0.8, 0.9)) + b.panel.withDefaults({ decimals: 1, max: 1, min: 0 }), b.stat(185, 'VRAM used', 'Dedicated GPU memory in use, summed over all GPUs.', perGpu('adapter_memory_dedicated_bytes'), 'bytes') + b.panel.withDefaults({ decimals: 1 }), @@ -30,7 +30,7 @@ function(on) b.query.new('max by (luid, name) (windows_gpu_info{job=~"$job", instance="$instance"})', 'A') + b.query.withInstant() + b.query.withFormat('table'), - b.query.new('clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds{job=~"$job", instance="$instance"}[$__rate_interval]))), 1)', 'B') + b.query.new('clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds_total{job=~"$job", instance="$instance"}[$__rate_interval]))), 1)', 'B') + b.query.withInstant() + b.query.withFormat('table'), b.query.new('max by (luid) (windows_gpu_adapter_memory_dedicated_bytes{job=~"$job", instance="$instance"})', 'C') @@ -208,7 +208,7 @@ function(on) b.panel.new(58, 'GPU utilization by engine type', 'timeseries') + b.panel.withDescription('Busiest engine of each engine type, as in Task Manager.') + b.panel.withQueries([ - b.query.new('clamp_max(max by (luid, engtype) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds{job=~"$job", instance="$instance"}[$__rate_interval]))), 1) * on (luid) group_left (name) max by (luid, name) (windows_gpu_info{job=~"$job", instance="$instance"})', 'A') + b.query.new('clamp_max(max by (luid, engtype) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds_total{job=~"$job", instance="$instance"}[$__rate_interval]))), 1) * on (luid) group_left (name) max by (luid, name) (windows_gpu_info{job=~"$job", instance="$instance"})', 'A') + b.query.withLegendFormat('{{name}} {{engtype}}'), ]) + b.panel.withDefaults({ @@ -260,7 +260,7 @@ function(on) b.panel.new(60, 'Top 10 processes by GPU utilization', 'timeseries') + b.panel.withDescription('Busiest GPU engine used by each process. Process names need the process collector; otherwise only the PID is shown.') + b.panel.withQueries([ - b.query.new('topk(10, (max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds{job=~"$job", instance="$instance"}[$__rate_interval]))) * on (process_id) group_left (process) max by (process_id, process) (windows_process_info{job=~"$job", instance="$instance"})) or on (process_id) max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds{job=~"$job", instance="$instance"}[$__rate_interval]))))', 'A') + b.query.new('topk(10, (max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds_total{job=~"$job", instance="$instance"}[$__rate_interval]))) * on (process_id) group_left (process) max by (process_id, process) (windows_process_info{job=~"$job", instance="$instance"})) or on (process_id) max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds_total{job=~"$job", instance="$instance"}[$__rate_interval]))))', 'A') + b.query.withLegendFormat('{{process}} ({{process_id}})'), ]) + b.panel.withDefaults({ diff --git a/contrib/mixin/dashboards/hyper_v.libsonnet b/contrib/mixin/dashboards/hyper_v.libsonnet index 380a6066..49c8d259 100644 --- a/contrib/mixin/dashboards/hyper_v.libsonnet +++ b/contrib/mixin/dashboards/hyper_v.libsonnet @@ -11,9 +11,9 @@ function(on) if on('hyperv') then b.row('Network', b.flow([[80, 8, 8], [81, 8, 8], [82, 8, 8]])), ]), [ - b.stat(63, 'Virtual machines', 'Needs the hyperv collector, which is not enabled by default.', 'sum(windows_hyperv_virtual_machine_health_total_count{job=~"$job", instance="$instance"})', 'short'), + b.stat(63, 'Virtual machines', 'Needs the hyperv collector, which is not enabled by default.', 'sum(windows_hyperv_virtual_machines{job=~"$job", instance="$instance"})', 'short'), - b.stat(64, 'VMs in critical health', 'Number of Hyper-V virtual machines reporting critical health. Inspect the affected VM and Hyper-V event logs; this requires the optional hyperv collector.', 'sum(windows_hyperv_virtual_machine_health_total_count{job=~"$job", instance="$instance", state="critical"})', steps=[{ color: 'green', value: null }, { color: 'red', value: 1 }]), + b.stat(64, 'VMs in critical health', 'Number of Hyper-V virtual machines reporting critical health. Inspect the affected VM and Hyper-V event logs; this requires the optional hyperv collector.', 'sum(windows_hyperv_virtual_machines{job=~"$job", instance="$instance", state="critical"})', steps=[{ color: 'green', value: null }, { color: 'red', value: 1 }]), b.panel.new(65, 'Hyper-V WMI', 'stat') + b.panel.withDescription('Whether the Hyper-V WMI namespace answers. When it stops answering, Hyper-V Manager and Failover Cluster Manager usually cannot manage the host.') @@ -52,17 +52,17 @@ function(on) unit: '', }), - b.stat(66, 'Logical processors', 'Number of host logical processors reported by Hyper-V. Use this as capacity context for host and virtual processor load; this requires the optional hyperv collector.', 'windows_hyperv_host_logical_processor_count{job=~"$job", instance="$instance"}', 'short'), + b.stat(66, 'Logical processors', 'Number of host logical processors reported by Hyper-V. Use this as capacity context for host and virtual processor load; this requires the optional hyperv collector.', 'windows_hyperv_host_logical_processors{job=~"$job", instance="$instance"}', 'short'), - b.stat(67, 'Virtual processors', 'Virtual processors assigned to all VMs.', 'windows_hyperv_total_vm_processor_count{job=~"$job", instance="$instance"}', 'short'), + b.stat(67, 'Virtual processors', 'Virtual processors assigned to all VMs.', 'windows_hyperv_assigned_vm_processors{job=~"$job", instance="$instance"}', 'short'), - b.stat(68, 'vCPU per logical CPU', 'Virtual processors assigned to VMs per logical processor of the host.', 'windows_hyperv_total_vm_processor_count{job=~"$job", instance="$instance"} / windows_hyperv_host_logical_processor_count{job=~"$job", instance="$instance"}', 'short') + b.stat(68, 'vCPU per logical CPU', 'Virtual processors assigned to VMs per logical processor of the host.', 'windows_hyperv_assigned_vm_processors{job=~"$job", instance="$instance"} / windows_hyperv_host_logical_processors{job=~"$job", instance="$instance"}', 'short') + b.panel.withDefaults({ decimals: 2 }), b.panel.new(69, 'Host CPU time by state', 'timeseries') + b.panel.withDescription('Share of all logical processors spent running guest code (VMs and the root partition) and in the hypervisor. With Hyper-V enabled, the CPU tab only sees the root partition.') + b.panel.withQueries([ - b.query.new('sum by (state) (rate(windows_hyperv_hypervisor_logical_processor_time_total{job=~"$job", instance="$instance", state!="idle"}[$__rate_interval])) / scalar(count(windows_hyperv_hypervisor_logical_processor_time_total{job=~"$job", instance="$instance", state="idle"}))', 'A') + b.query.new('sum by (state) (rate(windows_hyperv_hypervisor_logical_processor_time_seconds_total{job=~"$job", instance="$instance", state!="idle"}[$__rate_interval])) / scalar(count(windows_hyperv_hypervisor_logical_processor_time_seconds_total{job=~"$job", instance="$instance", state="idle"}))', 'A') + b.query.withLegendFormat('{{state}}'), ]) + b.panel.withDefaults({ @@ -79,7 +79,7 @@ function(on) b.panel.new(70, 'CPU usage per VM', 'timeseries') + b.panel.withDescription('Virtual processor run time of each VM as a share of all logical processors of the host.') + b.panel.withQueries([ - b.query.new('sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_total{job=~"$job", instance="$instance"}[$__rate_interval])) / scalar(max(windows_hyperv_host_logical_processor_count{job=~"$job", instance="$instance"}))', 'A') + b.query.new('sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total{job=~"$job", instance="$instance"}[$__rate_interval])) / scalar(max(windows_hyperv_host_logical_processors{job=~"$job", instance="$instance"}))', 'A') + b.query.withLegendFormat('{{vm}}'), ]) + b.panel.withDefaults({ @@ -168,9 +168,9 @@ function(on) b.panel.new(76, 'Virtual disk throughput', 'timeseries') + b.panel.withDescription('Reads are drawn below the axis.') + b.panel.withQueries([ - b.query.new('rate(windows_hyperv_virtual_storage_device_bytes_written{job=~"$job", instance="$instance"}[$__rate_interval])', 'A') + b.query.new('rate(windows_hyperv_virtual_storage_device_written_bytes_total{job=~"$job", instance="$instance"}[$__rate_interval])', 'A') + b.query.withLegendFormat('{{device}} write'), - b.query.new('rate(windows_hyperv_virtual_storage_device_bytes_read{job=~"$job", instance="$instance"}[$__rate_interval])', 'B') + b.query.new('rate(windows_hyperv_virtual_storage_device_read_bytes_total{job=~"$job", instance="$instance"}[$__rate_interval])', 'B') + b.query.withLegendFormat('{{device}} read'), ]) + b.panel.withDefaults({ @@ -222,7 +222,7 @@ function(on) + b.panel.withQueries([ b.query.new('rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total{job=~"$job", instance="$instance"}[$__rate_interval]) / rate(windows_hyperv_virtual_storage_device_throughput_total{job=~"$job", instance="$instance"}[$__rate_interval])', 'A') + b.query.withLegendFormat('{{device}} latency'), - b.query.new('rate(windows_hyperv_virtual_storage_device_error_count_total{job=~"$job", instance="$instance"}[$__rate_interval]) > 0', 'B') + b.query.new('rate(windows_hyperv_virtual_storage_device_errors_total{job=~"$job", instance="$instance"}[$__rate_interval]) > 0', 'B') + b.query.withLegendFormat('{{device}} errors'), ]) + b.panel.withDefaults({ diff --git a/contrib/mixin/dashboards/mssql.libsonnet b/contrib/mixin/dashboards/mssql.libsonnet index e1e138c6..e78b4936 100644 --- a/contrib/mixin/dashboards/mssql.libsonnet +++ b/contrib/mixin/dashboards/mssql.libsonnet @@ -38,9 +38,9 @@ function(on) [ b.stat(256, 'Sub-collector failures', 'mssql sub-collectors that failed at the last scrape for this SQL Server instance. The Exporter tab shows the scrape errors.' + requirement, 'count(' + metric('collector_success') + ' == 0) or (0 * count(' + metric('collector_success') + '))', steps=[{ color: 'green', value: null }, { color: 'red', value: 1 }]), b.stat(257, 'User connections', 'Users connected to the instance. Each user can have several connections.' + requirement, metric('genstats_user_connections')), - b.stat(258, 'Batch requests', 'Transact-SQL command batches received per second.' + requirement, rate('sqlstats_batch_requests'), 'reqps'), + b.stat(258, 'Batch requests', 'Transact-SQL command batches received per second.' + requirement, rate('sqlstats_batch_requests_total'), 'reqps'), b.stat(259, 'Blocked processes', 'Processes currently blocked by another process.' + requirement, metric('genstats_blocked_processes'), steps=[{ color: 'green', value: null }, { color: 'orange', value: 1 }]), - b.stat(260, 'Deadlocks', 'Lock requests per minute that resulted in a deadlock, across all lock resource types.' + requirement, '60 * sum(' + rate('locks_deadlocks') + ')', 'opm', steps=b.levels(0.1, 1)) + b.stat(260, 'Deadlocks', 'Lock requests per minute that resulted in a deadlock, across all lock resource types.' + requirement, '60 * sum(' + rate('locks_deadlocks_total') + ')', 'opm', steps=b.levels(0.1, 1)) + b.panel.withDefaults({ decimals: 1 }), b.stat(261, 'Pending memory grants', 'Processes waiting for a workspace memory grant to run a query. Values above zero mean queries wait for memory.' + requirement, metric('memmgr_pending_memory_grants'), steps=[{ color: 'green', value: null }, { color: 'orange', value: 1 }]), b.stat(262, 'Page life expectancy', 'Seconds a page stays in the buffer pool without references. A falling value means the buffer pool is under memory pressure.' + requirement, metric('bufman_page_life_expectancy_seconds'), 's'), @@ -48,27 +48,27 @@ function(on) + b.panel.withDefaults({ decimals: 1, max: 1, min: 0 }), b.graph(264, 'Batch requests and compilations', 'Transact-SQL batches, query compilations and recompilations per second. Many compilations per batch can indicate plans that are not reused.' + requirement, 'ops', [ - [rate('sqlstats_batch_requests'), 'batch requests'], - [rate('sqlstats_sql_compilations'), 'compilations'], - [rate('sqlstats_sql_recompilations'), 'recompilations'], - [rate('sqlstats_sql_attentions'), 'attentions'], + [rate('sqlstats_batch_requests_total'), 'batch requests'], + [rate('sqlstats_sql_compilations_total'), 'compilations'], + [rate('sqlstats_sql_recompilations_total'), 'recompilations'], + [rate('sqlstats_sql_attentions_total'), 'attentions'], ]), b.graph(265, 'Connections', 'Users connected to the instance, and logical connections to it. Each user can have several connections.' + requirement, 'short', [ [metric('genstats_user_connections'), 'users'], [metric('genstats_logical_connections'), 'logical connections'], ]), b.graph(266, 'Access methods', 'Index searches, unrestricted full scans and page splits per second. Full scans of large tables and many page splits can indicate missing indexes or a low fill factor.' + requirement, 'ops', [ - [rate('accessmethods_index_searches'), 'index searches'], - [rate('accessmethods_full_scans'), 'full scans'], - [rate('accessmethods_page_splits'), 'page splits'], + [rate('accessmethods_index_searches_total'), 'index searches'], + [rate('accessmethods_full_scans_total'), 'full scans'], + [rate('accessmethods_page_splits_total'), 'page splits'], ]), b.graph(267, 'SQL errors', 'Errors per second by error class.' + requirement, 'ops', [ ['sum by (resource) (' + rate('sql_errors_total') + ')', '{{resource}}'], ]), b.graph(268, 'Logins and logouts', 'Logins, logouts and connection resets from the connection pool per second. Logouts are drawn below the axis.' + requirement, 'ops', [ - [rate('genstats_logins'), 'logins'], - [rate('genstats_logouts'), 'logouts'], - [rate('genstats_connection_resets'), 'connection resets'], + [rate('genstats_logins_total'), 'logins'], + [rate('genstats_logouts_total'), 'logouts'], + [rate('genstats_connection_resets_total'), 'connection resets'], ], below='logouts'), b.graph(269, 'Wait time by wait class', 'Time sessions spent waiting per second, by wait class, over the most recent SQL Server sampling interval. 2 s means two sessions waited the whole second on average.' + requirement, 's', [ @@ -78,14 +78,14 @@ function(on) + b.panel.withDefaults({ custom: { fillOpacity: 40, stacking: { mode: 'normal' } } }) + b.panel.withOptions({ legend: { placement: 'right' } }), b.graph(270, 'Lock waits', 'Lock requests per second that had to wait, by lock resource type.' + requirement, 'ops', [ - ['sum by (resource) (' + rate('locks_lock_waits') + ')', '{{resource}}'], + ['sum by (resource) (' + rate('locks_lock_waits_total') + ')', '{{resource}}'], ]), b.graph(271, 'Average lock wait', 'Average wait time of the lock requests that waited, by lock resource type.' + requirement, 's', [ - ['sum by (resource) (' + rate('locks_wait_time_seconds_total') + ') / (sum by (resource) (' + rate('locks_count_total') + ') > 0)', '{{resource}}'], + ['sum by (resource) (' + rate('locks_wait_time_seconds_total') + ') / (sum by (resource) (' + rate('locks_lock_waits_total') + ') > 0)', '{{resource}}'], ]), b.graph(272, 'Deadlocks and lock timeouts', 'Lock requests per second that resulted in a deadlock or timed out, across all lock resource types. Timeouts exclude NOWAIT requests.' + requirement, 'ops', [ - ['sum(' + rate('locks_deadlocks') + ')', 'deadlocks'], - ['sum(' + rate('locks_lock_timeouts_excluding_NOWAIT') + ')', 'timeouts'], + ['sum(' + rate('locks_deadlocks_total') + ')', 'deadlocks'], + ['sum(' + rate('locks_lock_timeouts_excluding_nowait_total') + ')', 'timeouts'], ]), b.graph(273, 'Server memory', 'Memory the memory manager has committed, against the memory it can use. The total stays below the target when SQL Server needs no more memory.' + requirement, 'bytes', [ @@ -117,11 +117,11 @@ function(on) [metric('bufman_page_life_expectancy_seconds'), 'page life expectancy'], ]), b.graph(276, 'Buffer pool I/O', 'Bytes per second of all physical page writes and the parts written by checkpoints and the lazy writer, and of all page reads and the part read ahead. Reads are drawn below the axis.' + requirement, 'Bps', [ - [pageBytes + ' * ' + rate('bufman_page_writes'), 'writes'], - [pageBytes + ' * ' + rate('bufman_checkpoint_pages'), 'checkpoint writes'], - [pageBytes + ' * ' + rate('bufman_lazywrites'), 'lazy writes'], - [pageBytes + ' * ' + rate('bufman_page_reads'), 'reads'], - [pageBytes + ' * ' + rate('bufman_read_ahead_pages'), 'read-ahead reads'], + [pageBytes + ' * ' + rate('bufman_page_writes_total'), 'writes'], + [pageBytes + ' * ' + rate('bufman_checkpoint_pages_total'), 'checkpoint writes'], + [pageBytes + ' * ' + rate('bufman_lazywrites_total'), 'lazy writes'], + [pageBytes + ' * ' + rate('bufman_page_reads_total'), 'reads'], + [pageBytes + ' * ' + rate('bufman_read_ahead_pages_total'), 'read-ahead reads'], ], below='.*reads'), b.graph(277, 'Memory grants', 'Processes that received a workspace memory grant, and processes waiting for one.' + requirement, 'short', [ [metric('memmgr_outstanding_memory_grants'), 'granted'], @@ -131,17 +131,17 @@ function(on) b.joinedTable(278, 'Databases', 'Size, log usage and activity of each selected database.' + requirement, 'database', [ 'max by (database) (' + database('data_files_size_bytes') + ')', 'max by (database) (' + database('log_files_size_bytes') + ')', - 'max by (database) (' + database('log_used_percent') + ')', + 'max by (database) (' + database('log_used_ratio') + ')', 'max by (database) (' + database('active_transactions') + ')', - 'max by (database) (' + databaseRate('transactions') + ')', - 'max by (database) (' + databaseRate('write_transactions') + ')', + 'max by (database) (' + databaseRate('transactions_total') + ')', + 'max by (database) (' + databaseRate('write_transactions_total') + ')', ], [['database', 'Database'], ['Value #A', 'Data size'], ['Value #B', 'Log size'], ['Value #C', 'Log used'], ['Value #D', 'Active transactions'], ['Value #E', 'Transactions/s'], ['Value #F', 'Writes/s']], [ { matcher: { id: 'byName', options: 'Log used' }, properties: [ - { id: 'unit', value: 'percent' }, + { id: 'unit', value: 'percentunit' }, { id: 'min', value: 0 }, - { id: 'max', value: 100 }, + { id: 'max', value: 1 }, { id: 'decimals', value: 1 }, { id: 'custom.cellOptions', value: { mode: 'basic', type: 'gauge', valueDisplayMode: 'text' } }, ], @@ -152,18 +152,18 @@ function(on) b.graph(279, 'Data file size', 'Size of the data files of each selected database.' + requirement, 'bytes', [ ['max by (database) (' + database('data_files_size_bytes') + ')', '{{database}}'], ]), - b.graph(280, 'Log used', 'Share of the log files of each selected database in use. A log that stays full needs a log backup, a checkpoint or more space.' + requirement, 'percent', [ - ['max by (database) (' + database('log_used_percent') + ')', '{{database}}'], + b.graph(280, 'Log used', 'Share of the log files of each selected database in use. A log that stays full needs a log backup, a checkpoint or more space.' + requirement, 'percentunit', [ + ['max by (database) (' + database('log_used_ratio') + ')', '{{database}}'], ]) - + b.panel.withDefaults({ max: 100 }), + + b.panel.withDefaults({ max: 1 }), b.graph(281, 'Transactions', 'Transactions started per second in each selected database.' + requirement, 'ops', [ - ['max by (database) (' + databaseRate('transactions') + ')', '{{database}}'], + ['max by (database) (' + databaseRate('transactions_total') + ')', '{{database}}'], ]), b.graph(282, 'Log flushes', 'Bytes per second written to the transaction log of each selected database.' + requirement, 'Bps', [ - ['max by (database) (' + databaseRate('log_flushed_bytes') + ')', '{{database}}'], + ['max by (database) (' + databaseRate('log_flushed_bytes_total') + ')', '{{database}}'], ]), b.graph(283, 'Log flush write time', 'Average time to write a log flush to disk in each selected database. Commits wait for this write, so slow log storage slows every write transaction.' + requirement, 's', [ - ['max by (database) (' + databaseRate('log_flush_write_seconds_total') + ' / (' + databaseRate('log_flushes') + ' > 0))', '{{database}}'], + ['max by (database) (' + databaseRate('log_flush_write_seconds_total') + ' / (' + databaseRate('log_flushes_total') + ' > 0))', '{{database}}'], ]), b.graph(284, 'tempdb space', 'Free space in tempdb and the size of the version store kept in it for snapshot isolation and online index operations.' + requirement, 'bytes', [ @@ -185,8 +185,8 @@ function(on) ['max by (replica) (' + metric('dbreplica_recovery_queue_bytes') + ')', '{{replica}} redo queue'], ]), b.graph(288, 'Replica traffic', 'Bytes per second sent to and received from each availability replica. Received bytes are drawn below the axis.' + requirement, 'Bps', [ - ['max by (replica) (' + rate('availreplica_sent_to_replica_bytes') + ')', '{{replica}} sent'], - ['max by (replica) (' + rate('availreplica_received_from_replica_bytes') + ')', '{{replica}} received'], + ['max by (replica) (' + rate('availreplica_sent_to_replica_bytes_total') + ')', '{{replica}} sent'], + ['max by (replica) (' + rate('availreplica_received_from_replica_bytes_total') + ')', '{{replica}} received'], ], below='.* received'), ] ) diff --git a/contrib/mixin/dashboards/network.libsonnet b/contrib/mixin/dashboards/network.libsonnet index 617d62a3..15336479 100644 --- a/contrib/mixin/dashboards/network.libsonnet +++ b/contrib/mixin/dashboards/network.libsonnet @@ -123,7 +123,7 @@ function(on) b.panel.new(140, 'TCP connections by state', 'timeseries') + b.panel.withDescription('Needs the tcp collector, which is not enabled by default. A growing CLOSE_WAIT count means an application does not close its sockets. Many TIME_WAIT connections can use up the dynamic port range for outgoing connections.') + b.panel.withQueries([ - b.query.new('sum by (state) (windows_tcp_connections_state_count{job=~"$job", instance="$instance"})', 'A') + b.query.new('sum by (state) (windows_tcp_connections{job=~"$job", instance="$instance"})', 'A') + b.query.withLegendFormat('{{state}}'), ]) + b.panel.withDefaults({ diff --git a/contrib/mixin/dashboards/overview.libsonnet b/contrib/mixin/dashboards/overview.libsonnet index 27e7704b..6022fd85 100644 --- a/contrib/mixin/dashboards/overview.libsonnet +++ b/contrib/mixin/dashboards/overview.libsonnet @@ -70,7 +70,7 @@ function(on) b.panel.new(14, 'CPU busy', 'stat') + b.panel.withDescription('Percentage of non-idle CPU time averaged across logical processors over the rate interval. Sustained high values together with a growing processor queue can indicate CPU contention.') + b.panel.withQueries([ - b.query.new('100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~"$job", instance="$instance", mode="idle"}[$__rate_interval]), 1)))', 'A'), + b.query.new('100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~"$job", instance="$instance", mode="idle"}[$__rate_interval]), 1)))', 'A'), ]) + b.panel.withDefaults({ decimals: 1, @@ -184,7 +184,7 @@ function(on) b.panel.new(18, 'CPU utilization', 'timeseries') + b.panel.withDescription('Percentage of non-idle CPU time averaged across logical processors. This measures CPU time rather than the frequency-adjusted processor utility shown by Windows Task Manager.') + b.panel.withQueries([ - b.query.new('100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~"$job", instance="$instance", mode="idle"}[$__rate_interval]), 1)))', 'A') + b.query.new('100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~"$job", instance="$instance", mode="idle"}[$__rate_interval]), 1)))', 'A') + b.query.withLegendFormat('CPU busy'), ]) + b.panel.withDefaults({ diff --git a/contrib/mixin/dashboards/processes.libsonnet b/contrib/mixin/dashboards/processes.libsonnet index 197495a7..239295dc 100644 --- a/contrib/mixin/dashboards/processes.libsonnet +++ b/contrib/mixin/dashboards/processes.libsonnet @@ -30,11 +30,11 @@ function(on) stat(150, 'Processes', 'Number of distinct process IDs currently collected, excluding Idle.', 'count(count by (process_id) (' + gauge('info') + '))', 'short'), stat(151, 'Threads', 'Total active threads in the selected processes.', 'sum(' + gauge('threads') + ')', 'short'), stat(152, 'Handles', 'Total open handles in the selected processes.', 'sum(' + gauge('handles') + ')', 'short'), - stat(153, 'CPU busy', 'CPU time used by the selected processes as a share of all logical processors of the host, excluding Idle.', 'sum(' + rate('cpu_time_total') + ') / scalar(max(windows_cpu_logical_processor{job=~"$job", instance="$instance"}))', 'percentunit', steps=b.levels(0.8, 0.9)), + stat(153, 'CPU busy', 'CPU time used by the selected processes as a share of all logical processors of the host, excluding Idle.', 'sum(' + rate('cpu_time_seconds_total') + ') / scalar(max(windows_cpu_logical_processor{job=~"$job", instance="$instance"}))', 'percentunit', steps=b.levels(0.8, 0.9)), stat(154, 'Private working set', 'Physical memory private to the selected processes; shared pages are excluded.', 'sum(' + gauge('working_set_private_bytes') + ')', 'bytes'), stat(155, 'Private bytes', 'Total memory allocated by the selected processes that cannot be shared; it may include nonresident memory.', 'sum(' + gauge('private_bytes') + ')', 'bytes'), - graph(112, 'Process CPU usage', 'User and privileged CPU time per process as a share of one logical processor. Values above 100% mean the process uses more than one core.', sumRates('cpu_time_total'), sumRates('cpu_time_total', ' @ end()'), 'percentunit'), + graph(112, 'Process CPU usage', 'User and privileged CPU time per process as a share of one logical processor. Values above 100% mean the process uses more than one core.', sumRates('cpu_time_seconds_total'), sumRates('cpu_time_seconds_total', ' @ end()'), 'percentunit'), graph(113, 'Process working set', 'Physical memory in the working set of each process, including shared pages.', gauge('working_set_bytes'), gauge('working_set_bytes', ' @ end()'), 'bytes'), graph(114, 'Process private bytes', 'Memory allocated by each process that cannot be shared with other processes.', gauge('private_bytes'), gauge('private_bytes', ' @ end()'), 'bytes'), graph(115, 'Process I/O throughput', 'Total bytes issued for read, write and other I/O per process, including file, network and device operations.', sumRates('io_bytes_total'), sumRates('io_bytes_total', ' @ end()'), 'Bps'), diff --git a/contrib/mixin/dashboards/smb.libsonnet b/contrib/mixin/dashboards/smb.libsonnet index c40a03e1..eece6148 100644 --- a/contrib/mixin/dashboards/smb.libsonnet +++ b/contrib/mixin/dashboards/smb.libsonnet @@ -25,8 +25,8 @@ function(on) if on('smbclient') then b.row('Client shares', b.flow([[231, 12, 8], [232, 12, 8], [233, 12, 8], [234, 12, 8], [235, 12, 8], [236, 12, 8]])), ]), [ - b.stat(220, 'Open files', 'Files open on the shares of this SMB server.' + serverRequirement, 'sum(' + server('current_open_file_count') + ')'), - b.stat(221, 'Connections', 'Client connections (tree connects) to the shares of this SMB server.' + serverRequirement, 'sum(' + server('tree_connect_count') + ')'), + b.stat(220, 'Open files', 'Files open on the shares of this SMB server.' + serverRequirement, 'sum(' + server('open_files') + ')'), + b.stat(221, 'Connections', 'Client connections (tree connects) to the shares of this SMB server.' + serverRequirement, 'sum(' + server('tree_connects') + ')'), b.stat(222, 'Server traffic', 'Bytes sent and received per second by the shares of this SMB server.' + serverRequirement, 'sum(' + serverRate('received_bytes_total') + ') + sum(' + serverRate('sent_bytes_total') + ')', 'Bps'), b.stat(223, 'Client traffic', 'Bytes read and written per second by this host on remote SMB shares.' + clientRequirement, 'sum(' + clientRate('data_bytes_total') + ')', 'Bps'), b.stat(224, 'Client latency', 'Average time per request of this host on remote SMB shares. 0 when there are no requests.' + clientRequirement, '(sum(' + clientRate('request_seconds_total') + ') / (sum(' + clientRate('requests_total') + ') > 0)) or (0 * sum(' + clientRate('requests_total') + '))', 's', steps=b.levels(0.02, 0.05)), @@ -41,8 +41,8 @@ function(on) [serverRate('write_requests_total'), share + ' write'], [serverRate('metadata_requests_total'), share + ' metadata'], ]), - b.graph(228, 'Open files', 'Files open per share.' + serverRequirement, 'short', [[server('current_open_file_count'), share]]), - b.graph(229, 'Connections', 'Client connections (tree connects) per share.' + serverRequirement, 'short', [[server('tree_connect_count'), share]]), + b.graph(228, 'Open files', 'Files open per share.' + serverRequirement, 'short', [[server('open_files'), share]]), + b.graph(229, 'Connections', 'Client connections (tree connects) per share.' + serverRequirement, 'short', [[server('tree_connects'), share]]), b.graph(230, 'Files opened', 'Files opened per second per share.' + serverRequirement, 'ops', [[serverRate('files_opened_total'), share]]), b.graph(231, 'Client traffic', 'Bytes read and written per second per remote share. Reads are drawn below the axis.' + clientRequirement, 'Bps', [ diff --git a/contrib/mixin/lib/queries.libsonnet b/contrib/mixin/lib/queries.libsonnet index 146baa26..fcf655c0 100644 --- a/contrib/mixin/lib/queries.libsonnet +++ b/contrib/mixin/lib/queries.libsonnet @@ -6,7 +6,7 @@ function(c) // Drop undefined ratios instead of recording NaN or +Inf for idle devices. ratio(numerator, denominator): '(%s / (%s > 0))' % [numerator, denominator], cpuUsage: - '1 - avg without (core, mode) (%s)' % self.rate('windows_cpu_time_total', ['mode="idle"']), + '1 - avg without (core, mode) (%s)' % self.rate('windows_cpu_time_seconds_total', ['mode="idle"']), memoryUsage: '1 - %s' % self.ratio( self.metric('windows_memory_available_bytes'), diff --git a/contrib/mixin/rules/rules.libsonnet b/contrib/mixin/rules/rules.libsonnet index eb53befa..b5016b98 100644 --- a/contrib/mixin/rules/rules.libsonnet +++ b/contrib/mixin/rules/rules.libsonnet @@ -7,8 +7,8 @@ name: 'windows-exporter-recording', rules: [ { record: 'windows:cpu_usage:ratio', expr: q.cpuUsage }, - { record: 'windows:cpu_cores:count', expr: 'count without (core, mode) (%s)' % q.metric('windows_cpu_time_total', ['mode="idle"']) }, - { record: 'windows:cpu_time:ratio_rate', expr: 'avg without (core) (%s)' % q.rate('windows_cpu_time_total') }, + { record: 'windows:cpu_cores:count', expr: 'count without (core, mode) (%s)' % q.metric('windows_cpu_time_seconds_total', ['mode="idle"']) }, + { record: 'windows:cpu_time:ratio_rate', expr: 'avg without (core) (%s)' % q.rate('windows_cpu_time_seconds_total') }, { record: 'windows:memory_usage:ratio', expr: q.memoryUsage }, { record: 'windows:memory_used:bytes', diff --git a/contrib/mixin/tests/alerts.test.yaml b/contrib/mixin/tests/alerts.test.yaml index 85025473..ca449fc7 100644 --- a/contrib/mixin/tests/alerts.test.yaml +++ b/contrib/mixin/tests/alerts.test.yaml @@ -159,7 +159,7 @@ tests: - name: Resource alerts use recording rules and wait fifteen minutes interval: 1m input_series: - - series: 'windows_cpu_time_total{job="windows_exporter", instance="host:9182", cluster="a", core="0", mode="idle"}' + - series: 'windows_cpu_time_seconds_total{job="windows_exporter", instance="host:9182", cluster="a", core="0", mode="idle"}' values: '0+3x20 120+60x10' - series: 'windows_memory_available_bytes{job="windows_exporter", instance="host:9182", cluster="a"}' values: '5x20 50x10' @@ -226,7 +226,7 @@ tests: - name: Healthy resources at the exact thresholds do not fire interval: 1m input_series: - - series: 'windows_cpu_time_total{job="windows_exporter", instance="host:9182", core="0", mode="idle"}' + - series: 'windows_cpu_time_seconds_total{job="windows_exporter", instance="host:9182", core="0", mode="idle"}' values: '0+6x20' - series: 'windows_memory_available_bytes{job="windows_exporter", instance="host:9182"}' values: '10x20' diff --git a/contrib/mixin/tests/custom.test.yaml b/contrib/mixin/tests/custom.test.yaml index c5f5134c..1bee3fd8 100644 --- a/contrib/mixin/tests/custom.test.yaml +++ b/contrib/mixin/tests/custom.test.yaml @@ -137,7 +137,7 @@ tests: values: '0x20' - series: 'up{job="windows-custom", instance="host:9182", cluster="prod"}' values: '0x20' - - series: 'windows_cpu_time_total{job="windows-custom", instance="host:9182", cluster="test", core="0", mode="idle"}' + - series: 'windows_cpu_time_seconds_total{job="windows-custom", instance="host:9182", cluster="test", core="0", mode="idle"}' values: '0+9x20' - series: 'windows_memory_available_bytes{job="windows-custom", instance="host:9182", cluster="test"}' values: '12x20' diff --git a/contrib/mixin/tests/rules.test.yaml b/contrib/mixin/tests/rules.test.yaml index e5a35831..95bc9096 100644 --- a/contrib/mixin/tests/rules.test.yaml +++ b/contrib/mixin/tests/rules.test.yaml @@ -7,15 +7,15 @@ tests: - name: CPU is averaged across cores and preserves target labels interval: 1m input_series: - - series: 'windows_cpu_time_total{job="windows_exporter", instance="host:9182", cluster="a", core="0", mode="idle"}' + - series: 'windows_cpu_time_seconds_total{job="windows_exporter", instance="host:9182", cluster="a", core="0", mode="idle"}' values: '0+12x10' - - series: 'windows_cpu_time_total{job="windows_exporter", instance="host:9182", cluster="a", core="1", mode="idle"}' + - series: 'windows_cpu_time_seconds_total{job="windows_exporter", instance="host:9182", cluster="a", core="1", mode="idle"}' values: '0+36x10' - - series: 'windows_cpu_time_total{job="windows_exporter", instance="host:9182", cluster="a", core="0", mode="user"}' + - series: 'windows_cpu_time_seconds_total{job="windows_exporter", instance="host:9182", cluster="a", core="0", mode="user"}' values: '0+48x10' - - series: 'windows_cpu_time_total{job="windows_exporter", instance="host:9182", cluster="b", core="0", mode="idle"}' + - series: 'windows_cpu_time_seconds_total{job="windows_exporter", instance="host:9182", cluster="b", core="0", mode="idle"}' values: '0+30x10' - - series: 'windows_cpu_time_total{job="other", instance="host:9182", core="0", mode="idle"}' + - series: 'windows_cpu_time_seconds_total{job="other", instance="host:9182", core="0", mode="idle"}' values: '0+6x10' promql_expr_test: - expr: windows:cpu_cores:count diff --git a/dashboard/windows-exporter-cpu.json b/dashboard/windows-exporter-cpu.json index 82e521bc..0f0501d6 100644 --- a/dashboard/windows-exporter-cpu.json +++ b/dashboard/windows-exporter-cpu.json @@ -78,7 +78,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "1 - avg(clamp_max(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1))", + "expr": "1 - avg(clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1))", "instant": false, "legendFormat": "__auto", "range": true @@ -173,7 +173,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"user\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", + "expr": "sum(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"user\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", "instant": false, "legendFormat": "__auto", "range": true @@ -260,7 +260,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"privileged\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", + "expr": "sum(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"privileged\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", "instant": false, "legendFormat": "__auto", "range": true @@ -526,7 +526,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "avg(1e4 * windows_cpu_core_frequency_mhz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "avg(1e-2 * windows_cpu_core_frequency_hertz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "__auto", "range": true @@ -611,7 +611,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (mode) (rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode!=\"idle\"}[$__rate_interval])) / scalar(count(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}))", + "expr": "sum by (mode) (rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode!=\"idle\"}[$__rate_interval])) / scalar(count(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}))", "instant": false, "legendFormat": "{{mode}}", "range": true @@ -727,7 +727,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "label_replace(clamp(1 - rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 0, 1), \"core\", \"$1,0$2\", \"core\", \"(\\\\d+),(\\\\d)\")", + "expr": "label_replace(clamp(1 - rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 0, 1), \"core\", \"$1,0$2\", \"core\", \"(\\\\d+),(\\\\d)\")", "instant": false, "legendFormat": "{{core}}", "range": true @@ -1391,7 +1391,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "avg(1e4 * windows_cpu_core_frequency_mhz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "avg(1e-2 * windows_cpu_core_frequency_hertz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "average", "range": true @@ -1413,7 +1413,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max(1e4 * windows_cpu_core_frequency_mhz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "max(1e-2 * windows_cpu_core_frequency_hertz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "maximum", "range": true @@ -1435,7 +1435,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "avg(windows_cpu_core_frequency_mhz{job=~\"$job\", instance=\"$instance\"}) * 1e6", + "expr": "avg(windows_cpu_core_frequency_hertz{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "nominal", "range": true diff --git a/dashboard/windows-exporter-dashboard.json b/dashboard/windows-exporter-dashboard.json index 5cda518f..3f092c76 100644 --- a/dashboard/windows-exporter-dashboard.json +++ b/dashboard/windows-exporter-dashboard.json @@ -1784,7 +1784,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (process, process_id) (rate(windows_process_cpu_time_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval])) and on (process, process_id) topk($process_top, sum by (process, process_id) (rate(windows_process_cpu_time_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval] @ end())))", + "expr": "sum by (process, process_id) (rate(windows_process_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval])) and on (process, process_id) topk($process_top, sum by (process, process_id) (rate(windows_process_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval] @ end())))", "instant": false, "legendFormat": "{{process}} ({{process_id}})", "range": true @@ -4397,7 +4397,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1)))", + "expr": "100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1)))", "instant": false, "legendFormat": "__auto", "range": true @@ -4490,7 +4490,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (state) (windows_tcp_connections_state_count{job=~\"$job\", instance=\"$instance\"})", + "expr": "sum by (state) (windows_tcp_connections{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "{{state}}", "range": true @@ -5775,7 +5775,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(rate(windows_process_cpu_time_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", + "expr": "sum(rate(windows_process_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", "instant": false, "legendFormat": "__auto", "range": true @@ -6133,7 +6133,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "1 - avg(clamp_max(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1))", + "expr": "1 - avg(clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1))", "instant": false, "legendFormat": "__auto", "range": true @@ -6228,7 +6228,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"user\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", + "expr": "sum(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"user\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", "instant": false, "legendFormat": "__auto", "range": true @@ -6315,7 +6315,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"privileged\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", + "expr": "sum(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"privileged\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", "instant": false, "legendFormat": "__auto", "range": true @@ -6581,7 +6581,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "avg(1e4 * windows_cpu_core_frequency_mhz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "avg(1e-2 * windows_cpu_core_frequency_hertz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "__auto", "range": true @@ -7897,7 +7897,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1)))", + "expr": "100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1)))", "instant": false, "legendFormat": "CPU busy", "range": true @@ -8383,7 +8383,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max(clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1))", + "expr": "max(clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1))", "instant": false, "legendFormat": "__auto", "range": true @@ -10243,7 +10243,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1)))) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", + "expr": "(100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1)))) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", "format": "table", "instant": true, "legendFormat": "__auto", @@ -11542,7 +11542,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk) (label_replace(windows_diskdrive_size{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\", \"name\", \"PHYSICALDRIVE(\\\\d+)\"))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -13825,7 +13825,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(windows_smb_server_shares_current_open_file_count{job=~\"$job\", instance=\"$instance\"})", + "expr": "sum(windows_smb_server_shares_open_files{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "__auto", "range": true @@ -13910,7 +13910,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(windows_smb_server_shares_tree_connect_count{job=~\"$job\", instance=\"$instance\"})", + "expr": "sum(windows_smb_server_shares_tree_connects{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "__auto", "range": true @@ -14653,7 +14653,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_smb_server_shares_current_open_file_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_smb_server_shares_open_files{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "{{share}}", "range": true @@ -14768,7 +14768,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_smb_server_shares_tree_connect_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_smb_server_shares_tree_connects{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "{{share}}", "range": true @@ -15790,7 +15790,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (mode) (rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode!=\"idle\"}[$__rate_interval])) / scalar(count(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}))", + "expr": "sum by (mode) (rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode!=\"idle\"}[$__rate_interval])) / scalar(count(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}))", "instant": false, "legendFormat": "{{mode}}", "range": true @@ -16505,7 +16505,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (name) (windows_storage_spaces_virtual_disk_storage_efficiency_percent{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (name) (windows_storage_spaces_virtual_disk_storage_efficiency_ratio{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -16651,7 +16651,7 @@ "properties": [ { "id": "unit", - "value": "percent" + "value": "percentunit" }, { "id": "decimals", @@ -16979,7 +16979,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "label_replace(clamp(1 - rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 0, 1), \"core\", \"$1,0$2\", \"core\", \"(\\\\d+),(\\\\d)\")", + "expr": "label_replace(clamp(1 - rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 0, 1), \"core\", \"$1,0$2\", \"core\", \"(\\\\d+),(\\\\d)\")", "instant": false, "legendFormat": "{{core}}", "range": true @@ -17246,7 +17246,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count((100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1))) > 90) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}) or (0 * count(windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", + "expr": "count((100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1))) > 90) 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 @@ -18168,7 +18168,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "topk(25, (100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1)))) * on (instance) group_left (hostname) max by (instance, hostname) (windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", + "expr": "topk(25, (100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1)))) * on (instance) group_left (hostname) max by (instance, hostname) (windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", "instant": false, "legendFormat": "{{hostname}}", "range": true @@ -18280,7 +18280,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "avg(1e4 * windows_cpu_core_frequency_mhz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "avg(1e-2 * windows_cpu_core_frequency_hertz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "average", "range": true @@ -18302,7 +18302,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max(1e4 * windows_cpu_core_frequency_mhz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", + "expr": "max(1e-2 * windows_cpu_core_frequency_hertz{job=~\"$job\", instance=\"$instance\"} * rate(windows_cpu_processor_performance_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) / rate(windows_cpu_processor_mperf_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "maximum", "range": true @@ -18324,7 +18324,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "avg(windows_cpu_core_frequency_mhz{job=~\"$job\", instance=\"$instance\"}) * 1e6", + "expr": "avg(windows_cpu_core_frequency_hertz{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "nominal", "range": true @@ -21691,7 +21691,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1)", + "expr": "clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -22024,7 +22024,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "clamp_max(max by (luid, engtype) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1) * on (luid) group_left (name) max by (luid, name) (windows_gpu_info{job=~\"$job\", instance=\"$instance\"})", + "expr": "clamp_max(max by (luid, engtype) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1) * on (luid) group_left (name) max by (luid, name) (windows_gpu_info{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "{{name}} {{engtype}}", "range": true @@ -22489,7 +22489,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "topk(10, (max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))) * on (process_id) group_left (process) max by (process_id, process) (windows_process_info{job=~\"$job\", instance=\"$instance\"})) or on (process_id) max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))))", + "expr": "topk(10, (max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))) * on (process_id) group_left (process) max by (process_id, process) (windows_process_info{job=~\"$job\", instance=\"$instance\"})) or on (process_id) max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))))", "instant": false, "legendFormat": "{{process}} ({{process_id}})", "range": true @@ -22723,7 +22723,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(windows_hyperv_virtual_machine_health_total_count{job=~\"$job\", instance=\"$instance\"})", + "expr": "sum(windows_hyperv_virtual_machines{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "__auto", "range": true @@ -22808,7 +22808,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(windows_hyperv_virtual_machine_health_total_count{job=~\"$job\", instance=\"$instance\", state=\"critical\"})", + "expr": "sum(windows_hyperv_virtual_machines{job=~\"$job\", instance=\"$instance\", state=\"critical\"})", "instant": false, "legendFormat": "__auto", "range": true @@ -22997,7 +22997,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_hyperv_host_logical_processor_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_hyperv_host_logical_processors{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -23082,7 +23082,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_hyperv_total_vm_processor_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_hyperv_assigned_vm_processors{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -23167,7 +23167,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_hyperv_total_vm_processor_count{job=~\"$job\", instance=\"$instance\"} / windows_hyperv_host_logical_processor_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_hyperv_assigned_vm_processors{job=~\"$job\", instance=\"$instance\"} / windows_hyperv_host_logical_processors{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -23253,7 +23253,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (state) (rate(windows_hyperv_hypervisor_logical_processor_time_total{job=~\"$job\", instance=\"$instance\", state!=\"idle\"}[$__rate_interval])) / scalar(count(windows_hyperv_hypervisor_logical_processor_time_total{job=~\"$job\", instance=\"$instance\", state=\"idle\"}))", + "expr": "sum by (state) (rate(windows_hyperv_hypervisor_logical_processor_time_seconds_total{job=~\"$job\", instance=\"$instance\", state!=\"idle\"}[$__rate_interval])) / scalar(count(windows_hyperv_hypervisor_logical_processor_time_seconds_total{job=~\"$job\", instance=\"$instance\", state=\"idle\"}))", "instant": false, "legendFormat": "{{state}}", "range": true @@ -23514,7 +23514,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) / scalar(max(windows_hyperv_host_logical_processor_count{job=~\"$job\", instance=\"$instance\"}))", + "expr": "sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) / scalar(max(windows_hyperv_host_logical_processors{job=~\"$job\", instance=\"$instance\"}))", "instant": false, "legendFormat": "{{vm}}", "range": true @@ -23978,7 +23978,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_hyperv_virtual_storage_device_bytes_written{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])", + "expr": "rate(windows_hyperv_virtual_storage_device_written_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])", "instant": false, "legendFormat": "{{device}} write", "range": true @@ -24000,7 +24000,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_hyperv_virtual_storage_device_bytes_read{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])", + "expr": "rate(windows_hyperv_virtual_storage_device_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])", "instant": false, "legendFormat": "{{device}} read", "range": true @@ -24298,7 +24298,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_hyperv_virtual_storage_device_error_count_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0", + "expr": "rate(windows_hyperv_virtual_storage_device_errors_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0", "instant": false, "legendFormat": "{{device}} errors", "range": true diff --git a/dashboard/windows-exporter-disk.json b/dashboard/windows-exporter-disk.json index da6773c3..60be45e6 100644 --- a/dashboard/windows-exporter-disk.json +++ b/dashboard/windows-exporter-disk.json @@ -726,7 +726,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (disk) (label_replace(windows_diskdrive_size{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\", \"name\", \"PHYSICALDRIVE(\\\\d+)\"))", "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_percent{job=~\"$job\", instance=\"$instance\"})", + "expr": "max by (name) (windows_storage_spaces_virtual_disk_storage_efficiency_ratio{job=~\"$job\", instance=\"$instance\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -2495,7 +2495,7 @@ "properties": [ { "id": "unit", - "value": "percent" + "value": "percentunit" }, { "id": "decimals", diff --git a/dashboard/windows-exporter-fleet.json b/dashboard/windows-exporter-fleet.json index 59a77ce7..0d0286b7 100644 --- a/dashboard/windows-exporter-fleet.json +++ b/dashboard/windows-exporter-fleet.json @@ -144,7 +144,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "(100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1)))) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", + "expr": "(100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1)))) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1138,7 +1138,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "count((100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1))) > 90) and on (instance) windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}) or (0 * count(windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", + "expr": "count((100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1))) > 90) 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 @@ -1490,7 +1490,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "topk(25, (100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1)))) * on (instance) group_left (hostname) max by (instance, hostname) (windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", + "expr": "topk(25, (100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", mode=\"idle\"}[$__rate_interval]), 1)))) * on (instance) group_left (hostname) max by (instance, hostname) (windows_os_hostname{job=~\"$job\", hostname=~\"$hostname\"}))", "instant": false, "legendFormat": "{{hostname}}", "range": true diff --git a/dashboard/windows-exporter-gpu.json b/dashboard/windows-exporter-gpu.json index ae41a2ef..613e97a3 100644 --- a/dashboard/windows-exporter-gpu.json +++ b/dashboard/windows-exporter-gpu.json @@ -1590,7 +1590,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max(clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1))", + "expr": "max(clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1))", "instant": false, "legendFormat": "__auto", "range": true @@ -2154,7 +2154,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1)", + "expr": "clamp_max(max by (luid) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -2487,7 +2487,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "clamp_max(max by (luid, engtype) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1) * on (luid) group_left (name) max by (luid, name) (windows_gpu_info{job=~\"$job\", instance=\"$instance\"})", + "expr": "clamp_max(max by (luid, engtype) (sum by (luid, eng, engtype) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))), 1) * on (luid) group_left (name) max by (luid, name) (windows_gpu_info{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "{{name}} {{engtype}}", "range": true @@ -2807,7 +2807,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "topk(10, (max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))) * on (process_id) group_left (process) max by (process_id, process) (windows_process_info{job=~\"$job\", instance=\"$instance\"})) or on (process_id) max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))))", + "expr": "topk(10, (max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))) * on (process_id) group_left (process) max by (process_id, process) (windows_process_info{job=~\"$job\", instance=\"$instance\"})) or on (process_id) max by (process_id) (sum by (process_id, luid, eng) (rate(windows_gpu_engine_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]))))", "instant": false, "legendFormat": "{{process}} ({{process_id}})", "range": true diff --git a/dashboard/windows-exporter-hyper-v.json b/dashboard/windows-exporter-hyper-v.json index d9a371bc..b45f7a0b 100644 --- a/dashboard/windows-exporter-hyper-v.json +++ b/dashboard/windows-exporter-hyper-v.json @@ -78,7 +78,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(windows_hyperv_virtual_machine_health_total_count{job=~\"$job\", instance=\"$instance\"})", + "expr": "sum(windows_hyperv_virtual_machines{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "__auto", "range": true @@ -163,7 +163,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(windows_hyperv_virtual_machine_health_total_count{job=~\"$job\", instance=\"$instance\", state=\"critical\"})", + "expr": "sum(windows_hyperv_virtual_machines{job=~\"$job\", instance=\"$instance\", state=\"critical\"})", "instant": false, "legendFormat": "__auto", "range": true @@ -352,7 +352,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_hyperv_host_logical_processor_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_hyperv_host_logical_processors{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -437,7 +437,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_hyperv_total_vm_processor_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_hyperv_assigned_vm_processors{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -522,7 +522,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_hyperv_total_vm_processor_count{job=~\"$job\", instance=\"$instance\"} / windows_hyperv_host_logical_processor_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_hyperv_assigned_vm_processors{job=~\"$job\", instance=\"$instance\"} / windows_hyperv_host_logical_processors{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "__auto", "range": true @@ -608,7 +608,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (state) (rate(windows_hyperv_hypervisor_logical_processor_time_total{job=~\"$job\", instance=\"$instance\", state!=\"idle\"}[$__rate_interval])) / scalar(count(windows_hyperv_hypervisor_logical_processor_time_total{job=~\"$job\", instance=\"$instance\", state=\"idle\"}))", + "expr": "sum by (state) (rate(windows_hyperv_hypervisor_logical_processor_time_seconds_total{job=~\"$job\", instance=\"$instance\", state!=\"idle\"}[$__rate_interval])) / scalar(count(windows_hyperv_hypervisor_logical_processor_time_seconds_total{job=~\"$job\", instance=\"$instance\", state=\"idle\"}))", "instant": false, "legendFormat": "{{state}}", "range": true @@ -724,7 +724,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) / scalar(max(windows_hyperv_host_logical_processor_count{job=~\"$job\", instance=\"$instance\"}))", + "expr": "sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])) / scalar(max(windows_hyperv_host_logical_processors{job=~\"$job\", instance=\"$instance\"}))", "instant": false, "legendFormat": "{{vm}}", "range": true @@ -1188,7 +1188,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_hyperv_virtual_storage_device_bytes_written{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])", + "expr": "rate(windows_hyperv_virtual_storage_device_written_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])", "instant": false, "legendFormat": "{{device}} write", "range": true @@ -1210,7 +1210,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_hyperv_virtual_storage_device_bytes_read{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])", + "expr": "rate(windows_hyperv_virtual_storage_device_read_bytes_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval])", "instant": false, "legendFormat": "{{device}} read", "range": true @@ -1508,7 +1508,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_hyperv_virtual_storage_device_error_count_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0", + "expr": "rate(windows_hyperv_virtual_storage_device_errors_total{job=~\"$job\", instance=\"$instance\"}[$__rate_interval]) > 0", "instant": false, "legendFormat": "{{device}} errors", "range": true diff --git a/dashboard/windows-exporter-mssql.json b/dashboard/windows-exporter-mssql.json index 346f412b..f1ba7fa2 100644 --- a/dashboard/windows-exporter-mssql.json +++ b/dashboard/windows-exporter-mssql.json @@ -251,7 +251,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_sqlstats_batch_requests{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_sqlstats_batch_requests_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "__auto", "range": true @@ -424,7 +424,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "60 * sum(rate(windows_mssql_locks_deadlocks{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", + "expr": "60 * sum(rate(windows_mssql_locks_deadlocks_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "__auto", "range": true @@ -778,7 +778,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_sqlstats_batch_requests{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_sqlstats_batch_requests_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "batch requests", "range": true @@ -800,7 +800,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_sqlstats_sql_compilations{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_sqlstats_sql_compilations_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "compilations", "range": true @@ -822,7 +822,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_sqlstats_sql_recompilations{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_sqlstats_sql_recompilations_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "recompilations", "range": true @@ -844,7 +844,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_sqlstats_sql_attentions{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_sqlstats_sql_attentions_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "attentions", "range": true @@ -1096,7 +1096,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_accessmethods_index_searches{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_accessmethods_index_searches_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "index searches", "range": true @@ -1118,7 +1118,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_accessmethods_full_scans{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_accessmethods_full_scans_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "full scans", "range": true @@ -1140,7 +1140,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_accessmethods_page_splits{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_accessmethods_page_splits_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "page splits", "range": true @@ -1370,7 +1370,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_genstats_logins{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_genstats_logins_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "logins", "range": true @@ -1392,7 +1392,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_genstats_logouts{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_genstats_logouts_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "logouts", "range": true @@ -1414,7 +1414,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "rate(windows_mssql_genstats_connection_resets{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "rate(windows_mssql_genstats_connection_resets_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "connection resets", "range": true @@ -1898,7 +1898,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (resource) (rate(windows_mssql_locks_lock_waits{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", + "expr": "sum by (resource) (rate(windows_mssql_locks_lock_waits_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{resource}}", "range": true @@ -2013,7 +2013,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (resource) (rate(windows_mssql_locks_wait_time_seconds_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])) / (sum by (resource) (rate(windows_mssql_locks_count_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])) > 0)", + "expr": "sum by (resource) (rate(windows_mssql_locks_wait_time_seconds_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])) / (sum by (resource) (rate(windows_mssql_locks_lock_waits_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])) > 0)", "instant": false, "legendFormat": "{{resource}}", "range": true @@ -2128,7 +2128,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(rate(windows_mssql_locks_deadlocks{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", + "expr": "sum(rate(windows_mssql_locks_deadlocks_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "deadlocks", "range": true @@ -2150,7 +2150,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(rate(windows_mssql_locks_lock_timeouts_excluding_NOWAIT{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", + "expr": "sum(rate(windows_mssql_locks_lock_timeouts_excluding_nowait_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "timeouts", "range": true @@ -2816,7 +2816,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "8192 * rate(windows_mssql_bufman_page_writes{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "8192 * rate(windows_mssql_bufman_page_writes_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "writes", "range": true @@ -2838,7 +2838,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "8192 * rate(windows_mssql_bufman_checkpoint_pages{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "8192 * rate(windows_mssql_bufman_checkpoint_pages_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "checkpoint writes", "range": true @@ -2860,7 +2860,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "8192 * rate(windows_mssql_bufman_lazywrites{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "8192 * rate(windows_mssql_bufman_lazywrites_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "lazy writes", "range": true @@ -2882,7 +2882,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "8192 * rate(windows_mssql_bufman_page_reads{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "8192 * rate(windows_mssql_bufman_page_reads_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "reads", "range": true @@ -2904,7 +2904,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "8192 * rate(windows_mssql_bufman_read_ahead_pages{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", + "expr": "8192 * rate(windows_mssql_bufman_read_ahead_pages_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval])", "instant": false, "legendFormat": "read-ahead reads", "range": true @@ -3214,7 +3214,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (database) (windows_mssql_databases_log_used_percent{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"})", + "expr": "max by (database) (windows_mssql_databases_log_used_ratio{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"})", "format": "table", "instant": true, "legendFormat": "__auto", @@ -3260,7 +3260,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (database) (rate(windows_mssql_databases_transactions{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]))", + "expr": "max by (database) (rate(windows_mssql_databases_transactions_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -3283,7 +3283,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (database) (rate(windows_mssql_databases_write_transactions{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]))", + "expr": "max by (database) (rate(windows_mssql_databases_write_transactions_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -3388,7 +3388,7 @@ "properties": [ { "id": "unit", - "value": "percent" + "value": "percentunit" }, { "id": "min", @@ -3396,7 +3396,7 @@ }, { "id": "max", - "value": 100 + "value": 1 }, { "id": "decimals", @@ -3608,7 +3608,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (database) (windows_mssql_databases_log_used_percent{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"})", + "expr": "max by (database) (windows_mssql_databases_log_used_ratio{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"})", "instant": false, "legendFormat": "{{database}}", "range": true @@ -3668,7 +3668,7 @@ "mode": "off" } }, - "max": 100, + "max": 1, "min": 0, "thresholds": { "mode": "absolute", @@ -3679,7 +3679,7 @@ } ] }, - "unit": "percent" + "unit": "percentunit" }, "overrides": [] }, @@ -3724,7 +3724,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (database) (rate(windows_mssql_databases_transactions{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]))", + "expr": "max by (database) (rate(windows_mssql_databases_transactions_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{database}}", "range": true @@ -3839,7 +3839,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (database) (rate(windows_mssql_databases_log_flushed_bytes{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]))", + "expr": "max by (database) (rate(windows_mssql_databases_log_flushed_bytes_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{database}}", "range": true @@ -3954,7 +3954,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (database) (rate(windows_mssql_databases_log_flush_write_seconds_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]) / (rate(windows_mssql_databases_log_flushes{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]) > 0))", + "expr": "max by (database) (rate(windows_mssql_databases_log_flush_write_seconds_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]) / (rate(windows_mssql_databases_log_flushes_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\", database=~\"$database\"}[$__rate_interval]) > 0))", "instant": false, "legendFormat": "{{database}}", "range": true @@ -4639,7 +4639,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (replica) (rate(windows_mssql_availreplica_sent_to_replica_bytes{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", + "expr": "max by (replica) (rate(windows_mssql_availreplica_sent_to_replica_bytes_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{replica}} sent", "range": true @@ -4661,7 +4661,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "max by (replica) (rate(windows_mssql_availreplica_received_from_replica_bytes{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", + "expr": "max by (replica) (rate(windows_mssql_availreplica_received_from_replica_bytes_total{job=~\"$job\", instance=\"$instance\", mssql_instance=\"$mssql_instance\"}[$__rate_interval]))", "instant": false, "legendFormat": "{{replica}} received", "range": true diff --git a/dashboard/windows-exporter-network.json b/dashboard/windows-exporter-network.json index 98ace137..c8600913 100644 --- a/dashboard/windows-exporter-network.json +++ b/dashboard/windows-exporter-network.json @@ -78,7 +78,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (state) (windows_tcp_connections_state_count{job=~\"$job\", instance=\"$instance\"})", + "expr": "sum by (state) (windows_tcp_connections{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "{{state}}", "range": true diff --git a/dashboard/windows-exporter-overview.json b/dashboard/windows-exporter-overview.json index a2457f67..fae31fba 100644 --- a/dashboard/windows-exporter-overview.json +++ b/dashboard/windows-exporter-overview.json @@ -412,7 +412,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1)))", + "expr": "100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1)))", "instant": false, "legendFormat": "__auto", "range": true @@ -777,7 +777,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1)))", + "expr": "100 * (1 - avg by (instance) (clamp_max(rate(windows_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", mode=\"idle\"}[$__rate_interval]), 1)))", "instant": false, "legendFormat": "CPU busy", "range": true diff --git a/dashboard/windows-exporter-processes.json b/dashboard/windows-exporter-processes.json index 4594ef96..36611e57 100644 --- a/dashboard/windows-exporter-processes.json +++ b/dashboard/windows-exporter-processes.json @@ -78,7 +78,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum by (process, process_id) (rate(windows_process_cpu_time_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval])) and on (process, process_id) topk($process_top, sum by (process, process_id) (rate(windows_process_cpu_time_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval] @ end())))", + "expr": "sum by (process, process_id) (rate(windows_process_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval])) and on (process, process_id) topk($process_top, sum by (process, process_id) (rate(windows_process_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval] @ end())))", "instant": false, "legendFormat": "{{process}} ({{process_id}})", "range": true @@ -1272,7 +1272,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(rate(windows_process_cpu_time_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", + "expr": "sum(rate(windows_process_cpu_time_seconds_total{job=~\"$job\", instance=\"$instance\", process=~\"$process\", process_id!=\"0\"}[$__rate_interval])) / scalar(max(windows_cpu_logical_processor{job=~\"$job\", instance=\"$instance\"}))", "instant": false, "legendFormat": "__auto", "range": true diff --git a/dashboard/windows-exporter-smb.json b/dashboard/windows-exporter-smb.json index d16d24d9..cbe227d2 100644 --- a/dashboard/windows-exporter-smb.json +++ b/dashboard/windows-exporter-smb.json @@ -78,7 +78,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(windows_smb_server_shares_current_open_file_count{job=~\"$job\", instance=\"$instance\"})", + "expr": "sum(windows_smb_server_shares_open_files{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "__auto", "range": true @@ -163,7 +163,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "sum(windows_smb_server_shares_tree_connect_count{job=~\"$job\", instance=\"$instance\"})", + "expr": "sum(windows_smb_server_shares_tree_connects{job=~\"$job\", instance=\"$instance\"})", "instant": false, "legendFormat": "__auto", "range": true @@ -906,7 +906,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_smb_server_shares_current_open_file_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_smb_server_shares_open_files{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "{{share}}", "range": true @@ -1021,7 +1021,7 @@ "kind": "DataQuery", "spec": { "editorMode": "code", - "expr": "windows_smb_server_shares_tree_connect_count{job=~\"$job\", instance=\"$instance\"}", + "expr": "windows_smb_server_shares_tree_connects{job=~\"$job\", instance=\"$instance\"}", "instant": false, "legendFormat": "{{share}}", "range": true diff --git a/docs/collector.ad.md b/docs/collector.ad.md index 121ed5b8..22aa917c 100644 --- a/docs/collector.ad.md +++ b/docs/collector.ad.md @@ -26,7 +26,7 @@ Name | Description | Type | Labels `windows_ad_searches_total` | Total number of directory searches, by search scope (Base/Subtree/Onelevel searches) | counter | `scope` `windows_ad_database_operations_total` | Total number of directory database operations, by operation (Database adds/deletes/modifys/recycles) | counter | `operation` `windows_ad_binds_total` | Total number of binds, by bind method | counter | `bind_method` -`windows_ad_replication_highest_usn` | Highest update sequence number (USN) committed or issued by this domain controller (DRA Highest USN Committed/Issued) | counter | `state` +`windows_ad_replication_highest_usn_total` | Highest update sequence number (USN) committed or issued by this domain controller (DRA Highest USN Committed/Issued) | counter | `state` `windows_ad_replication_data_intrasite_bytes_total` | Total number of uncompressed bytes replicated within the site, by direction (DRA Inbound/Outbound Bytes Not Compressed (Within Site)) | counter | `direction` `windows_ad_replication_data_intersite_bytes_total` | Total number of compressed bytes, after compression, replicated between sites, by direction (DRA Inbound/Outbound Bytes Compressed (Between Sites, After Compression)) | counter | `direction` `windows_ad_replication_inbound_sync_objects_remaining` | Number of objects remaining until a full synchronization completes (DRA Inbound Full Sync Objects Remaining) | gauge | None diff --git a/docs/collector.cache.md b/docs/collector.cache.md index e5577cef..99c52877 100644 --- a/docs/collector.cache.md +++ b/docs/collector.cache.md @@ -27,7 +27,6 @@ Name | Description | Type | Labels `windows_cache_data_flushes_total` | Number of times the file system cache has flushed its contents to disk as the result of a request to flush or to satisfy a write-through file write request. | counter | None `windows_cache_data_flush_pages_total` | Number of pages the file system cache has flushed to disk as a result of a request to flush or to satisfy a write-through file write request. | counter | None `windows_cache_data_map_hits_total` | Number of data maps in the file system cache that could be resolved without having to retrieve a page from the disk, because the page was already in physical memory. | counter | None -`windows_cache_data_map_hits_percent` | Deprecated: raw data-map hit count, not a percentage. Use `windows_cache_data_map_hits_total`. | gauge | None `windows_cache_data_map_pins_total` | Number of data maps in the file system cache that resulted in pinning a page in main memory, an action usually preparatory to writing to the file on disk. | counter | None `windows_cache_data_maps_total` | Number of times that a file system such as NTFS, maps a page of a file into the file system cache to read the page. | counter | None `windows_cache_dirty_pages` | Number of dirty pages on the system cache. | gauge | None @@ -48,8 +47,6 @@ Name | Description | Type | Labels `windows_cache_sync_mdl_reads_total` | Number of reads from the file system cache that use a Memory Descriptor List (MDL) to access the pages. If the accessed page(s) are not in main memory, the caller will wait for the pages to fault in from the disk. | counter | None `windows_cache_sync_pin_reads_total` | Number of reads into the file system cache preparatory to writing the data back to disk. The file system will not regain control until the page is pinned in the file system cache, in particular if the disk must be accessed to retrieve the page. | counter | None -`windows_cache_data_map_hits_percent` is retained as a deprecated gauge exposing the same raw hit count as `windows_cache_data_map_hits_total`. It is not a percentage and can exceed 100. Use the hit-total counter for new queries. - ### Example metric Percentage of copy reads that hit the cache ``` diff --git a/docs/collector.container.md b/docs/collector.container.md index 8142e11a..9e31aefb 100644 --- a/docs/collector.container.md +++ b/docs/collector.container.md @@ -31,9 +31,9 @@ If the endpoint is not available, for example on hosts without Kubernetes, the H | Name | Description | Type | Labels | |------------------------------------------------------------|-----------------------------------------------------|---------|------------------------------------------------------------| | `windows_container_available` | Available | gauge | `container_id`,`namespace`,`pod`,`container`,`hostprocess` | -| `windows_container_count` | Number of running HCS containers | gauge | None | -| `windows_container_cpu_usage_seconds_kernelmode` | Runtime in Kernel mode in Seconds | counter | `container_id`,`namespace`,`pod`,`container` | -| `windows_container_cpu_usage_seconds_usermode` | Runtime in User mode in Seconds | counter | `container_id`,`namespace`,`pod`,`container` | +| `windows_containers` | Number of running HCS containers | gauge | None | +| `windows_container_cpu_usage_kernelmode_seconds_total` | Runtime in Kernel mode in Seconds | counter | `container_id`,`namespace`,`pod`,`container` | +| `windows_container_cpu_usage_usermode_seconds_total` | Runtime in User mode in Seconds | counter | `container_id`,`namespace`,`pod`,`container` | | `windows_container_cpu_usage_seconds_total` | Total Runtime in Seconds | counter | `container_id`,`namespace`,`pod`,`container` | | `windows_container_memory_page_faults_total` | Total number of page faults (HostProcess only) | counter | `container_id`,`namespace`,`pod`,`container` | | `windows_container_memory_usage_commit_bytes` | Memory Usage Commit Bytes | gauge | `container_id`,`namespace`,`pod`,`container` | @@ -60,7 +60,7 @@ If the endpoint is not available, for example on hosts without Kubernetes, the H `windows_container_storage_writable_layer_usage_bytes` is read from the CRI endpoint and only exported for Kubernetes containers. containerd measures it periodically, so it may lag behind and is missing until the first measurement. -`windows_container_count` only counts HCS containers. HostProcess and Hyper-V isolated containers aren't counted. +`windows_containers` only counts HCS containers. HostProcess and Hyper-V isolated containers aren't counted. ### Hyper-V isolated containers diff --git a/docs/collector.cpu.md b/docs/collector.cpu.md index 0d0f8500..096276a7 100644 --- a/docs/collector.cpu.md +++ b/docs/collector.cpu.md @@ -20,29 +20,29 @@ These metrics are available on all versions of Windows: |--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------------| | `windows_cpu_logical_processor` | Number of installed logical processors | gauge | None | | `windows_cpu_cstate_seconds_total` | Time spent in low-power idle states | counter | `core`, `state` | -| `windows_cpu_time_total` | Time that processor spent in different modes (dpc, idle, interrupt, privileged, user) | counter | `core`, `mode` | +| `windows_cpu_time_seconds_total` | Time that processor spent in different modes (dpc, idle, interrupt, privileged, user) | counter | `core`, `mode` | | `windows_cpu_interrupts_total` | Total number of received and serviced hardware interrupts | counter | `core` | | `windows_cpu_dpcs_total` | Total number of received and serviced deferred procedure calls (DPCs) | counter | `core` | | `windows_cpu_clock_interrupts_total` | Total number of received and serviced clock tick interrupts | counter | `core` | | `windows_cpu_idle_break_events_total` | Total number of time processor was woken from idle | counter | `core` | | `windows_cpu_parking_status` | Parking Status represents whether a processor is parked or not | gauge | `core` | -| `windows_cpu_core_frequency_mhz` | Core frequency in megahertz | gauge | `core` | +| `windows_cpu_core_frequency_hertz` | Core frequency in hertz | gauge | `core` | | `windows_cpu_processor_performance_total` | Processor Performance is the number of CPU cycles executing instructions by each core; it is believed to be similar to the value that the APERF MSR would show, were it exposed | counter | `core` | | `windows_cpu_processor_mperf_total` | Processor MPerf Total is proportioanl to the number of TSC ticks each core has accumulated while executing instructions. Due to the manner in which it is presented, it should be scaled by 1e2 to properly line up with Processor Performance Total. As above, it is believed to be closely related to the MPERF MSR. | counter | `core` | -| `windows_cpu_processor_rtc_total` | RTC total is assumed to represent the 64Hz tick rate in Windows. It is not by itself useful, but can be used with `windows_cpu_processor_utility_total` to more accurately measure CPU utilisation than with `windows_cpu_time_total` | counter | `core` | +| `windows_cpu_processor_rtc_total` | RTC total is assumed to represent the 64Hz tick rate in Windows. It is not by itself useful, but can be used with `windows_cpu_processor_utility_total` to more accurately measure CPU utilisation than with `windows_cpu_time_seconds_total` | counter | `core` | | `windows_cpu_processor_utility_total` | Processor Utility Total is a newer, more accurate measure of CPU utilization, in particular handling modern CPUs with variant CPU frequencies. The rate of this counter divided by the rate of `windows_cpu_processor_rtc_total` should provide an accurate view of CPU utilisation on modern systems, as observed in Task Manager. | counter | `core` | | `windows_cpu_processor_privileged_utility_total` | Processor Privileged Utility Total, when used in a similar fashion to `windows_cpu_processor_utility_total` will show the portion of CPU utilization which is happening in privileged mode. | counter | `core` | ### Example metric Show frequency of host CPU cores ``` -windows_cpu_core_frequency_mhz{instance="localhost"} +windows_cpu_core_frequency_hertz{instance="localhost"} ``` ## Useful queries Show CPU usage by mode. ``` -sum by (mode) (irate(windows_cpu_time_total{instance="localhost"}[5m])) +sum by (mode) (irate(windows_cpu_time_seconds_total{instance="localhost"}[5m])) ``` Show per-cpu utilisation using the processor utility metrics ``` @@ -72,7 +72,7 @@ count by (instance) ( Show actual average CPU frequency in Hz ``` avg by(instance) ( - 1e4 * windows_cpu_core_frequency_mhz{} + 1e-2 * windows_cpu_core_frequency_hertz{} * rate(windows_cpu_processor_performance_total{}[5m]) / rate(windows_cpu_processor_mperf_total{}[5m]) ) @@ -113,7 +113,7 @@ avg by(instance) ( ```yaml # Alert on hosts with more than 80% CPU usage over a 10 minute period - alert: CpuUsage - expr: 100 - (avg by (instance) (irate(windows_cpu_time_total{mode="idle"}[2m])) * 100) > 80 + expr: 100 - (avg by (instance) (irate(windows_cpu_time_seconds_total{mode="idle"}[2m])) * 100) > 80 for: 10m labels: severity: warning @@ -128,12 +128,12 @@ avg by(instance) ( - alert: NoCpuTurbo expr: | avg by(instance) ( - 1e4 * windows_cpu_core_frequency_mhz{} + 1e-2 * windows_cpu_core_frequency_hertz{} * rate(windows_cpu_processor_performance_total{}[5m]) / rate(windows_cpu_processor_mperf_total{}[5m]) ) / - (1e6 * avg by (instance) (windows_cpu_core_frequency_mhz)) + avg by (instance) (windows_cpu_core_frequency_hertz) < 1.1 for: 1h annotations: diff --git a/docs/collector.cpu_info.md b/docs/collector.cpu_info.md index 5c6904ac..710523f2 100644 --- a/docs/collector.cpu_info.md +++ b/docs/collector.cpu_info.md @@ -20,8 +20,8 @@ None | `windows_cpu_info` | Labelled CPU information | gauge | `architecture`, `device_id`, `description`, `family`, `name` | | `windows_cpu_info_core` | Number of cores per CPU | gauge | `device_id` | | `windows_cpu_info_enabled_core` | Number of enabled cores per CPU | gauge | `device_id` | -| `windows_cpu_info_l2_cache_size` | Size of L2 cache per CPU | gauge | `device_id` | -| `windows_cpu_info_l3_cache_size` | Size of L3 cache per CPU | gauge | `device_id` | +| `windows_cpu_info_l2_cache_size_bytes` | Size of L2 cache per CPU in bytes | gauge | `device_id` | +| `windows_cpu_info_l3_cache_size_bytes` | Size of L3 cache per CPU in bytes | gauge | `device_id` | | `windows_cpu_info_logical_processor` | Number of logical processors per CPU | gauge | `device_id` | | `windows_cpu_info_thread` | Number of threads per CPU | gauge | `device_id` | @@ -36,12 +36,12 @@ windows_cpu_info_core{device_id="CPU0"} 12 # HELP windows_cpu_info_enabled_core Number of enabled cores per CPU # TYPE windows_cpu_info_enabled_core gauge windows_cpu_info_enabled_core{device_id="CPU0"} 12 -# HELP windows_cpu_info_l2_cache_size Size of L2 cache per CPU -# TYPE windows_cpu_info_l2_cache_size gauge -windows_cpu_info_l2_cache_size{device_id="CPU0"} 6144 -# HELP windows_cpu_info_l3_cache_size Size of L3 cache per CPU -# TYPE windows_cpu_info_l3_cache_size gauge -windows_cpu_info_l3_cache_size{device_id="CPU0"} 65536 +# HELP windows_cpu_info_l2_cache_size_bytes Size of L2 cache per CPU in bytes +# TYPE windows_cpu_info_l2_cache_size_bytes gauge +windows_cpu_info_l2_cache_size_bytes{device_id="CPU0"} 6.291456e+06 +# HELP windows_cpu_info_l3_cache_size_bytes Size of L3 cache per CPU in bytes +# TYPE windows_cpu_info_l3_cache_size_bytes gauge +windows_cpu_info_l3_cache_size_bytes{device_id="CPU0"} 6.7108864e+07 # HELP windows_cpu_info_logical_processor Number of logical processors per CPU # TYPE windows_cpu_info_logical_processor gauge windows_cpu_info_logical_processor{device_id="CPU0"} 24 diff --git a/docs/collector.diskdrive.md b/docs/collector.diskdrive.md index 4f5a809b..29bf7245 100644 --- a/docs/collector.diskdrive.md +++ b/docs/collector.diskdrive.md @@ -19,7 +19,7 @@ None | `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` | 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_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 | ## Alerting examples diff --git a/docs/collector.exchange.md b/docs/collector.exchange.md index b867d4d2..d69e9fce 100644 --- a/docs/collector.exchange.md +++ b/docs/collector.exchange.md @@ -20,20 +20,20 @@ Supported values are `ADAccessProcesses`, `TransportQueues`, `HttpProxy`, `Activ ## Metrics | Name | Description | Type | Labels | |-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|---------|--------| -| `windows_exchange_rpc_avg_latency_sec` | The latency (sec), averaged for the past 1024 packets | gauge | None | +| `windows_exchange_rpc_avg_latency_seconds` | The latency in seconds, averaged for the past 1024 packets | gauge | None | | `windows_exchange_rpc_requests` | Number of client requests currently being processed by the RPC Client Access service | gauge | None | -| `windows_exchange_rpc_active_user_count` | Number of unique users that have shown some kind of activity in the last 2 minutes | gauge | None | -| `windows_exchange_rpc_connection_count` | Total number of client connections maintained | gauge | None | +| `windows_exchange_rpc_active_users` | Number of unique users that have shown some kind of activity in the last 2 minutes | gauge | None | +| `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_user_count` | Number of users | gauge | None | -| `windows_exchange_ldap_read_time_sec` | Time (sec) to send an LDAP read request and receive a response | counter | `name` | +| `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_sec` | Time (sec) to send an LDAP search request and receive a response | 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_sec` | Time (sec) to send an LDAP Add/Modify/Delete request and receive a response | 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_ops_per_sec` | Long Running LDAP operations per second | 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` | @@ -53,25 +53,25 @@ Supported values are `ADAccessProcesses`, `TransportQueues`, `HttpProxy`, `Activ | `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_sec` | Average latency (sec) of MailboxServerLocator web service calls | gauge | `name` | -| `windows_exchange_http_proxy_avg_auth_latency` | Average time spent authenticating CAS requests over the last 200 samples | gauge | `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_availability_service_requests_per_sec` | Number of requests serviced per second | counter | None | +| `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` | 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 | counter | `name` | -| `windows_exchange_workload_yielded_tasks` | The total number of tasks that have been yielded by a workload | counter | `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_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_sec` | Average latency (sec) of CAS processing time over the last 200 reqs | gauge | `name` | -| `windows_exchange_http_proxy_mailbox_proxy_failure_rate` | % 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 | `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_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_user_count` | Number of unique outlook users that have shown some kind of activity in the last 2 minutes | gauge | 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 | ### Example metric _This collector does not yet have explained examples, we would appreciate your help adding them!_ diff --git a/docs/collector.fsrmquota.md b/docs/collector.fsrmquota.md index cd8cbdce..a281405f 100644 --- a/docs/collector.fsrmquota.md +++ b/docs/collector.fsrmquota.md @@ -18,7 +18,7 @@ None Name | Description | Type | Labels -----|-------------|------|------- -`windows_fsrmquota_count` | Number of Quotas | gauge |None +`windows_fsrmquota_quotas` | Number of Quotas | gauge |None `windows_fsrmquota_description` | A string up to 1KB in size. Optional. The default value is an empty string. (Description) | gauge |`path`, `template`,`description` `windows_fsrmquota_disabled` | If 1, the quota is disabled. The default value is 0. (Disabled) | gauge |`path`, `template` `windows_fsrmquota_matchestemplate` | If 1, the property values of this quota match those values of the template from which it was derived. (MatchesTemplate) | gauge |`path`, `template` diff --git a/docs/collector.gpu.md b/docs/collector.gpu.md index 080710c3..62497645 100644 --- a/docs/collector.gpu.md +++ b/docs/collector.gpu.md @@ -61,13 +61,13 @@ logged at debug level and never fail the scrape. | `windows_gpu_engine_frequency_max_hertz` | Maximum clock frequency of the GPU engine in hertz, while not overclocked | gauge | `device_id`,`luid`,`phys`,`eng` | The engine frequency metrics are only exposed for engines that report a maximum frequency, typically the 3D engine. The -`eng` label matches the `eng` label of `windows_gpu_engine_time_seconds`. +`eng` label matches the `eng` label of `windows_gpu_engine_time_seconds_total`. ### Per-process Metrics | Name | Description | Type | Labels | |----------------------------------------------|-------------------------------------------------|---------|-----------------------------------------------------------| -| `windows_gpu_engine_time_seconds` | Total running time of the GPU engine in seconds | counter | `device_id`,`luid`,`phys`, `eng`, `engtype`, `process_id` | +| `windows_gpu_engine_time_seconds_total` | Total running time of the GPU engine in seconds | counter | `device_id`,`luid`,`phys`, `eng`, `engtype`, `process_id` | | `windows_gpu_process_memory_committed_bytes` | Total committed GPU memory in bytes per process | gauge | `device_id`,`luid`,`phys`,`process_id` | | `windows_gpu_process_memory_dedicated_bytes` | Dedicated GPU memory usage in bytes per process | gauge | `device_id`,`luid`,`phys`,`process_id` | | `windows_gpu_process_memory_local_bytes` | Local GPU memory usage in bytes per process | gauge | `device_id`,`luid`,`phys`,`process_id` | @@ -118,7 +118,7 @@ windows_gpu_adapter_memory_dedicated_bytes{phys="0"} ```promql sum by (phys) ( - rate(windows_gpu_engine_time_seconds{phys="0", engtype="3D"}[1m]) + rate(windows_gpu_engine_time_seconds_total{phys="0", engtype="3D"}[1m]) ) * 100 ``` @@ -126,7 +126,7 @@ sum by (phys) ( ```promql sum by (phys, process_id) ( - rate(windows_gpu_engine_time_seconds{process_id="1234", engtype="3D"}[1m]) + rate(windows_gpu_engine_time_seconds_total{process_id="1234", engtype="3D"}[1m]) ) * 100 ``` @@ -144,7 +144,7 @@ sum by (luid, process_id) ( ```promql topk(5, sum by (process_id) ( - rate(windows_gpu_engine_time_seconds[1m]) + rate(windows_gpu_engine_time_seconds_total[1m]) ) * 100) ``` @@ -159,7 +159,7 @@ sum by (phys) ( Show GPU engine time with process owner and command line: ```promql -windows_gpu_engine_time_seconds * on(process_id) group_left(owner, cmdline) windows_process_info +windows_gpu_engine_time_seconds_total * on(process_id) group_left(owner, cmdline) windows_process_info ``` **Show the engine clock as a ratio of its maximum clock:** @@ -177,7 +177,7 @@ windows_gpu_engine_frequency_hertz / windows_gpu_engine_frequency_max_hertz - alert: HighGpuUtilization expr: | sum by (process_id) ( - rate(windows_gpu_engine_time_seconds[1m]) + rate(windows_gpu_engine_time_seconds_total[1m]) ) * 100 > 80 for: 10m labels: diff --git a/docs/collector.hyperv.md b/docs/collector.hyperv.md index cef481d0..8d59e80d 100644 --- a/docs/collector.hyperv.md +++ b/docs/collector.hyperv.md @@ -54,37 +54,37 @@ prefixed with `windows_hyperv_datastore`. | `windows_hyperv_datastore_table_data_size_bytes` | Represents the table data size in bytes of the DataStore. | gauge | datastore | | `windows_hyperv_datastore_names_size_bytes` | Represents the names size in bytes of the DataStore. | gauge | datastore | | `windows_hyperv_datastore_number_of_keys` | Represents the number of keys in the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_reconnect_latency_microseconds` | Represents the reconnect latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_disconnect_count` | Represents the disconnect count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_write_to_file_byte_latency_microseconds` | Represents the write-to-file byte latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_write_to_file_byte_count` | Represents the write-to-file byte count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_write_to_file_count` | Represents the write-to-file count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_read_from_file_byte_latency_microseconds` | Represents the read-from-file byte latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_read_from_file_byte_count` | Represents the read-from-file byte count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_read_from_file_count` | Represents the read-from-file count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_write_to_storage_byte_latency_microseconds` | Represents the write-to-storage byte latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_write_to_storage_byte_count` | Represents the write-to-storage byte count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_write_to_storage_count` | Represents the write-to-storage count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_read_from_storage_byte_latency_microseconds` | Represents the read-from-storage byte latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_read_from_storage_byte_count` | Represents the read-from-storage byte count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_read_from_storage_count` | Represents the read-from-storage count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_commit_byte_latency_microseconds` | Represents the commit byte latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_commit_byte_count` | Represents the commit byte count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_commit_count` | Represents the commit count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_cache_update_operation_latency_microseconds` | Represents the cache update operation latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_cache_update_operation_count` | Represents the cache update operation count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_commit_operation_latency_microseconds` | Represents the commit operation latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_commit_operation_count` | Represents the commit operation count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_compact_operation_latency_microseconds` | Represents the compact operation latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_compact_operation_count` | Represents the compact operation count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_load_file_operation_latency_microseconds` | Represents the load file operation latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_load_file_operation_count` | Represents the load file operation count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_remove_operation_latency_microseconds` | Represents the remove operation latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_remove_operation_count` | Represents the remove operation count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_query_size_operation_latency_microseconds` | Represents the query size operation latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_query_size_operation_count` | Represents the query size operation count of the DataStore. | counter | datastore | -| `windows_hyperv_datastore_set_operation_latency_microseconds` | Represents the set operation latency in microseconds of the DataStore. | gauge | datastore | -| `windows_hyperv_datastore_set_operation_count` | Represents the set operation count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_reconnect_latency_seconds` | Represents the reconnect latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_disconnects_total` | Represents the disconnect count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_write_to_file_byte_latency_seconds` | Represents the write-to-file byte latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_write_to_file_bytes_total` | Represents the write-to-file byte count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_write_to_file_operations_total` | Represents the write-to-file count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_read_from_file_byte_latency_seconds` | Represents the read-from-file byte latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_read_from_file_bytes_total` | Represents the read-from-file byte count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_read_from_file_operations_total` | Represents the read-from-file count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_write_to_storage_byte_latency_seconds` | Represents the write-to-storage byte latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_write_to_storage_bytes_total` | Represents the write-to-storage byte count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_write_to_storage_operations_total` | Represents the write-to-storage count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_read_from_storage_byte_latency_seconds` | Represents the read-from-storage byte latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_read_from_storage_bytes_total` | Represents the read-from-storage byte count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_read_from_storage_operations_total` | Represents the read-from-storage count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_commit_byte_latency_seconds` | Represents the commit byte latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_commit_bytes_total` | Represents the commit byte count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_commits_total` | Represents the commit count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_cache_update_operation_latency_seconds` | Represents the cache update operation latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_cache_update_operations_total` | Represents the cache update operation count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_commit_operation_latency_seconds` | Represents the commit operation latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_commit_operations_total` | Represents the commit operation count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_compact_operation_latency_seconds` | Represents the compact operation latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_compact_operations_total` | Represents the compact operation count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_load_file_operation_latency_seconds` | Represents the load file operation latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_load_file_operations_total` | Represents the load file operation count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_remove_operation_latency_seconds` | Represents the remove operation latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_remove_operations_total` | Represents the remove operation count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_query_size_operation_latency_seconds` | Represents the query size operation latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_query_size_operations_total` | Represents the query size operation count of the DataStore. | counter | datastore | +| `windows_hyperv_datastore_set_operation_latency_seconds` | Represents the set operation latency in seconds of the DataStore. | gauge | datastore | +| `windows_hyperv_datastore_set_operations_total` | Represents the set operation count of the DataStore. | counter | datastore | ### Hyper-V Dynamic Memory Balancer @@ -129,14 +129,14 @@ is skipped with a warning. | Metric Name | Description | Type | Labels | |-------------------------------------------------|------------------------------------------------------------------------|-------|--------------------| -| `windows_hyperv_host_logical_processor_count` | Number of logical processors on the host | gauge | None | -| `windows_hyperv_vm_processor_count` | Number of virtual processors assigned to the VM | gauge | `vm_id`, `vm` | -| `windows_hyperv_total_vm_processor_count` | Total number of virtual processors assigned to all VMs | gauge | None | +| `windows_hyperv_host_logical_processors` | Number of logical processors on the host | gauge | None | +| `windows_hyperv_vm_processors` | Number of virtual processors assigned to the VM | gauge | `vm_id`, `vm` | +| `windows_hyperv_assigned_vm_processors` | Total number of virtual processors assigned to all VMs | gauge | None | The CPU allocation ratio can be computed in PromQL. Virtual cores per **logical** host core: ``` -windows_hyperv_total_vm_processor_count / windows_hyperv_host_logical_processor_count +windows_hyperv_assigned_vm_processors / windows_hyperv_host_logical_processors ``` Where hyper-threading (SMT) is enabled, the host reports two logical cores per physical core. @@ -147,8 +147,8 @@ Multiply by the number of threads per core to get the ratio per **physical** cor | Name | Description | Type | Labels | |----------------------------------------------------------------------|------------------------------------------------------------------------|---------|----------------| -| `windows_hyperv_hypervisor_logical_processor_time_total` | Time that processor spent in different modes (hypervisor, guest, idle) | counter | `core`,`state` | -| `windows_hyperv_hypervisor_logical_processor_total_run_time_total` | Time that processor spent | counter | `core` | +| `windows_hyperv_hypervisor_logical_processor_time_seconds_total` | Time that processor spent in different modes (hypervisor, guest, idle) | counter | `core`,`state` | +| `windows_hyperv_hypervisor_logical_processor_total_run_time_seconds_total` | Time that processor spent | counter | `core` | | `windows_hyperv_hypervisor_logical_processor_context_switches_total` | The rate of virtual processor context switches on the processor. | counter | `core` | ### Hyper-V Hypervisor Root Partition @@ -168,12 +168,12 @@ Multiply by the number of threads per core to get the ratio per **physical** cor | `windows_hyperv_root_partition_io_tlb_flushes_total` | The number of flushes of I/O TLBs of the partition | counter | None | | `windows_hyperv_root_partition_recommended_virtual_tlb_size` | The recommended number of pages to be deposited for the virtual TLB | gauge | None | | `windows_hyperv_root_partition_skipped_timer_ticks_total` | The number of timer interrupts skipped for the partition | counter | None | -| `windows_hyperv_root_partition_1G_device_pages` | The number of 1G pages present in the device space of the partition | gauge | None | -| `windows_hyperv_root_partition_1G_gpa_pages` | The number of 1G pages present in the GPA space of the partition | gauge | None | -| `windows_hyperv_root_partition_2M_device_pages` | The number of 2M pages present in the device space of the partition | gauge | None | -| `windows_hyperv_root_partition_2M_gpa_pages` | The number of 2M pages present in the GPA space of the partition | gauge | None | -| `windows_hyperv_root_partition_4K_device_pages` | The number of 4K pages present in the device space of the partition | gauge | None | -| `windows_hyperv_root_partition_4K_gpa_pages` | The number of 4K pages present in the GPA space of the partition | gauge | None | +| `windows_hyperv_root_partition_1g_device_pages` | The number of 1G pages present in the device space of the partition | gauge | None | +| `windows_hyperv_root_partition_1g_gpa_pages` | The number of 1G pages present in the GPA space of the partition | gauge | None | +| `windows_hyperv_root_partition_2m_device_pages` | The number of 2M pages present in the device space of the partition | gauge | None | +| `windows_hyperv_root_partition_2m_gpa_pages` | The number of 2M pages present in the GPA space of the partition | gauge | None | +| `windows_hyperv_root_partition_4k_device_pages` | The number of 4K pages present in the device space of the partition | gauge | None | +| `windows_hyperv_root_partition_4k_gpa_pages` | The number of 4K pages present in the GPA space of the partition | gauge | None | | `windows_hyperv_root_partition_virtual_tlb_flush_entries_total` | The number of flushes of the entire virtual TLB | counter | None | | `windows_hyperv_root_partition_virtual_tlb_pages` | The number of pages used by the virtual TLB of the partition | gauge | None | @@ -182,8 +182,8 @@ Multiply by the number of threads per core to get the ratio per **physical** cor | Name | Description | Type | Labels | |---------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|---------|----------------| -| `windows_hyperv_hypervisor_root_virtual_processor_time_total` | Time in seconds that processor spent in different modes (`state`: `guest_run`, `hypervisor`, `remote`) | counter | `core`,`state` | -| `windows_hyperv_hypervisor_root_virtual_processor_total_run_time_total` | Time in seconds that processor spent running | counter | `core` | +| `windows_hyperv_hypervisor_root_virtual_processor_time_seconds_total` | Time in seconds that processor spent in different modes (`state`: `guest_run`, `hypervisor`, `remote`) | counter | `core`,`state` | +| `windows_hyperv_hypervisor_root_virtual_processor_total_run_time_seconds_total` | Time in seconds that processor spent running | counter | `core` | | `windows_hyperv_hypervisor_root_virtual_processor_cpu_wait_seconds_total` | The time spent waiting for a virtual processor to be dispatched onto a logical processor. Divide its rate by the rate of `windows_hyperv_hypervisor_root_virtual_processor_dispatches_total` for the average wait per dispatch | counter | `core` | | `windows_hyperv_hypervisor_root_virtual_processor_dispatches_total` | The number of times the virtual processor was dispatched onto a logical processor | counter | `core` | @@ -277,12 +277,10 @@ Example alert: | Name | Description | Type | Labels | |--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|---------|-----------------------| -| `windows_hyperv_hypervisor_virtual_processor_mode_time_total` | Time in seconds that processor spent in different modes (`state`: `hypervisor`, `guest`, `remote`) | counter | `vm`, `core`, `state` | -| `windows_hyperv_hypervisor_virtual_processor_run_time_total` | Time in seconds that processor spent running | counter | `vm`, `core` | +| `windows_hyperv_hypervisor_virtual_processor_mode_time_seconds_total` | Time in seconds that processor spent in different modes (`state`: `hypervisor`, `guest`, `remote`) | counter | `vm`, `core`, `state` | +| `windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total` | Time in seconds that processor spent running | counter | `vm`, `core` | | `windows_hyperv_hypervisor_virtual_processor_cpu_wait_seconds_total` | The time spent waiting for a virtual processor to be dispatched onto a logical processor. Divide its rate by the rate of `windows_hyperv_hypervisor_virtual_processor_dispatches_total` for the average wait per dispatch | counter | `vm`, `core` | | `windows_hyperv_hypervisor_virtual_processor_dispatches_total` | The number of times the virtual processor was dispatched onto a logical processor | counter | `vm`, `core` | -| `windows_hyperv_hypervisor_virtual_processor_time_total` | **Deprecated:** use `windows_hyperv_hypervisor_virtual_processor_mode_time_total`. Time in seconds that processor spent in different modes (`state`: `hypervisor`, `guest`, `remote`) | counter | `vm`, `core`, `state` | -| `windows_hyperv_hypervisor_virtual_processor_total_run_time_total` | **Deprecated:** use `windows_hyperv_hypervisor_virtual_processor_run_time_total`. Time in seconds that processor spent running | counter | `vm`, `core` | ### Hyper-V Virtual Network Adapter @@ -299,7 +297,7 @@ Example alert: | Name | Description | Type | Labels | |-------------------------------------------------------|----------------------------------------------|---------|--------------------------------| -| `windows_hyperv_virtual_network_adapter_drop_reasons` | Hyper-V Virtual Network Adapter Drop Reasons | counter | `adapter`,`reason`,`direction` | +| `windows_hyperv_virtual_network_adapter_drop_reasons_total` | Number of packets dropped by a Hyper-V virtual network adapter, by drop reason and direction | counter | `adapter`,`reason`,`direction` | ### Hyper-V Virtual SMB @@ -307,21 +305,21 @@ Example alert: |-------------------------------------------------------|-----------------------------------------------------------------------------------|---------|------------| | `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_write_bytes_rdma` | Represents the number of bytes written per second using RDMA in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_write_bytes` | Represents the number of bytes written per second in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_read_bytes_rdma` | Represents the number of bytes read per second using RDMA in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_read_bytes` | Represents the number of bytes read per second in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_flush_requests` | Represents the number of flush requests per second in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_write_requests_rdma` | Represents the number of write requests per second using RDMA in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_write_requests` | Represents the number of write requests per second in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_read_requests_rdma` | Represents the number of read requests per second using RDMA in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_read_requests` | Represents the number of read requests per second in the virtual SMB` | counter | `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_current_open_file_count` | Represents the current number of open files in the virtual SMB` | gauge | `instance` | -| `windows_hyperv_virtual_smb_tree_connect_count` | Represents the number of tree connects in the virtual SMB` | gauge | `instance` | -| `windows_hyperv_virtual_smb_requests` | Represents the number of requests per second in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_sent_bytes` | Represents the number of bytes sent per second in the virtual SMB` | counter | `instance` | -| `windows_hyperv_virtual_smb_received_bytes` | Represents the number of bytes received per second in the virtual SMB` | counter | `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` | ### Hyper-V Virtual Switch @@ -354,32 +352,23 @@ Example alert: | Name | Description | Type | Labels | |------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|---------|----------| -| `windows_hyperv_virtual_storage_device_error_count_total` | Represents the total number of errors that have occurred on this virtual device. | counter | `device` | -| `windows_hyperv_virtual_storage_device_queue_length` | **Deprecated:** use `rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total)`. Cumulative queue length in 100ns ticks, see below. | gauge | `device` | -| `windows_hyperv_virtual_storage_device_bytes_read` | Represents the total number of bytes that have been read on this virtual device. | counter | `device` | +| `windows_hyperv_virtual_storage_device_errors_total` | Represents the total number of errors that have occurred on this virtual device. | counter | `device` | +| `windows_hyperv_virtual_storage_device_read_bytes_total` | Represents the total number of bytes that have been read on this virtual device. | counter | `device` | | `windows_hyperv_virtual_storage_device_operations_read_total` | Represents the total number of read operations that have occurred on this virtual device. | counter | `device` | -| `windows_hyperv_virtual_storage_device_bytes_written` | Represents the total number of bytes that have been written on this virtual device. | counter | `device` | +| `windows_hyperv_virtual_storage_device_written_bytes_total` | Represents the total number of bytes that have been written on this virtual device. | counter | `device` | | `windows_hyperv_virtual_storage_device_operations_written_total` | Represents the total number of write operations that have occurred on this virtual device. | counter | `device` | | `windows_hyperv_virtual_storage_device_io_latency_seconds_total` | Represents the total IO transfer latency for this virtual device. | counter | `device` | -| `windows_hyperv_virtual_storage_device_latency_seconds` | **Deprecated:** use `windows_hyperv_virtual_storage_device_io_latency_seconds_total`. Cumulative IO transfer latency in 100ns ticks, see below. | gauge | `device` | | `windows_hyperv_virtual_storage_device_throughput_total` | Represents the total number of IO transfers completed by this virtual device. | counter | `device` | | `windows_hyperv_virtual_storage_device_normalized_throughput_total` | Represents the total number of IO transfers completed by this virtual device, normalized to 8KB transfers. | counter | `device` | | `windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total` | Represents the total IO transfer latency on the underlying storage subsystem for this virtual device. | counter | `device` | -| `windows_hyperv_virtual_storage_device_lower_queue_length` | **Deprecated:** use `rate(windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total)`. Cumulative queue length in 100ns ticks, see below. | gauge | `device` | -| `windows_hyperv_virtual_storage_device_lower_latency_seconds` | **Deprecated:** use `windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total`. Cumulative IO transfer latency in 100ns ticks, see below. | gauge | `device` | | `windows_hyperv_virtual_storage_device_io_quota_replenishment_total` | Represents the IO quota replenishment counter for this virtual device. Use `rate()` for the replenishment rate. | counter | `device` | -#### Deprecated latency and queue length metrics +#### Latency and queue length The `Latency`, `Lower Latency`, `Queue Length` and `Lower Queue Length` performance counters -are averages that Windows computes from two samples. windows_exporter reads their raw values, -which only grow: the sum of all IO latencies in 100ns ticks. The raw queue length values are -the same as the raw latency values. - -`windows_hyperv_virtual_storage_device_latency_seconds`, `windows_hyperv_virtual_storage_device_lower_latency_seconds`, -`windows_hyperv_virtual_storage_device_queue_length` and `windows_hyperv_virtual_storage_device_lower_queue_length` -keep exposing these raw values as gauges for compatibility. They are deprecated and will be removed in a future release. -Use the `*_io_latency_seconds_total` counters instead: +are averages that Windows computes from two samples. Their raw values only grow: the sum of +all IO latencies in 100ns ticks, and the raw queue length values are the same as the raw +latency values. windows_exporter publishes them as the `*_io_latency_seconds_total` counters: ```promql # Average IO latency in seconds @@ -491,7 +480,7 @@ Disks that could not be read, and stale data: | Name | Description | Type | Labels | |------------------------------------------------------|-------------------------------------------------------|-------|--------| -| `windows_hyperv_virtual_machine_health_total_count` | Represents the number of virtual machines with health | gauge | `state` | +| `windows_hyperv_virtual_machines` | Number of virtual machines by health state | gauge | `state` | ### Example metric @@ -500,19 +489,19 @@ _This collector does not yet have explained examples, we would appreciate your h ## Useful queries Percent of physical CPU resources used per VM (on instance "localhost") ``` -sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_total{instance="localhost"}[1m])) / ignoring(vm) group_left max (windows_cpu_logical_processor{instance="localhost"}) * 100 +sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total{instance="localhost"}[1m])) / ignoring(vm) group_left max (windows_cpu_logical_processor{instance="localhost"}) * 100 ``` Percent of physical CPU resources used by all VMs (on all monitored hosts) ``` -(sum by (instance)(rate(windows_hyperv_hypervisor_virtual_processor_run_time_total{}[1m]))) / max by (instance)(windows_cpu_logical_processor{}) * 100 +(sum by (instance)(rate(windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total{}[1m]))) / max by (instance)(windows_cpu_logical_processor{}) * 100 ``` Percent of physical CPU resources by the hosts themselves (on all monitored hosts) ``` -(sum by (instance)(rate(windows_hyperv_hypervisor_root_virtual_processor_total_run_time_total{}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) * 100 +(sum by (instance)(rate(windows_hyperv_hypervisor_root_virtual_processor_total_run_time_seconds_total{}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) * 100 ``` Percent of physical CPU resources by the hypervisor (on all monitored hosts) ``` -(sum by (instance)(rate(windows_hyperv_hypervisor_logical_processor_time_total{state="hypervisor"}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) * 100 +(sum by (instance)(rate(windows_hyperv_hypervisor_logical_processor_time_seconds_total{state="hypervisor"}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) * 100 ``` ## Alerting examples diff --git a/docs/collector.iis.md b/docs/collector.iis.md index cb4b1659..5d0d4f23 100644 --- a/docs/collector.iis.md +++ b/docs/collector.iis.md @@ -55,7 +55,7 @@ See [#2698](https://github.com/prometheus-community/windows_exporter/issues/2698 | `windows_iis_current_connections` | The number of active connections to the web service | gauge | `site` | | `windows_iis_current_isapi_extension_requests` | The number of [ISAPI extension](https://docs.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms525172(v=vs.90)) requests that are being processed simultaneously by the web service | gauge | `site` | | `windows_iis_current_non_anonymous_users` | The number of users who currently have a nonanonymous request pending with the web service | gauge | `site` | -| `windows_iis_service_uptime` | The uptime for the web service or a site (seconds) | gauge | `site` | +| `windows_iis_service_uptime_seconds` | The uptime for the web service or a site (seconds) | gauge | `site` | | `windows_iis_received_bytes_total` | The total bytes of data that have been received by the web service since the service started | counter | `site` | | `windows_iis_sent_bytes_total` | The number of data bytes that have been sent by the web service since the service started | counter | `site` | | `windows_iis_anonymous_users_total` | The number of users who have established an anonymous request since the web service started | counter | `site` | @@ -65,7 +65,7 @@ See [#2698](https://github.com/prometheus-community/windows_exporter/issues/2698 | `windows_iis_requests_total` | The number of requests that have been made since the web service was started | counter | `site`, `method` | | `windows_iis_files_received_total` | The total number of files that have been received by the FTP service since the service started | counter | `site` | | `windows_iis_files_sent_total` | The total number of files that have been sent by the FTP service since the service started | counter | `site` | -| `windows_iis_ipapi_extension_requests_total` | The number of ISAPI extension requests that have been made since the web service started | counter | `site` | +| `windows_iis_isapi_extension_requests_total` | The number of ISAPI extension requests that have been made since the web service started | counter | `site` | | `windows_iis_locked_errors_total` | The number of requests that have been made since the service started that could not be satisfied by the server because the requested document was locked. Usually reported as HTTP error 423 | counter | `site` | | `windows_iis_logon_attempts_total` | The number of attempts to log on to the web service that have occurred since the service started | counter | `site` | | `windows_iis_non_anonymous_users_total` | The number of users who have made nonanonymous requests to the web service since the service started | counter | `site` | @@ -77,16 +77,16 @@ See [#2698](https://github.com/prometheus-community/windows_exporter/issues/2698 | `windows_iis_maximum_worker_processes` | The maximum number of worker processes that have been created for the application pool since Windows Process Activation Service (WAS) started | gauge | `app` | | `windows_iis_recent_worker_process_failures` | The number of times that worker processes for the application pool failed during the rapid-fail protection interval | gauge | `app` | | `windows_iis_time_since_last_worker_process_failure_seconds` | The length of time, in seconds, since the last worker process failure occurred for the application pool. Equals the pool uptime if no worker process failed | gauge | `app` | -| `windows_iis_total_application_pool_recycles` | The number of times that the application pool has been recycled since Windows Process Activation Service (WAS) started | counter | `app` | +| `windows_iis_application_pool_recycles_total` | The number of times that the application pool has been recycled since Windows Process Activation Service (WAS) started | counter | `app` | | `windows_iis_total_application_pool_uptime_seconds` | The time, in seconds, since the application pool was first started after the Windows Process Activation Service (WAS) started | gauge | `app` | -| `windows_iis_total_worker_processes_created` | The number of worker processes created for the application pool since Windows Process Activation Service (WAS) started | counter | `app` | -| `windows_iis_total_worker_process_failures` | The number of times that worker processes have crashed since the application pool was started | counter | `app` | -| `windows_iis_total_worker_process_ping_failures` | The number of times that Windows Process Activation Service (WAS) did not receive a response to ping messages sent to a worker process | counter | `app` | -| `windows_iis_total_worker_process_shutdown_failures` | The number of times that Windows Process Activation Service (WAS) failed to shut down a worker process | counter | `app` | -| `windows_iis_total_worker_process_startup_failures` | The number of times that Windows Process Activation Service (WAS) failed to start a worker process | counter | `app` | +| `windows_iis_worker_processes_created_total` | The number of worker processes created for the application pool since Windows Process Activation Service (WAS) started | counter | `app` | +| `windows_iis_worker_process_failures_total` | The number of times that worker processes have crashed since the application pool was started | counter | `app` | +| `windows_iis_worker_process_ping_failures_total` | The number of times that Windows Process Activation Service (WAS) did not receive a response to ping messages sent to a worker process | counter | `app` | +| `windows_iis_worker_process_shutdown_failures_total` | The number of times that Windows Process Activation Service (WAS) failed to shut down a worker process | counter | `app` | +| `windows_iis_worker_process_startup_failures_total` | The number of times that Windows Process Activation Service (WAS) failed to start a worker process | counter | `app` | | `windows_iis_worker_cache_active_flushed_entries` | Number of file handles cached that will be closed when all current transfers complete | gauge | `app`, `pid` | | `windows_iis_worker_file_cache_memory_bytes` | Current number of bytes used by file cache | gauge | `app`, `pid` | -| `windows_iis_worker_file_cache_max_memory_bytes` | Maximum number of bytes used by file cache | counter | `app`, `pid` | +| `windows_iis_worker_file_cache_max_memory_bytes` | Maximum number of bytes used by file cache | gauge | `app`, `pid` | | `windows_iis_worker_file_cache_flushes_total` | Total number of file cache flushes (since service startup) | counter | `app`, `pid` | | `windows_iis_worker_file_cache_queries_total` | Total file cache queries (hits + misses) | counter | `app`, `pid` | | `windows_iis_worker_file_cache_hits_total` | Total number of successful lookups in the user-mode file cache | counter | `app`, `pid` | @@ -123,7 +123,7 @@ See [#2698](https://github.com/prometheus-community/windows_exporter/issues/2698 | `windows_iis_worker_websocket_connection_rejected_total` | Total number of WebSocket connections rejected since the worker process started | counter | `app`, `pid` | | `windows_iis_server_cache_active_flushed_entries` | Number of file handles cached that will be closed when all current transfers complete | gauge | None | | `windows_iis_server_file_cache_memory_bytes` | Current number of bytes used by file cache | gauge | None | -| `windows_iis_server_file_cache_max_memory_bytes` | Maximum number of bytes used by file cache | counter | None | +| `windows_iis_server_file_cache_max_memory_bytes` | Maximum number of bytes used by file cache | gauge | None | | `windows_iis_server_file_cache_flushes_total` | Total number of file cache flushes (since service startup) | counter | None | | `windows_iis_server_file_cache_queries_total` | Total number of file cache queries (hits + misses) | counter | None | | `windows_iis_server_file_cache_hits_total` | Total number of successful lookups in the file cache | counter | None | diff --git a/docs/collector.mscluster.md b/docs/collector.mscluster.md index c3586d13..e3f5be9a 100644 --- a/docs/collector.mscluster.md +++ b/docs/collector.mscluster.md @@ -30,27 +30,27 @@ Matching is case-sensitive. All of these subcollectors are enabled by default. | Name | Description | Type | Labels | |-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|--------| -| `windows_mscluster_cluster_add_evict_delay` | Provides access to the cluster's AddEvictDelay property, which is the number a seconds that a new node is delayed after an eviction of another node. | 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 | `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` | CSV BlockCache Size in MB. | gauge | `name` | -| `windows_mscluster_cluster_clus_svc_hang_timeout` | Controls how long 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` | Controls how long 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` | Controls how long the membership leader will wait to reach full connectivity between cluster nodes. | gauge | `name` | -| `windows_mscluster_cluster_clus_svc_regroup_stage_timeout` | Controls how long 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_in_milliseconds` | Controls how frequently the membership algorithm is sending periodic membership messages. | 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` | 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_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` | Controls the maximum size of the cluster log files on each of the nodes. | 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` | Controls how long the cluster network driver waits in milliseconds between sending Cluster Service heartbeats across sites. | 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` | Controls how long the cluster network driver waits in milliseconds between sending Cluster Service heartbeats across subnets. | 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` | @@ -64,8 +64,8 @@ Matching is case-sensitive. All of these subcollectors are enabled by default. | `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` | The grace period timeout in milliseconds. | gauge | `name` | -| `windows_mscluster_cluster_group_dependency_timeout` | The timeout after which a group will be brought online despite unsatisfied dependencies | 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` | @@ -78,35 +78,33 @@ Matching is case-sensitive. All of these subcollectors are enabled by default. | `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` | The quarantine period timeout in milliseconds. | 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` | Controls the maximum time necessary to decide the Quorum owner node. | gauge | `name` | -| `windows_mscluster_cluster_quorum_arbitration_time_min` | Controls the minimum time necessary to decide the Quorum owner node. | gauge | `name` | -| `windows_mscluster_cluster_quorum_log_file_size` | This property is obsolete. | 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` | Controls the request reply time-out period. | gauge | `name` | -| `windows_mscluster_cluster_resiliency_default_period` | The default resiliency period, in seconds, for the cluster. | 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_resource_dll_deadlock_period` | This property is obsolete. | gauge | `name` | -| `windows_mscluster_cluster_root_memory_reserved` | Controls the amount of memory reserved for the parent partition on all cluster nodes. | 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_percent` | Percentage of allocated flash space to utilize when caching. | gauge | `name` | -| `windows_mscluster_cluster_s2d_cache_page_size_k_bytes` | Page size in KB used by S2D 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` | The I/O latency threshold for storage spaces direct. | 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` | Controls how long the cluster network driver waits in milliseconds between sending Cluster Service heartbeats on the same subnet. | 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` | CSV VSS Writer operation timeout in seconds. | gauge | `name` | -| `windows_mscluster_cluster_shutdown_timeout_in_minutes` | The maximum time in minutes allowed for cluster resources to come offline during cluster service shutdown. | 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` | 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_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` | Controls the witness restart interval. | gauge | `name` | +| `windows_mscluster_cluster_witness_restart_interval_seconds` | Controls the witness restart interval in seconds. | gauge | `name` | ### Network @@ -142,20 +140,20 @@ Matching is case-sensitive. All of these subcollectors are enabled by default. | 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` | Indicates the length of time to wait, in milliseconds, before declaring a deadlock in any call into a resource. | 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` | Provides access to the resource's IsAlivePollInterval property, which is the recommended interval in milliseconds at which the Cluster Service should poll the resource to determine whether it is operational. If the property is set to 0xFFFFFFFF, the Cluster Service uses the IsAlivePollInterval property for the resource type associated with the resource. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_looks_alive_poll_interval` | Provides access to the resource's LooksAlivePollInterval property, which is the recommended interval in milliseconds at which the Cluster Service should poll the resource to determine whether it appears operational. If the property is set to 0xFFFFFFFF, the Cluster Service uses the LooksAlivePollInterval property for the resource type associated with the resource. | 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` | Provides access to the resource's PendingTimeout property. If a resource cannot be brought online or taken offline in the number of milliseconds specified by the PendingTimeout property, the resource is forcibly terminated. | gauge | `type`, `owner_group`, `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` | Indicates the time delay before a failed resource is restarted. | gauge | `type`, `owner_group`, `name` | -| `windows_mscluster_resource_restart_period` | Provides access to the resource's RestartPeriod property, which is interval of time, in milliseconds, during which a specified number of restart attempts can be made on a nonresponsive resource. | 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` | Provides access to the resource's RetryPeriodOnFailure property, which is the interval of 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_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` | @@ -169,13 +167,13 @@ Matching is case-sensitive. All of these subcollectors are enabled by default. | `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` | The FailoverPeriod property specifies a number of hours during which a maximum number of failover attempts, specified by the FailoverThreshold property, can occur. | 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` | The resiliency period for this group, in seconds. | 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` | ### Shared Volumes diff --git a/docs/collector.msmq.md b/docs/collector.msmq.md index 289f6f87..75c84a7d 100644 --- a/docs/collector.msmq.md +++ b/docs/collector.msmq.md @@ -14,8 +14,8 @@ The msmq collector exposes metrics about the queues on a MSMQ server | Name | Description | Type | Labels | |------------------------------------------|---------------------------------|-------|--------| -| `windows_msmq_bytes_in_journal_queue` | Size of queue journal in bytes | gauge | `name` | -| `windows_msmq_bytes_in_queue` | Size of queue in bytes | gauge | `name` | +| `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` | diff --git a/docs/collector.mssql.md b/docs/collector.mssql.md index 5387a282..7300e8cb 100644 --- a/docs/collector.mssql.md +++ b/docs/collector.mssql.md @@ -21,164 +21,164 @@ Comma-separated list of MSSQL WMI classes to use. Supported values are `accessme |--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-------------------------------| | `windows_mssql_collector_duration_seconds` | The time taken for each sub-collector to return | gauge | `collector`, `mssql_instance` | | `windows_mssql_collector_success` | 1 if sub-collector succeeded, 0 otherwise | gauge | `collector`, `mssql_instance` | -| `windows_mssql_accessmethods_au_batch_cleanups` | The total number of batches that were completed successfully by the background task that cleans up deferred dropped allocation units | counter | `mssql_instance` | -| `windows_mssql_accessmethods_au_cleanups` | The total number of allocation units that were successfully dropped the background task that cleans up deferred dropped allocation units. Each allocation unit drop requires multiple batches | counter | `mssql_instance` | -| `windows_mssql_accessmethods_by_reference_lob_creates` | The total count of large object (lob) values that were passed by reference. By-reference lobs are used in certain bulk operations to avoid the cost of passing them by value | counter | `mssql_instance` | -| `windows_mssql_accessmethods_by_reference_lob_uses` | The total count of by-reference lob values that were used. By-reference lobs are used in certain bulk operations to avoid the cost of passing them by-value | counter | `mssql_instance` | -| `windows_mssql_accessmethods_lob_read_aheads` | The total count of lob pages on which readahead was issued | counter | `mssql_instance` | -| `windows_mssql_accessmethods_column_value_pulls` | The total count of column values that were pulled in-row from off-row | counter | `mssql_instance` | -| `windows_mssql_accessmethods_column_value_pushes` | The total count of column values that were pushed from in-row to off-row | counter | `mssql_instance` | +| `windows_mssql_accessmethods_au_batch_cleanups_total` | The total number of batches that were completed successfully by the background task that cleans up deferred dropped allocation units | counter | `mssql_instance` | +| `windows_mssql_accessmethods_au_cleanups_total` | The total number of allocation units that were successfully dropped the background task that cleans up deferred dropped allocation units. Each allocation unit drop requires multiple batches | counter | `mssql_instance` | +| `windows_mssql_accessmethods_by_reference_lob_creates_total` | The total count of large object (lob) values that were passed by reference. By-reference lobs are used in certain bulk operations to avoid the cost of passing them by value | counter | `mssql_instance` | +| `windows_mssql_accessmethods_by_reference_lob_uses_total` | The total count of by-reference lob values that were used. By-reference lobs are used in certain bulk operations to avoid the cost of passing them by-value | counter | `mssql_instance` | +| `windows_mssql_accessmethods_lob_read_aheads_total` | The total count of lob pages on which readahead was issued | counter | `mssql_instance` | +| `windows_mssql_accessmethods_column_value_pulls_total` | The total count of column values that were pulled in-row from off-row | counter | `mssql_instance` | +| `windows_mssql_accessmethods_column_value_pushes_total` | The total count of column values that were pushed from in-row to off-row | counter | `mssql_instance` | | `windows_mssql_accessmethods_deferred_dropped_aus` | The total number of allocation units waiting to be dropped by the background task that cleans up deferred dropped allocation units | gauge | `mssql_instance` | | `windows_mssql_accessmethods_deferred_dropped_rowsets` | The number of rowsets created as a result of aborted online index build operations that are waiting to be dropped by the background task that cleans up deferred dropped rowsets | gauge | `mssql_instance` | -| `windows_mssql_accessmethods_dropped_rowset_cleanups` | The number of rowsets per second created as a result of aborted online index build operations that were successfully dropped by the background task that cleans up deferred dropped rowsets | counter | `mssql_instance` | -| `windows_mssql_accessmethods_dropped_rowset_skips` | The number of rowsets per second created as a result of aborted online index build operations that were skipped by the background task that cleans up deferred dropped rowsets created | counter | `mssql_instance` | -| `windows_mssql_accessmethods_extent_deallocations` | Number of extents deallocated per second in all databases in this instance of SQL Server | counter | `mssql_instance` | -| `windows_mssql_accessmethods_extent_allocations` | Number of extents allocated per second in all databases in this instance of SQL Server | counter | `mssql_instance` | -| `windows_mssql_accessmethods_au_batch_cleanup_failures` | The number of batches per second that failed and required retry, by the background task that cleans up deferred dropped allocation units. Failure could be due to lack of memory or disk space, hardware failure and other reasons | counter | `mssql_instance` | -| `windows_mssql_accessmethods_leaf_page_cookie_failures` | The number of times that a leaf page cookie could not be used during an index search since changes happened on the leaf page. The cookie is used to speed up index search | counter | `mssql_instance` | -| `windows_mssql_accessmethods_tree_page_cookie_failures` | The number of times that a tree page cookie could not be used during an index search since changes happened on the parent pages of those tree pages. The cookie is used to speed up index search | counter | `mssql_instance` | -| `windows_mssql_accessmethods_forwarded_records` | Number of records per second fetched through forwarded record pointers | counter | `mssql_instance` | -| `windows_mssql_accessmethods_free_space_page_fetches` | Number of pages fetched per second by free space scans. These scans search for free space within pages already allocated to an allocation unit, to satisfy requests to insert or modify record fragments | counter | `mssql_instance` | -| `windows_mssql_accessmethods_free_space_scans` | Number of scans per second that were initiated to search for free space within pages already allocated to an allocation unit to insert or modify record fragment. Each scan may find multiple pages | counter | `mssql_instance` | -| `windows_mssql_accessmethods_full_scans` | Number of unrestricted full scans per second. These can be either base-table or full-index scans | counter | `mssql_instance` | -| `windows_mssql_accessmethods_index_searches` | Number of index searches per second. These are used to start a range scan, reposition a range scan, revalidate a scan point, fetch a single index record, and search down the index to locate where to insert a new row | counter | `mssql_instance` | -| `windows_mssql_accessmethods_insysxact_waits` | Number of times a reader needs to wait for a page because the InSysXact bit is set | counter | `mssql_instance` | -| `windows_mssql_accessmethods_lob_handle_creates` | Count of temporary lobs created | counter | `mssql_instance` | -| `windows_mssql_accessmethods_lob_handle_destroys` | Count of temporary lobs destroyed | counter | `mssql_instance` | -| `windows_mssql_accessmethods_lob_ss_provider_creates` | Count of LOB Storage Service Providers (LobSSP) created. One worktable created per LobSSP | counter | `mssql_instance` | -| `windows_mssql_accessmethods_lob_ss_provider_destroys` | Count of LobSSP destroyed | counter | `mssql_instance` | -| `windows_mssql_accessmethods_lob_ss_provider_truncations` | Count of LobSSP truncated | counter | `mssql_instance` | -| `windows_mssql_accessmethods_mixed_page_allocations` | Number of pages allocated per second from mixed extents. These could be used for storing the IAM pages and the first eight pages that are allocated to an allocation unit | counter | `mssql_instance` | -| `windows_mssql_accessmethods_page_compression_attempts` | Number of pages evaluated for page-level compression. Includes pages that were not compressed because significant savings could be achieved. Includes all objects in the instance of SQL Server | counter | `mssql_instance` | -| `windows_mssql_accessmethods_page_deallocations` | Number of pages deallocated per second in all databases in this instance of SQL Server. These include pages from mixed extents and uniform extents | counter | `mssql_instance` | -| `windows_mssql_accessmethods_page_allocations` | Number of pages allocated per second in all databases in this instance of SQL Server. These include pages allocations from both mixed extents and uniform extents | counter | `mssql_instance` | -| `windows_mssql_accessmethods_page_compressions` | Number of data pages that are compressed by using PAGE compression. Includes all objects in the instance of SQL Server | counter | `mssql_instance` | -| `windows_mssql_accessmethods_page_splits` | Number of page splits per second that occur as the result of overflowing index pages | counter | `mssql_instance` | -| `windows_mssql_accessmethods_probe_scans` | Number of probe scans per second that are used to find at most one single qualified row in an index or base table directly | counter | `mssql_instance` | -| `windows_mssql_accessmethods_range_scans` | Number of qualified range scans through indices per second | counter | `mssql_instance` | -| `windows_mssql_accessmethods_scan_point_revalidations` | Number of times per second that the scan point had to be revalidated to continue the scan | counter | `mssql_instance` | -| `windows_mssql_accessmethods_ghost_record_skips` | Number of ghosted records per second skipped during scans | counter | `mssql_instance` | -| `windows_mssql_accessmethods_table_lock_escalations` | Number of times locks on a table were escalated to the TABLE or HoBT granularity | counter | `mssql_instance` | -| `windows_mssql_accessmethods_leaf_page_cookie_uses` | Number of times a leaf page cookie is used successfully during an index search since no change happened on the leaf page. The cookie is used to speed up index search | counter | `mssql_instance` | -| `windows_mssql_accessmethods_tree_page_cookie_uses` | Number of times a tree page cookie is used successfully during an index search since no change happened on the parent page of the tree page. The cookie is used to speed up index search | counter | `mssql_instance` | -| `windows_mssql_accessmethods_workfile_creates` | Number of work files created per second. For example, work files could be used to store temporary results for hash joins and hash aggregates | counter | `mssql_instance` | -| `windows_mssql_accessmethods_worktables_creates` | Number of work tables created per second. For example, work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors | counter | `mssql_instance` | -| `windows_mssql_accessmethods_worktables_from_cache_hits` | Number of work tables created where the initial two pages of the work table were not allocated but were immediately available from the work table cache. Numerator of the WorktablesFromCacheRatio counter | counter | `mssql_instance` | -| `windows_mssql_accessmethods_worktables_from_cache_lookups` | Number of work tables created. Denominator (base) of the WorktablesFromCacheRatio counter | counter | `mssql_instance` | -| `windows_mssql_availreplica_received_from_replica_bytes` | Number of bytes received from the availability replica per second. Pings and status updates will generate network traffic even on databases with no user updates | counter | `mssql_instance`, `replica` | -| `windows_mssql_availreplica_sent_to_replica_bytes` | Number of bytes sent to the remote availability replica per second. On the primary replica this is the number of bytes sent to the secondary replica. On the secondary replica this is the number of bytes sent to the primary replica | counter | `mssql_instance`, `replica` | -| `windows_mssql_availreplica_sent_to_transport_bytes` | Actual number of bytes sent per second over the network to the remote availability replica. On the primary replica this is the number of bytes sent to the secondary replica. On the secondary replica this is the number of bytes sent to the primary replica | counter | `mssql_instance`, `replica` | -| `windows_mssql_availreplica_initiated_flow_controls` | Time in milliseconds that log stream messages waited for send flow control, in the last second | counter | `mssql_instance`, `replica` | -| `windows_mssql_availreplica_flow_control_wait_seconds` | Number of times flow-control initiated in the last second. Flow Control Time (ms/sec) divided by Flow Control/sec is the average time per wait | counter | `mssql_instance`, `replica` | -| `windows_mssql_availreplica_receives_from_replica` | Number of Always On messages received from thereplica per second | counter | `mssql_instance`, `replica` | -| `windows_mssql_availreplica_resent_messages` | Number of Always On messages resent in the last second | counter | `mssql_instance`, `replica` | -| `windows_mssql_availreplica_sends_to_replica` | Number of Always On messages sent to this availability replica per second | counter | `mssql_instance`, `replica` | -| `windows_mssql_availreplica_sends_to_transport` | Actual number of Always On messages sent per second over the network to the remote availability replica | counter | `mssql_instance`, `replica` | -| `windows_mssql_bufman_background_writer_pages` | Number of pages flushed to enforce the recovery interval settings | counter | `mssql_instance` | +| `windows_mssql_accessmethods_dropped_rowset_cleanups_total` | The number of rowsets created as a result of aborted online index build operations that were successfully dropped by the background task that cleans up deferred dropped rowsets | counter | `mssql_instance` | +| `windows_mssql_accessmethods_dropped_rowset_skips_total` | The number of rowsets created as a result of aborted online index build operations that were skipped by the background task that cleans up deferred dropped rowsets created | counter | `mssql_instance` | +| `windows_mssql_accessmethods_extent_deallocations_total` | Number of extents deallocated in all databases in this instance of SQL Server | counter | `mssql_instance` | +| `windows_mssql_accessmethods_extent_allocations_total` | Number of extents allocated in all databases in this instance of SQL Server | counter | `mssql_instance` | +| `windows_mssql_accessmethods_au_batch_cleanup_failures_total` | The number of batches that failed and required retry, by the background task that cleans up deferred dropped allocation units. Failure could be due to lack of memory or disk space, hardware failure and other reasons | counter | `mssql_instance` | +| `windows_mssql_accessmethods_leaf_page_cookie_failures_total` | The number of times that a leaf page cookie could not be used during an index search since changes happened on the leaf page. The cookie is used to speed up index search | counter | `mssql_instance` | +| `windows_mssql_accessmethods_tree_page_cookie_failures_total` | The number of times that a tree page cookie could not be used during an index search since changes happened on the parent pages of those tree pages. The cookie is used to speed up index search | counter | `mssql_instance` | +| `windows_mssql_accessmethods_forwarded_records_total` | Number of records fetched through forwarded record pointers | counter | `mssql_instance` | +| `windows_mssql_accessmethods_free_space_page_fetches_total` | Number of pages fetched by free space scans. These scans search for free space within pages already allocated to an allocation unit, to satisfy requests to insert or modify record fragments | counter | `mssql_instance` | +| `windows_mssql_accessmethods_free_space_scans_total` | Number of scans that were initiated to search for free space within pages already allocated to an allocation unit to insert or modify record fragment. Each scan may find multiple pages | counter | `mssql_instance` | +| `windows_mssql_accessmethods_full_scans_total` | Number of unrestricted full scans. These can be either base-table or full-index scans | counter | `mssql_instance` | +| `windows_mssql_accessmethods_index_searches_total` | Number of index searches. These are used to start a range scan, reposition a range scan, revalidate a scan point, fetch a single index record, and search down the index to locate where to insert a new row | counter | `mssql_instance` | +| `windows_mssql_accessmethods_insysxact_waits_total` | Number of times a reader needs to wait for a page because the InSysXact bit is set | counter | `mssql_instance` | +| `windows_mssql_accessmethods_lob_handle_creates_total` | Count of temporary lobs created | counter | `mssql_instance` | +| `windows_mssql_accessmethods_lob_handle_destroys_total` | Count of temporary lobs destroyed | counter | `mssql_instance` | +| `windows_mssql_accessmethods_lob_ss_provider_creates_total` | Count of LOB Storage Service Providers (LobSSP) created. One worktable created per LobSSP | counter | `mssql_instance` | +| `windows_mssql_accessmethods_lob_ss_provider_destroys_total` | Count of LobSSP destroyed | counter | `mssql_instance` | +| `windows_mssql_accessmethods_lob_ss_provider_truncations_total` | Count of LobSSP truncated | counter | `mssql_instance` | +| `windows_mssql_accessmethods_mixed_page_allocations_total` | Number of pages allocated from mixed extents. These could be used for storing the IAM pages and the first eight pages that are allocated to an allocation unit | counter | `mssql_instance` | +| `windows_mssql_accessmethods_page_compression_attempts_total` | Number of pages evaluated for page-level compression. Includes pages that were not compressed because significant savings could be achieved. Includes all objects in the instance of SQL Server | counter | `mssql_instance` | +| `windows_mssql_accessmethods_page_deallocations_total` | Number of pages deallocated in all databases in this instance of SQL Server. These include pages from mixed extents and uniform extents | counter | `mssql_instance` | +| `windows_mssql_accessmethods_page_allocations_total` | Number of pages allocated in all databases in this instance of SQL Server. These include pages allocations from both mixed extents and uniform extents | counter | `mssql_instance` | +| `windows_mssql_accessmethods_page_compressions_total` | Number of data pages that are compressed by using PAGE compression. Includes all objects in the instance of SQL Server | counter | `mssql_instance` | +| `windows_mssql_accessmethods_page_splits_total` | Number of page splits that occur as the result of overflowing index pages | counter | `mssql_instance` | +| `windows_mssql_accessmethods_probe_scans_total` | Number of probe scans that are used to find at most one single qualified row in an index or base table directly | counter | `mssql_instance` | +| `windows_mssql_accessmethods_range_scans_total` | Number of qualified range scans through indices | counter | `mssql_instance` | +| `windows_mssql_accessmethods_scan_point_revalidations_total` | Number of times that the scan point had to be revalidated to continue the scan | counter | `mssql_instance` | +| `windows_mssql_accessmethods_ghost_record_skips_total` | Number of ghosted records skipped during scans | counter | `mssql_instance` | +| `windows_mssql_accessmethods_table_lock_escalations_total` | Number of times locks on a table were escalated to the TABLE or HoBT granularity | counter | `mssql_instance` | +| `windows_mssql_accessmethods_leaf_page_cookie_uses_total` | Number of times a leaf page cookie is used successfully during an index search since no change happened on the leaf page. The cookie is used to speed up index search | counter | `mssql_instance` | +| `windows_mssql_accessmethods_tree_page_cookie_uses_total` | Number of times a tree page cookie is used successfully during an index search since no change happened on the parent page of the tree page. The cookie is used to speed up index search | counter | `mssql_instance` | +| `windows_mssql_accessmethods_workfile_creates_total` | Number of work files created. For example, work files could be used to store temporary results for hash joins and hash aggregates | counter | `mssql_instance` | +| `windows_mssql_accessmethods_worktables_creates_total` | Number of work tables created. For example, work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors | counter | `mssql_instance` | +| `windows_mssql_accessmethods_worktables_from_cache_hits_total` | Number of work tables created where the initial two pages of the work table were not allocated but were immediately available from the work table cache. Numerator of the WorktablesFromCacheRatio counter | counter | `mssql_instance` | +| `windows_mssql_accessmethods_worktables_from_cache_lookups_total` | Number of work tables created. Denominator (base) of the WorktablesFromCacheRatio counter | counter | `mssql_instance` | +| `windows_mssql_availreplica_received_from_replica_bytes_total` | Number of bytes received from the availability replica. Pings and status updates will generate network traffic even on databases with no user updates | counter | `mssql_instance`, `replica` | +| `windows_mssql_availreplica_sent_to_replica_bytes_total` | Number of bytes sent to the remote availability replica. On the primary replica this is the number of bytes sent to the secondary replica. On the secondary replica this is the number of bytes sent to the primary replica | counter | `mssql_instance`, `replica` | +| `windows_mssql_availreplica_sent_to_transport_bytes_total` | Actual number of bytes sent over the network to the remote availability replica. On the primary replica this is the number of bytes sent to the secondary replica. On the secondary replica this is the number of bytes sent to the primary replica | counter | `mssql_instance`, `replica` | +| `windows_mssql_availreplica_initiated_flow_controls_total` | Number of times flow control was initiated. Flow control wait time divided by this count is the average time per wait | counter | `mssql_instance`, `replica` | +| `windows_mssql_availreplica_flow_control_wait_seconds_total` | Time in seconds that log stream messages waited for send flow control | counter | `mssql_instance`, `replica` | +| `windows_mssql_availreplica_receives_from_replica_total` | Number of Always On messages received from the replica | counter | `mssql_instance`, `replica` | +| `windows_mssql_availreplica_resent_messages_total` | Number of Always On messages resent | counter | `mssql_instance`, `replica` | +| `windows_mssql_availreplica_sends_to_replica_total` | Number of Always On messages sent to this availability replica | counter | `mssql_instance`, `replica` | +| `windows_mssql_availreplica_sends_to_transport_total` | Actual number of Always On messages sent over the network to the remote availability replica | counter | `mssql_instance`, `replica` | +| `windows_mssql_bufman_background_writer_pages_total` | Number of pages flushed to enforce the recovery interval settings | counter | `mssql_instance` | | `windows_mssql_bufman_buffer_cache_hits` | Number of pages found in the buffer cache without a disk read, in the most recent sampling interval of SQL Server (a few seconds). Numerator of the Buffer cache hit ratio counter | gauge | `mssql_instance` | | `windows_mssql_bufman_buffer_cache_lookups` | Number of buffer cache lookups in the most recent sampling interval of SQL Server (a few seconds). Base of the Buffer cache hit ratio counter | gauge | `mssql_instance` | -| `windows_mssql_bufman_checkpoint_pages` | Indicates the number of pages flushed to disk per second by a checkpoint or other operation that require all dirty pages to be flushed | counter | `mssql_instance` | +| `windows_mssql_bufman_checkpoint_pages_total` | Indicates the number of pages flushed to disk by a checkpoint or other operation that require all dirty pages to be flushed | counter | `mssql_instance` | | `windows_mssql_bufman_database_pages` | Indicates the number of pages in the buffer pool with database content | gauge | `mssql_instance` | | `windows_mssql_bufman_extension_allocated_pages` | Total number of non-free cache pages in the buffer pool extension file | gauge | `mssql_instance` | | `windows_mssql_bufman_extension_free_pages` | Total number of free cache pages in the buffer pool extension file | gauge | `mssql_instance` | -| `windows_mssql_bufman_extension_in_use_as_percentage` | _Not yet documented_ | gauge | `mssql_instance` | +| `windows_mssql_bufman_extension_in_use_ratio` | Ratio (0-1) of the buffer pool extension file in use | gauge | `mssql_instance` | | `windows_mssql_bufman_extension_outstanding_io` | Percentage of the buffer pool extension paging file occupied by buffer manager pages | gauge | `mssql_instance` | -| `windows_mssql_bufman_extension_page_evictions` | Number of pages evicted from the buffer pool extension file per second | counter | `mssql_instance` | -| `windows_mssql_bufman_extension_page_reads` | Number of pages read from the buffer pool extension file per second | counter | `mssql_instance` | +| `windows_mssql_bufman_extension_page_evictions_total` | Number of pages evicted from the buffer pool extension file | counter | `mssql_instance` | +| `windows_mssql_bufman_extension_page_reads_total` | Number of pages read from the buffer pool extension file | counter | `mssql_instance` | | `windows_mssql_bufman_extension_page_unreferenced_seconds` | Average seconds a page will stay in the buffer pool extension without references to it | gauge | `mssql_instance` | -| `windows_mssql_bufman_extension_page_writes` | Number of pages written to the buffer pool extension file per second | counter | `mssql_instance` | -| `windows_mssql_bufman_free_list_stalls` | Indicates the number of requests per second that had to wait for a free page | counter | `mssql_instance` | +| `windows_mssql_bufman_extension_page_writes_total` | Number of pages written to the buffer pool extension file | counter | `mssql_instance` | +| `windows_mssql_bufman_free_list_stalls_total` | Indicates the number of requests that had to wait for a free page | counter | `mssql_instance` | | `windows_mssql_bufman_integral_controller_slope` | The slope that integral controller for the buffer pool last used, times -10 billion | gauge | `mssql_instance` | -| `windows_mssql_bufman_lazywrites` | Indicates the number of buffers written per second by the buffer manager's lazy writer | counter | `mssql_instance` | +| `windows_mssql_bufman_lazywrites_total` | Indicates the number of buffers written by the buffer manager's lazy writer | counter | `mssql_instance` | | `windows_mssql_bufman_page_life_expectancy_seconds` | Indicates the number of seconds a page will stay in the buffer pool without references | gauge | `mssql_instance` | -| `windows_mssql_bufman_page_lookups` | Indicates the number of requests per second to find a page in the buffer pool | counter | `mssql_instance` | -| `windows_mssql_bufman_page_reads` | Indicates the number of physical database page reads that are issued per second | counter | `mssql_instance` | -| `windows_mssql_bufman_page_writes` | Indicates the number of physical database page writes that are issued per second | counter | `mssql_instance` | -| `windows_mssql_bufman_read_ahead_pages` | Indicates the number of pages read per second in anticipation of use | counter | `mssql_instance` | -| `windows_mssql_bufman_read_ahead_issuing_seconds` | Total time spent issuing read-ahead, in seconds | counter | `mssql_instance` | +| `windows_mssql_bufman_page_lookups_total` | Indicates the number of requests to find a page in the buffer pool | counter | `mssql_instance` | +| `windows_mssql_bufman_page_reads_total` | Indicates the number of physical database page reads that are issued | counter | `mssql_instance` | +| `windows_mssql_bufman_page_writes_total` | Indicates the number of physical database page writes that are issued | counter | `mssql_instance` | +| `windows_mssql_bufman_read_ahead_pages_total` | Indicates the number of pages read in anticipation of use | counter | `mssql_instance` | +| `windows_mssql_bufman_read_ahead_issuing_seconds_total` | Total time spent issuing read-ahead, in seconds | counter | `mssql_instance` | | `windows_mssql_bufman_target_pages` | Ideal number of pages in the buffer pool | gauge | `mssql_instance` | | `windows_mssql_dbreplica_database_flow_control_wait_seconds_total` | Total time spent in database flow control wait, in seconds | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_database_initiated_flow_controls` | _Not yet documented_ | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_received_file_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_group_commits` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_database_initiated_flow_controls_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_received_file_bytes_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_group_commits_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_group_commit_stall_seconds_total` | Total time transactions waited for group commit, in seconds | counter | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_log_apply_pending_queue` | _Not yet documented_ | gauge | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_log_apply_ready_queue` | _Not yet documented_ | gauge | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_log_compressed_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_log_decompressed_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_log_received_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_log_compression_cachehits` | _Not yet documented_ | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_log_compression_cachemisses` | _Not yet documented_ | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_log_compressions` | _Not yet documented_ | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_log_decompressions` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_log_compressed_bytes_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_log_decompressed_bytes_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_log_received_bytes_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_log_compression_cachehits_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_log_compression_cachemisses_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_log_compressions_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_log_decompressions_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_log_remaining_for_undo_bytes` | The amount of log, in bytes, remaining to complete the undo phase | gauge | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_log_send_queue_bytes` | Amount of log, in bytes, in the log files of the primary database that has not been sent to the secondary replica | gauge | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_mirrored_write_transactions` | Number of transactions that were written to the primary database and then waited to commit until the log was sent to the secondary database, in the last second | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_mirrored_write_transactions_total` | Number of transactions that were written to the primary database and then waited to commit until the log was sent to the secondary database | counter | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_recovery_queue_bytes` | Amount of hardened log, in bytes, in the log files of the secondary replica that has not been redone | gauge | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_redo_blocks` | Number of times the redo thread was blocked on locks held by readers of the database | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_redo_blocks_total` | Number of times the redo thread was blocked on locks held by readers of the database | counter | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_redo_remaining_bytes` | The amount of log, in bytes, remaining to be redone to finish the reverting phase | gauge | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_redone_bytes` | Amount of log records redone on the secondary database in the last second | counter | `mssql_instance`, `replica` | -| `windows_mssql_dbreplica_redones` | _Not yet documented_ | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_redone_bytes_total` | Amount of log records redone on the secondary database | counter | `mssql_instance`, `replica` | +| `windows_mssql_dbreplica_redones_total` | _Not yet documented_ | counter | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_total_log_requiring_undo_bytes` | Total amount of log, in bytes, that must be undone | gauge | `mssql_instance`, `replica` | | `windows_mssql_dbreplica_transaction_delay_seconds_total` | Total time transaction termination waited for commit acknowledgement, in seconds | counter | `mssql_instance`, `replica` | | `windows_mssql_databases_active_transactions` | Number of active transactions for the database | gauge | `mssql_instance`, `database` | | `windows_mssql_databases_active_parallel_redo_threads` | Number of active parallel redo threads | gauge | `mssql_instance`, `database` | -| `windows_mssql_databases_backup_restore_operations` | Read/write throughput for backup and restore operations of a database per second | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_bulk_copy_rows` | Number of rows bulk copied per second | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_bulk_copy_bytes` | Amount of data bulk copied (in kilobytes) per second | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_backup_restore_operations_total` | Read/write throughput for backup and restore operations of a database | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_bulk_copy_rows_total` | Number of rows bulk copied | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_bulk_copy_bytes_total` | Amount of data bulk copied, in bytes | counter | `mssql_instance`, `database` | | `windows_mssql_databases_commit_table_entries` | he size (row count) of the in-memory portion of the commit table for the database | gauge | `mssql_instance`, `database` | | `windows_mssql_databases_data_files_size_bytes` | Cumulative size (in kilobytes) of all the data files in the database including any automatic growth. Monitoring this counter is useful, for example, for determining the correct size of tempdb | gauge | `mssql_instance`, `database` | -| `windows_mssql_databases_dbcc_logical_scan_bytes` | Number of logical read scan bytes per second for database console commands (DBCC) | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_group_commit_stall_seconds` | Total group commit stall time, in seconds | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_flushed_bytes` | Total number of log bytes flushed | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_dbcc_logical_scan_bytes_total` | Number of logical read scan bytes for database console commands (DBCC) | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_group_commit_stall_seconds_total` | Total group commit stall time, in seconds | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_flushed_bytes_total` | Total number of log bytes flushed | counter | `mssql_instance`, `database` | | `windows_mssql_databases_log_cache_hits` | Number of log cache reads satisfied from the log cache. Numerator of the Log Cache Hit Ratio counter | gauge | `mssql_instance`, `database` | | `windows_mssql_databases_log_cache_lookups` | Number of log cache lookups. Base of the Log Cache Hit Ratio counter | gauge | `mssql_instance`, `database` | -| `windows_mssql_databases_log_cache_reads` | Reads performed per second through the log manager cache | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_cache_reads_total` | Reads performed through the log manager cache | counter | `mssql_instance`, `database` | | `windows_mssql_databases_log_files_size_bytes` | Cumulative size (in kilobytes) of all the transaction log files in the database | gauge | `mssql_instance`, `database` | | `windows_mssql_databases_log_files_used_size_bytes` | The cumulative used size of all the log files in the database | gauge | `mssql_instance`, `database` | -| `windows_mssql_databases_log_flushes` | Number of log flushes | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_flush_waits` | Number of commits per second waiting for the log flush | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_flushes_total` | Number of log flushes | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_flush_waits_total` | Number of commits waiting for the log flush | counter | `mssql_instance`, `database` | | `windows_mssql_databases_log_flush_wait_seconds_total` | Total time commits waited for log flushes, in seconds | counter | `mssql_instance`, `database` | | `windows_mssql_databases_log_flush_write_seconds_total` | Total time spent writing log flushes, in seconds | counter | `mssql_instance`, `database` | | `windows_mssql_databases_log_growths_total` | Total number of times the transaction log for the database has been expanded | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_cache_misses` | Number of requests for which the log block was not available in the log pool | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_disk_reads` | Number of disk reads that the log pool issued to fetch log blocks | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_hash_deletes` | Rate of raw hash entry deletes from the Log Pool | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_hash_inserts` | Rate of raw hash entry inserts into the Log Pool | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_invalid_hash_entries` | Rate of hash lookups failing due to being invalid | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_log_scan_pushes` | Rate of Log block pushes by log scans, which may come from disk or memory | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_log_writer_pushes` | Rate of Log block pushes by log writer thread | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_empty_free_pool_pushes` | Rate of Log block push fails due to empty free pool | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_low_memory_pushes` | Rate of Log block push fails due to being low on memory | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_no_free_buffer_pushes` | Rate of Log block push fails due to free buffer unavailable | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_req_behind_trunc` | Log pool cache misses due to block requested being behind truncation LSN | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_requests_old_vlf` | Log Pool requests that were not in the last VLF of the log | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_pool_requests` | The number of log-block requests processed by the log pool | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_cache_misses_total` | Number of requests for which the log block was not available in the log pool | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_disk_reads_total` | Number of disk reads that the log pool issued to fetch log blocks | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_hash_deletes_total` | Rate of raw hash entry deletes from the Log Pool | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_hash_inserts_total` | Rate of raw hash entry inserts into the Log Pool | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_invalid_hash_entries_total` | Rate of hash lookups failing due to being invalid | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_log_scan_pushes_total` | Rate of Log block pushes by log scans, which may come from disk or memory | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_log_writer_pushes_total` | Rate of Log block pushes by log writer thread | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_empty_free_pool_pushes_total` | Rate of Log block push fails due to empty free pool | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_low_memory_pushes_total` | Rate of Log block push fails due to being low on memory | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_no_free_buffer_pushes_total` | Rate of Log block push fails due to free buffer unavailable | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_req_behind_trunc_total` | Log pool cache misses due to block requested being behind truncation LSN | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_requests_old_vlf_total` | Log Pool requests that were not in the last VLF of the log | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_log_pool_requests_total` | The number of log-block requests processed by the log pool | counter | `mssql_instance`, `database` | | `windows_mssql_databases_log_pool_total_active_log_bytes` | Current total active log stored in the shared cache buffer manager in bytes | gauge | `mssql_instance`, `database` | | `windows_mssql_databases_log_pool_total_shared_pool_bytes` | Current total memory usage of the shared cache buffer manager in bytes | gauge | `mssql_instance`, `database` | | `windows_mssql_databases_log_shrinks_total` | Total number of log shrinks for this database | counter | `mssql_instance`, `database` | | `windows_mssql_databases_log_truncations_total` | The number of times the transaction log has been truncated (in Simple Recovery Model) | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_log_used_percent` | Percentage of space in the log that is in use | gauge | `mssql_instance`, `database` | +| `windows_mssql_databases_log_used_ratio` | Ratio (0-1) of space in the log that is in use | gauge | `mssql_instance`, `database` | | `windows_mssql_databases_pending_repl_transactions` | Number of transactions in the transaction log of the publication database marked for replication, but not yet delivered to the distribution database | gauge | `mssql_instance`, `database` | -| `windows_mssql_databases_repl_transactions` | Number of transactions per second read out of the transaction log of the publication database and delivered to the distribution database | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_shrink_data_movement_bytes` | Amount of data being moved per second by autoshrink operations, or DBCC SHRINKDATABASE or DBCC SHRINKFILE statements | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_tracked_transactions` | Number of committed transactions recorded in the commit table for the database | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_transactions` | Number of transactions started for the database per second | counter | `mssql_instance`, `database` | -| `windows_mssql_databases_write_transactions` | Number of transactions that wrote to the database and committed, in the last second | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_repl_transactions_total` | Number of transactions read out of the transaction log of the publication database and delivered to the distribution database | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_shrink_data_movement_bytes_total` | Amount of data being moved by autoshrink operations, or DBCC SHRINKDATABASE or DBCC SHRINKFILE statements | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_tracked_transactions_total` | Number of committed transactions recorded in the commit table for the database | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_transactions_total` | Number of transactions started for the database | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_write_transactions_total` | Number of transactions that wrote to the database and committed | counter | `mssql_instance`, `database` | | `windows_mssql_databases_xtp_controller_dlc_fetch_latency_seconds_total` | Total latency between log blocks entering the Direct Log Consumer and being retrieved by the XTP controller, in seconds. Numerator of the XTP Controller DLC Latency/Fetch counter | counter | `mssql_instance`, `database` | | `windows_mssql_databases_xtp_controller_dlc_fetches_total` | Total number of fetches from the Direct Log Consumer by the XTP controller. Base of the XTP Controller DLC Latency/Fetch counter | counter | `mssql_instance`, `database` | | `windows_mssql_databases_xtp_controller_dlc_peak_latency_seconds` | The largest recorded latency, in seconds, of a fetch from the Direct Log Consumer by the XTP controller | gauge | `mssql_instance`, `database` | -| `windows_mssql_databases_xtp_controller_log_processed_bytes` | The amount of log bytes processed by the XTP controller thread, per second | counter | `mssql_instance`, `database` | +| `windows_mssql_databases_xtp_controller_log_processed_bytes_total` | The amount of log bytes processed by the XTP controller thread | counter | `mssql_instance`, `database` | | `windows_mssql_databases_xtp_memory_used_bytes` | The amount of memory used by XTP in the database | gauge | `mssql_instance`, `database` | | `windows_mssql_genstats_active_temp_tables` | Number of temporary tables/table variables in use | gauge | `mssql_instance` | -| `windows_mssql_genstats_connection_resets` | Total number of logins started from the connection pool | counter | `mssql_instance` | +| `windows_mssql_genstats_connection_resets_total` | Total number of logins started from the connection pool | counter | `mssql_instance` | | `windows_mssql_genstats_event_notifications_delayed_drop` | Number of event notifications waiting to be dropped by a system thread | gauge | `mssql_instance` | | `windows_mssql_genstats_http_authenticated_requests_total` | Total number of authenticated HTTP requests started | counter | `mssql_instance` | | `windows_mssql_genstats_logical_connections` | Number of logical connections to the system | gauge | `mssql_instance` | -| `windows_mssql_genstats_logins` | Total number of logins started per second. This does not include pooled connections | counter | `mssql_instance` | -| `windows_mssql_genstats_logouts` | Total number of logout operations started per second | counter | `mssql_instance` | +| `windows_mssql_genstats_logins_total` | Total number of logins started. This does not include pooled connections | counter | `mssql_instance` | +| `windows_mssql_genstats_logouts_total` | Total number of logout operations started | counter | `mssql_instance` | | `windows_mssql_genstats_mars_deadlocks_total` | Total number of MARS deadlocks detected | counter | `mssql_instance` | -| `windows_mssql_genstats_non_atomic_yields` | Number of non-atomic yields per second | counter | `mssql_instance` | +| `windows_mssql_genstats_non_atomic_yields_total` | Number of non-atomic yields | counter | `mssql_instance` | | `windows_mssql_genstats_blocked_processes` | Number of currently blocked processes | gauge | `mssql_instance` | | `windows_mssql_genstats_soap_empty_requests_total` | Total number of empty SOAP requests started | counter | `mssql_instance` | | `windows_mssql_genstats_soap_method_invocations_total` | Total number of SOAP method invocations started | counter | `mssql_instance` | @@ -189,20 +189,19 @@ Comma-separated list of MSSQL WMI classes to use. Supported values are `accessme | `windows_mssql_genstats_sql_trace_io_provider_lock_waits_total` | Total number of waits for the File IO Provider lock | counter | `mssql_instance` | | `windows_mssql_genstats_tempdb_recovery_unit_ids_generated_total` | Total number of duplicate tempdb recovery unit IDs generated | counter | `mssql_instance` | | `windows_mssql_genstats_tempdb_rowset_ids_generated_total` | Total number of duplicate tempdb rowset IDs generated | counter | `mssql_instance` | -| `windows_mssql_genstats_temp_tables_creations` | Number of temporary tables/table variables created per second | counter | `mssql_instance` | +| `windows_mssql_genstats_temp_tables_creations_total` | Number of temporary tables/table variables created | counter | `mssql_instance` | | `windows_mssql_genstats_temp_tables_awaiting_destruction` | Number of temporary tables/table variables waiting to be destroyed by the cleanup system thread | gauge | `mssql_instance` | | `windows_mssql_genstats_trace_event_notification_queue_size` | Number of trace event notification instances waiting in the internal queue to be sent through Service Broker | gauge | `mssql_instance` | | `windows_mssql_genstats_transactions` | Number of transaction enlistments (local, DTC, bound all combined) | gauge | `mssql_instance` | | `windows_mssql_genstats_user_connections` | Counts the number of users currently connected to SQL Server | gauge | `mssql_instance` | | `windows_mssql_instance_info` | A metric with a constant '1' value labeled with mssql instance information | gauge | `edition`, `mssql_instance`, `patch`, `version` | | `windows_mssql_locks_wait_time_seconds_total` | Total time lock requests waited, in seconds. Numerator of the Average Wait Time (ms) counter | counter | `mssql_instance`, `resource` | -| `windows_mssql_locks_count_total` | Total number of lock requests that waited. Base of the Average Wait Time (ms) counter | counter | `mssql_instance`, `resource` | -| `windows_mssql_locks_lock_requests` | Number of new locks and lock conversions per second requested from the lock manager | counter | `mssql_instance`, `resource` | -| `windows_mssql_locks_lock_timeouts` | Number of lock requests per second that timed out, including requests for NOWAIT locks | counter | `mssql_instance`, `resource` | -| `windows_mssql_locks_lock_timeouts_excluding_NOWAIT` | Number of lock requests per second that timed out, but excluding requests for NOWAIT locks | counter | `mssql_instance`, `resource` | -| `windows_mssql_locks_lock_waits` | Number of lock requests that required the caller to wait | counter | `mssql_instance`, `resource` | +| `windows_mssql_locks_lock_requests_total` | Number of new locks and lock conversions requested from the lock manager | counter | `mssql_instance`, `resource` | +| `windows_mssql_locks_lock_timeouts_total` | Number of lock requests that timed out, including requests for NOWAIT locks | counter | `mssql_instance`, `resource` | +| `windows_mssql_locks_lock_timeouts_excluding_nowait_total` | Number of lock requests that timed out, but excluding requests for NOWAIT locks | counter | `mssql_instance`, `resource` | +| `windows_mssql_locks_lock_waits_total` | Number of lock requests that required the caller to wait | counter | `mssql_instance`, `resource` | | `windows_mssql_locks_lock_wait_seconds_total` | Total time lock requests waited, in seconds | counter | `mssql_instance`, `resource` | -| `windows_mssql_locks_deadlocks` | Number of lock requests per second that resulted in a deadlock | counter | `mssql_instance`, `resource` | +| `windows_mssql_locks_deadlocks_total` | Number of lock requests that resulted in a deadlock | counter | `mssql_instance`, `resource` | | `windows_mssql_memmgr_connection_memory_bytes` | Specifies the total amount of dynamic memory the server is using for maintaining connections | gauge | `mssql_instance` | | `windows_mssql_memmgr_database_cache_memory_bytes` | Specifies the amount of memory the server is currently using for the database pages cache | gauge | `mssql_instance` | | `windows_mssql_memmgr_external_benefit_of_memory` | An internal estimation of the performance benefit from adding memory to a specific cache | gauge | `mssql_instance` | @@ -223,17 +222,17 @@ Comma-separated list of MSSQL WMI classes to use. Supported values are `accessme | `windows_mssql_memmgr_stolen_server_memory_bytes` | Specifies the amount of memory the server is using for purposes other than database pages | gauge | `mssql_instance` | | `windows_mssql_memmgr_target_server_memory_bytes` | Indicates the ideal amount of memory the server can consume | gauge | `mssql_instance` | | `windows_mssql_memmgr_total_server_memory_bytes` | Specifies the amount of memory the server has committed using the memory manager | gauge | `mssql_instance` | -| `windows_mssql_sqlstats_auto_parameterization_attempts` | Number of failed auto-parameterization attempts per second. This should be small. Note that auto-parameterizations are also known as simple parameterizations in later versions of SQL Server | counter | `mssql_instance` | -| `windows_mssql_sqlstats_batch_requests` | _Not yet documented_ | counter | `mssql_instance` | -| `windows_mssql_sqlstats_failed_auto_parameterization_attempts` | _Not yet documented_ | counter | `mssql_instance` | -| `windows_mssql_sqlstats_forced_parameterizations` | Number of successful forced parameterizations per second | counter | `mssql_instance` | -| `windows_mssql_sqlstats_guided_plan_executions` | Number of plan executions per second in which the query plan has been generated by using a plan guide | counter | `mssql_instance` | -| `windows_mssql_sqlstats_misguided_plan_executions` | Number of plan executions per second in which a plan guide could not be honored during plan generation | counter | `mssql_instance` | -| `windows_mssql_sqlstats_safe_auto_parameterization_attempts` | Number of safe auto-parameterization attempts per second | counter | `mssql_instance` | -| `windows_mssql_sqlstats_sql_attentions` | Number of attentions per second | counter | `mssql_instance` | -| `windows_mssql_sqlstats_sql_compilations` | Number of SQL compilations per second | counter | `mssql_instance` | -| `windows_mssql_sqlstats_sql_recompilations` | Number of statement recompiles per second | counter | `mssql_instance` | -| `windows_mssql_sqlstats_unsafe_auto_parameterization_attempts` | Number of unsafe auto-parameterization attempts per second. | counter | `mssql_instance` | +| `windows_mssql_sqlstats_auto_parameterization_attempts_total` | Number of failed auto-parameterization attempts. This should be small. Note that auto-parameterizations are also known as simple parameterizations in later versions of SQL Server | counter | `mssql_instance` | +| `windows_mssql_sqlstats_batch_requests_total` | _Not yet documented_ | counter | `mssql_instance` | +| `windows_mssql_sqlstats_failed_auto_parameterization_attempts_total` | _Not yet documented_ | counter | `mssql_instance` | +| `windows_mssql_sqlstats_forced_parameterizations_total` | Number of successful forced parameterizations | counter | `mssql_instance` | +| `windows_mssql_sqlstats_guided_plan_executions_total` | Number of plan executions in which the query plan has been generated by using a plan guide | counter | `mssql_instance` | +| `windows_mssql_sqlstats_misguided_plan_executions_total` | Number of plan executions in which a plan guide could not be honored during plan generation | counter | `mssql_instance` | +| `windows_mssql_sqlstats_safe_auto_parameterization_attempts_total` | Number of safe auto-parameterization attempts | counter | `mssql_instance` | +| `windows_mssql_sqlstats_sql_attentions_total` | Number of attentions | counter | `mssql_instance` | +| `windows_mssql_sqlstats_sql_compilations_total` | Number of SQL compilations | counter | `mssql_instance` | +| `windows_mssql_sqlstats_sql_recompilations_total` | Number of statement recompiles | counter | `mssql_instance` | +| `windows_mssql_sqlstats_unsafe_auto_parameterization_attempts_total` | Number of unsafe auto-parameterization attempts. | counter | `mssql_instance` | | `windows_mssql_sql_errors_total` | Information for all errors | counter | `mssql_instance`, `resource` | | `windows_mssql_transactions_tempdb_free_space_bytes` | The amount of space, in bytes, available in tempdb | gauge | `mssql_instance` | | `windows_mssql_transactions_longest_transaction_running_seconds` | The length of time (in seconds) since the start of the transaction that has been active longer than any other current transaction | gauge | `mssql_instance` | @@ -247,8 +246,8 @@ Comma-separated list of MSSQL WMI classes to use. Supported values are `accessme | `windows_mssql_transactions_version_generation_bytes_total` | Total size of row versions added to the version store in tempdb, in bytes | counter | `mssql_instance` | | `windows_mssql_transactions_version_store_size_bytes` | The amount of space, in bytes, in tempdb used to store snapshot isolation level row versions | gauge | `mssql_instance` | | `windows_mssql_transactions_version_store_units` | The number of active allocation units in the snapshot isolation version store in tempdb | gauge | `mssql_instance` | -| `windows_mssql_transactions_version_store_creation_units` | The number of allocation units that have been created in the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance` | -| `windows_mssql_transactions_version_store_truncation_units` | The number of allocation units that have been removed from the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance` | +| `windows_mssql_transactions_version_store_creation_units_total` | The number of allocation units that have been created in the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance` | +| `windows_mssql_transactions_version_store_truncation_units_total` | The number of allocation units that have been removed from the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance` | | `windows_mssql_waitstats_lock_waits` | Statistics for processes waiting on a lock | gauge | `mssql_instance`, `item` | | `windows_mssql_waitstats_memory_grant_queue_waits` | Statistics for processes waiting for memory grant to become available | gauge | `mssql_instance`, `item` | | `windows_mssql_waitstats_thread_safe_memory_objects_waits` | Statistics for processes waiting on thread-safe memory allocators | gauge | `mssql_instance`, `item` | @@ -267,7 +266,7 @@ Comma-separated list of MSSQL WMI classes to use. Supported values are `accessme Query Full table scans ``` -rate(windows_mssql_accessmethods_full_scans{instance='host:9182'}[$__rate_interval]) +rate(windows_mssql_accessmethods_full_scans_total{instance='host:9182'}[$__rate_interval]) ``` ## Useful queries @@ -300,10 +299,10 @@ Divide the rates of numerator and base: ``` # Worktables From Cache Ratio -rate(windows_mssql_accessmethods_worktables_from_cache_hits[5m]) / rate(windows_mssql_accessmethods_worktables_from_cache_lookups[5m]) +rate(windows_mssql_accessmethods_worktables_from_cache_hits_total[5m]) / rate(windows_mssql_accessmethods_worktables_from_cache_lookups_total[5m]) # Average lock wait time in seconds -rate(windows_mssql_locks_wait_time_seconds_total[5m]) / rate(windows_mssql_locks_count_total[5m]) +rate(windows_mssql_locks_wait_time_seconds_total[5m]) / rate(windows_mssql_locks_lock_waits_total[5m]) # Average XTP controller DLC latency per fetch in seconds rate(windows_mssql_databases_xtp_controller_dlc_fetch_latency_seconds_total[5m]) / rate(windows_mssql_databases_xtp_controller_dlc_fetches_total[5m]) diff --git a/docs/collector.netframework.md b/docs/collector.netframework.md index e7e0d6c4..2339f1f1 100644 --- a/docs/collector.netframework.md +++ b/docs/collector.netframework.md @@ -40,8 +40,8 @@ Comma-separated list of collectors to use. Defaults to all, if not specified. Su | Name | Description | Type | Labels | |-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------| | `windows_netframework_clrjit_jit_methods_total` | Displays the total number of methods JIT-compiled since the application started. This counter does not include pre-JIT-compiled methods. | counter | `process` | -| `windows_netframework_clrjit_jit_time_percent` | Displays the percentage of time spent in JIT compilation. This counter is updated at the end of every JIT compilation phase. A JIT compilation phase occurs when a method and its dependencies are compiled. | gauge | `process` | -| `windows_netframework_clrjit_jit_standard_failures_total` | Displays the peak number of methods the JIT compiler has failed to compile since the application started. This failure can occur if the MSIL cannot be verified or if there is an internal error in the JIT compiler. | gauge | `process` | +| `windows_netframework_clrjit_jit_time_ratio` | Displays the ratio (0-1) of elapsed time spent in JIT compilation since the last JIT compilation phase. This counter is updated at the end of every JIT compilation phase. A JIT compilation phase occurs when a method and its dependencies are compiled. | gauge | `process` | +| `windows_netframework_clrjit_jit_standard_failures_total` | Displays the peak number of methods the JIT compiler has failed to compile since the application started. This failure can occur if the MSIL cannot be verified or if there is an internal error in the JIT compiler. | counter | `process` | | `windows_netframework_clrjit_jit_il_bytes_total` | Displays the total number of Microsoft intermediate language (MSIL) bytes compiled by the just-in-time (JIT) compiler since the application started | counter | `process` | ### CLR Loading @@ -85,7 +85,7 @@ Comma-separated list of collectors to use. Defaults to all, if not specified. Su | `windows_netframework_clrmemory_number_sink_blocksinuse` | Displays the current number of synchronization blocks in use. Synchronization blocks are per-object data structures allocated for storing synchronization information. They hold weak references to managed objects and must be scanned by the garbage collector. | gauge | `process`, `process_id` | | `windows_netframework_clrmemory_committed_bytes` | Displays the amount of virtual memory, in bytes, currently committed by the garbage collector. Committed memory is the physical memory for which space has been reserved in the disk paging file. | gauge | `process`, `process_id` | | `windows_netframework_clrmemory_reserved_bytes` | Displays the amount of virtual memory, in bytes, currently reserved by the garbage collector. Reserved memory is the virtual memory space reserved for the application when no disk or main memory pages have been used. | gauge | `process`, `process_id` | -| `windows_netframework_clrmemory_gc_time_percent` | Displays the percentage of time that was spent performing a garbage collection in the last sample. | gauge | `process`, `process_id` | +| `windows_netframework_clrmemory_gc_time_ratio` | Displays the ratio (0-1) of elapsed time spent performing a garbage collection since the end of the last garbage collection cycle. Left out when Windows reports no base value. | gauge | `process`, `process_id` | ### CLR Remoting @@ -103,7 +103,7 @@ Comma-separated list of collectors to use. Defaults to all, if not specified. Su | Name | Description | Type | Labels | |-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|---------|-----------| | `windows_netframework_clrsecurity_link_time_checks_total` | Displays the total number of link-time code access security checks since the application started. | counter | `process` | -| `windows_netframework_clrsecurity_rt_checks_time_percent` | Displays the percentage of time spent performing runtime code access security checks in the last sample. | gauge | `process` | +| `windows_netframework_clrsecurity_rt_checks_time_ratio` | Displays the ratio (0-1) of time spent performing runtime code access security checks in the last sample. | gauge | `process` | | `windows_netframework_clrsecurity_stack_walk_depth` | Displays the depth of the stack during that last runtime code access security check. | gauge | `process` | | `windows_netframework_clrsecurity_runtime_checks_total` | Displays the total number of runtime code access security checks performed since the application started. | counter | `process` | diff --git a/docs/collector.nps.md b/docs/collector.nps.md index 20b4731a..b390fba8 100644 --- a/docs/collector.nps.md +++ b/docs/collector.nps.md @@ -16,34 +16,34 @@ None Name | Description | Type | Labels -----|-------------|------|------- -`windows_nps_access_accepts` | | counter | None -`windows_nps_access_bad_authenticators` | | counter | None -`windows_nps_access_challenges` | | counter | None -`windows_nps_access_dropped_packets` | | counter | None -`windows_nps_access_invalid_requests` | | counter | None -`windows_nps_access_malformed_packets` | | counter | None -`windows_nps_access_packets_received` | | counter | None -`windows_nps_access_packets_sent` | | counter | None -`windows_nps_access_rejects` | | counter | None -`windows_nps_access_requests` | | counter | None -`windows_nps_access_server_reset_time` | | counter | None -`windows_nps_access_server_up_time` | | counter | None -`windows_nps_access_unknown_type` | | counter | None -`windows_nps_accounting_bad_authenticators` | | counter | None -`windows_nps_accounting_dropped_packets` | | counter | None -`windows_nps_accounting_invalid_requests` | | counter | None -`windows_nps_accounting_malformed_packets` | | counter | None -`windows_nps_accounting_no_record` | | counter | None -`windows_nps_accounting_packets_received` | | counter | None -`windows_nps_accounting_packets_sent` | | counter | None -`windows_nps_accounting_requests` | | counter | None -`windows_nps_accounting_responses` | | counter | None -`windows_nps_accounting_server_reset_time` | | counter | None -`windows_nps_accounting_server_up_time` | | counter | None -`windows_nps_accounting_unknown_type` | | counter | None +`windows_nps_access_accepts_total` | | counter | None +`windows_nps_access_bad_authenticators_total` | | counter | None +`windows_nps_access_challenges_total` | | counter | None +`windows_nps_access_dropped_packets_total` | | counter | None +`windows_nps_access_invalid_requests_total` | | counter | None +`windows_nps_access_malformed_packets_total` | | counter | None +`windows_nps_access_packets_received_total` | | counter | None +`windows_nps_access_packets_sent_total` | | counter | None +`windows_nps_access_rejects_total` | | counter | None +`windows_nps_access_requests_total` | | counter | None +`windows_nps_access_server_reset_time_seconds` | Elapsed time in seconds since the NPS server counters were last reset | gauge | None +`windows_nps_access_server_up_time_seconds` | Elapsed time in seconds since the NPS service started | gauge | None +`windows_nps_access_unknown_type_total` | | counter | None +`windows_nps_accounting_bad_authenticators_total` | | counter | None +`windows_nps_accounting_dropped_packets_total` | | counter | None +`windows_nps_accounting_invalid_requests_total` | | counter | None +`windows_nps_accounting_malformed_packets_total` | | counter | None +`windows_nps_accounting_no_record_total` | | counter | None +`windows_nps_accounting_packets_received_total` | | counter | None +`windows_nps_accounting_packets_sent_total` | | counter | None +`windows_nps_accounting_requests_total` | | counter | None +`windows_nps_accounting_responses_total` | | counter | None +`windows_nps_accounting_server_reset_time_seconds` | Elapsed time in seconds since the NPS server counters were last reset | gauge | None +`windows_nps_accounting_server_up_time_seconds` | Elapsed time in seconds since the NPS service started | gauge | None +`windows_nps_accounting_unknown_type_total` | | counter | None ### Example metric Show current number of processes ``` -windows_nps_access_accepts{instance="localhost"} -``` \ No newline at end of file +windows_nps_access_accepts_total{instance="localhost"} +``` diff --git a/docs/collector.performancecounter.md b/docs/collector.performancecounter.md index c35f77be..740fd918 100644 --- a/docs/collector.performancecounter.md +++ b/docs/collector.performancecounter.md @@ -33,6 +33,7 @@ collector: object: "Memory" counters: - name: "Cache Faults/sec" + metric: windows_performancecounter_memory_cache_faults_total # optional type: "counter" # optional ``` @@ -50,11 +51,11 @@ YAML: instance_label: "core" counters: - name: "% Processor Time" - metric: windows_performancecounter_processor_information_processor_time # optional + metric: windows_performancecounter_processor_information_processor_time_total # optional labels: state: active - name: "% Idle Time" - metric: windows_performancecounter_processor_information_processor_time # optional + metric: windows_performancecounter_processor_information_processor_time_total # optional labels: state: idle - name: memory @@ -62,7 +63,8 @@ YAML: type: "formatted" counters: - name: "Cache Faults/sec" - type: "counter" # optional + metric: windows_performancecounter_memory_cache_faults_per_second # optional + type: "gauge" # optional ``` @@ -82,14 +84,14 @@ YAML: "counters": [ { "name": "% Processor Time", - "metric": "windows_performancecounter_processor_information_processor_time", + "metric": "windows_performancecounter_processor_information_processor_time_total", "labels": { "state": "active" } }, { "name": "% Idle Time", - "metric": "windows_performancecounter_processor_information_processor_time", + "metric": "windows_performancecounter_processor_information_processor_time_total", "labels": { "state": "idle" } @@ -103,7 +105,8 @@ YAML: "counters": [ { "name": "Cache Faults/sec", - "type": "counter" + "metric": "windows_performancecounter_memory_cache_faults_per_second", + "type": "gauge" } ] } @@ -202,59 +205,59 @@ Otherwise, they would produce identical series and the collector fails to start. ### Example ``` -# HELP windows_performancecounter_memory_cache_faults_sec -# TYPE windows_performancecounter_memory_cache_faults_sec counter -windows_performancecounter_memory_cache_faults_sec 7.028097e+06 -# HELP windows_performancecounter_processor_information_processor_time -# TYPE windows_performancecounter_processor_information_processor_time counter -windows_performancecounter_processor_information_processor_time{core="0,0",state="active"} 8.3809375e+10 -windows_performancecounter_processor_information_processor_time{core="0,0",state="idle"} 8380.9375 -windows_performancecounter_processor_information_processor_time{core="0,1",state="active"} 8.2868125e+10 -windows_performancecounter_processor_information_processor_time{core="0,1",state="idle"} 8286.8125 -windows_performancecounter_processor_information_processor_time{core="0,10",state="active"} 9.720046875e+10 -windows_performancecounter_processor_information_processor_time{core="0,10",state="idle"} 9720.046875 -windows_performancecounter_processor_information_processor_time{core="0,11",state="active"} 9.994921875e+10 -windows_performancecounter_processor_information_processor_time{core="0,11",state="idle"} 9994.921875 -windows_performancecounter_processor_information_processor_time{core="0,12",state="active"} 1.014403125e+11 -windows_performancecounter_processor_information_processor_time{core="0,12",state="idle"} 10144.03125 -windows_performancecounter_processor_information_processor_time{core="0,13",state="active"} 1.0155453125e+11 -windows_performancecounter_processor_information_processor_time{core="0,13",state="idle"} 10155.453125 -windows_performancecounter_processor_information_processor_time{core="0,14",state="active"} 1.01290625e+11 -windows_performancecounter_processor_information_processor_time{core="0,14",state="idle"} 10129.0625 -windows_performancecounter_processor_information_processor_time{core="0,15",state="active"} 1.0134890625e+11 -windows_performancecounter_processor_information_processor_time{core="0,15",state="idle"} 10134.890625 -windows_performancecounter_processor_information_processor_time{core="0,16",state="active"} 1.01405625e+11 -windows_performancecounter_processor_information_processor_time{core="0,16",state="idle"} 10140.5625 -windows_performancecounter_processor_information_processor_time{core="0,17",state="active"} 1.0153421875e+11 -windows_performancecounter_processor_information_processor_time{core="0,17",state="idle"} 10153.421875 -windows_performancecounter_processor_information_processor_time{core="0,18",state="active"} 1.0086390625e+11 -windows_performancecounter_processor_information_processor_time{core="0,18",state="idle"} 10086.390625 -windows_performancecounter_processor_information_processor_time{core="0,19",state="active"} 1.0123453125e+11 -windows_performancecounter_processor_information_processor_time{core="0,19",state="idle"} 10123.453125 -windows_performancecounter_processor_information_processor_time{core="0,2",state="active"} 8.3548125e+10 -windows_performancecounter_processor_information_processor_time{core="0,2",state="idle"} 8354.8125 -windows_performancecounter_processor_information_processor_time{core="0,20",state="active"} 1.011703125e+11 -windows_performancecounter_processor_information_processor_time{core="0,20",state="idle"} 10117.03125 -windows_performancecounter_processor_information_processor_time{core="0,21",state="active"} 1.0140984375e+11 -windows_performancecounter_processor_information_processor_time{core="0,21",state="idle"} 10140.984375 -windows_performancecounter_processor_information_processor_time{core="0,22",state="active"} 1.014615625e+11 -windows_performancecounter_processor_information_processor_time{core="0,22",state="idle"} 10146.15625 -windows_performancecounter_processor_information_processor_time{core="0,23",state="active"} 1.0145125e+11 -windows_performancecounter_processor_information_processor_time{core="0,23",state="idle"} 10145.125 -windows_performancecounter_processor_information_processor_time{core="0,3",state="active"} 8.488953125e+10 -windows_performancecounter_processor_information_processor_time{core="0,3",state="idle"} 8488.953125 -windows_performancecounter_processor_information_processor_time{core="0,4",state="active"} 9.338234375e+10 -windows_performancecounter_processor_information_processor_time{core="0,4",state="idle"} 9338.234375 -windows_performancecounter_processor_information_processor_time{core="0,5",state="active"} 9.776453125e+10 -windows_performancecounter_processor_information_processor_time{core="0,5",state="idle"} 9776.453125 -windows_performancecounter_processor_information_processor_time{core="0,6",state="active"} 9.736265625e+10 -windows_performancecounter_processor_information_processor_time{core="0,6",state="idle"} 9736.265625 -windows_performancecounter_processor_information_processor_time{core="0,7",state="active"} 9.959375e+10 -windows_performancecounter_processor_information_processor_time{core="0,7",state="idle"} 9959.375 -windows_performancecounter_processor_information_processor_time{core="0,8",state="active"} 9.939421875e+10 -windows_performancecounter_processor_information_processor_time{core="0,8",state="idle"} 9939.421875 -windows_performancecounter_processor_information_processor_time{core="0,9",state="active"} 1.0059484375e+11 -windows_performancecounter_processor_information_processor_time{core="0,9",state="idle"} 10059.484375 +# HELP windows_performancecounter_memory_cache_faults_total +# TYPE windows_performancecounter_memory_cache_faults_total counter +windows_performancecounter_memory_cache_faults_total 7.028097e+06 +# HELP windows_performancecounter_processor_information_processor_time_total +# TYPE windows_performancecounter_processor_information_processor_time_total counter +windows_performancecounter_processor_information_processor_time_total{core="0,0",state="active"} 8.3809375e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,0",state="idle"} 8380.9375 +windows_performancecounter_processor_information_processor_time_total{core="0,1",state="active"} 8.2868125e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,1",state="idle"} 8286.8125 +windows_performancecounter_processor_information_processor_time_total{core="0,10",state="active"} 9.720046875e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,10",state="idle"} 9720.046875 +windows_performancecounter_processor_information_processor_time_total{core="0,11",state="active"} 9.994921875e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,11",state="idle"} 9994.921875 +windows_performancecounter_processor_information_processor_time_total{core="0,12",state="active"} 1.014403125e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,12",state="idle"} 10144.03125 +windows_performancecounter_processor_information_processor_time_total{core="0,13",state="active"} 1.0155453125e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,13",state="idle"} 10155.453125 +windows_performancecounter_processor_information_processor_time_total{core="0,14",state="active"} 1.01290625e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,14",state="idle"} 10129.0625 +windows_performancecounter_processor_information_processor_time_total{core="0,15",state="active"} 1.0134890625e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,15",state="idle"} 10134.890625 +windows_performancecounter_processor_information_processor_time_total{core="0,16",state="active"} 1.01405625e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,16",state="idle"} 10140.5625 +windows_performancecounter_processor_information_processor_time_total{core="0,17",state="active"} 1.0153421875e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,17",state="idle"} 10153.421875 +windows_performancecounter_processor_information_processor_time_total{core="0,18",state="active"} 1.0086390625e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,18",state="idle"} 10086.390625 +windows_performancecounter_processor_information_processor_time_total{core="0,19",state="active"} 1.0123453125e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,19",state="idle"} 10123.453125 +windows_performancecounter_processor_information_processor_time_total{core="0,2",state="active"} 8.3548125e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,2",state="idle"} 8354.8125 +windows_performancecounter_processor_information_processor_time_total{core="0,20",state="active"} 1.011703125e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,20",state="idle"} 10117.03125 +windows_performancecounter_processor_information_processor_time_total{core="0,21",state="active"} 1.0140984375e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,21",state="idle"} 10140.984375 +windows_performancecounter_processor_information_processor_time_total{core="0,22",state="active"} 1.014615625e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,22",state="idle"} 10146.15625 +windows_performancecounter_processor_information_processor_time_total{core="0,23",state="active"} 1.0145125e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,23",state="idle"} 10145.125 +windows_performancecounter_processor_information_processor_time_total{core="0,3",state="active"} 8.488953125e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,3",state="idle"} 8488.953125 +windows_performancecounter_processor_information_processor_time_total{core="0,4",state="active"} 9.338234375e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,4",state="idle"} 9338.234375 +windows_performancecounter_processor_information_processor_time_total{core="0,5",state="active"} 9.776453125e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,5",state="idle"} 9776.453125 +windows_performancecounter_processor_information_processor_time_total{core="0,6",state="active"} 9.736265625e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,6",state="idle"} 9736.265625 +windows_performancecounter_processor_information_processor_time_total{core="0,7",state="active"} 9.959375e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,7",state="idle"} 9959.375 +windows_performancecounter_processor_information_processor_time_total{core="0,8",state="active"} 9.939421875e+10 +windows_performancecounter_processor_information_processor_time_total{core="0,8",state="idle"} 9939.421875 +windows_performancecounter_processor_information_processor_time_total{core="0,9",state="active"} 1.0059484375e+11 +windows_performancecounter_processor_information_processor_time_total{core="0,9",state="idle"} 10059.484375 ``` > [!NOTE] > If you are using a configuration file, the value must be keep as string. diff --git a/docs/collector.printer.md b/docs/collector.printer.md index 430d4a4c..1340691e 100644 --- a/docs/collector.printer.md +++ b/docs/collector.printer.md @@ -24,5 +24,5 @@ If given, a printer needs to *not* match the exclude regular expression in order Name | Description | Type | Labels -----|-------------|---------|------- `windows_printer_status` | Printer status. 1 for the current status, 0 otherwise | gauge | `printer`, `status` -`windows_printer_job_count` | Number of jobs processed by the printer since the last reset | counter | `printer` +`windows_printer_jobs` | Number of jobs in the queue of the printer | gauge | `printer` `windows_printer_job_status` | A counter of printer jobs by status | gauge | `printer`, `status` diff --git a/docs/collector.process.md b/docs/collector.process.md index 27d6c85d..9278a7ea 100644 --- a/docs/collector.process.md +++ b/docs/collector.process.md @@ -90,7 +90,7 @@ w3wp_Test |------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|---------------------------------------------------------------------------------------| | `windows_process_info` | A metric with a constant '1' value labeled with process information | gauge | `process`, `process_id`, `creating_process_id`, `process_group_id`,`owner`, `cmdline` | | `windows_process_start_time_seconds_timestamp` | Epoch time (seconds since 1970/1/1) of process start. | gauge | `process`, `process_id` | -| `windows_process_cpu_time_total` | Returns elapsed time that all of the threads of this process used the processor to execute instructions by mode (privileged, user). An instruction is the basic unit of execution in a computer, a thread is the object that executes instructions, and a process is the object created when a program is run. Code executed to handle some hardware interrupts and trap conditions is included in this count. | counter | `process`, `process_id`, `mode` | +| `windows_process_cpu_time_seconds_total` | Returns elapsed time that all of the threads of this process used the processor to execute instructions by mode (privileged, user). An instruction is the basic unit of execution in a computer, a thread is the object that executes instructions, and a process is the object created when a program is run. Code executed to handle some hardware interrupts and trap conditions is included in this count. | counter | `process`, `process_id`, `mode` | | `windows_process_handles` | Total number of handles the process has open. This number is the sum of the handles currently open by each thread in the process. | gauge | `process`, `process_id` | | `windows_process_io_bytes_total` | Bytes issued to I/O operations in different modes (read, write, other). This property counts all I/O activity generated by the process to include file, network, and device I/Os. Read and write mode includes data operations; other mode includes those that do not involve data, such as control operations. | counter | `process`, `process_id`, `mode` | | `windows_process_io_operations_total` | I/O operations issued in different modes (read, write, other). This property counts all I/O activity generated by the process to include file, network, and device I/Os. Read and write mode includes data operations; other mode includes those that do not involve data, such as control operations. | counter | `process`, `process_id`, `mode` | diff --git a/docs/collector.scheduled_task.md b/docs/collector.scheduled_task.md index 02987170..9b7a1191 100644 --- a/docs/collector.scheduled_task.md +++ b/docs/collector.scheduled_task.md @@ -53,7 +53,6 @@ and an empty table of tasks with missed runs. Default: `false` Name | Description | Type | Labels -----|-------------|------|------- -`windows_scheduled_task_last_result` | **Deprecated:** use `windows_scheduled_task_last_result_status`. 1 if the last result code is zero, 0 otherwise; omitted for tasks that have never run | gauge | task `windows_scheduled_task_last_result_status` | The last result status of a scheduled task, 1 if the current status, 0 otherwise | gauge | task, status `windows_scheduled_task_missed_runs` | The number of times the registered task missed a scheduled run; only with `--collector.scheduled_task.missed-runs` | gauge | task `windows_scheduled_task_state` | The current state of a scheduled task | gauge | task, state @@ -88,18 +87,13 @@ not establish whether the task succeeded or failed. See [Microsoft's Task Scheduler result codes](https://learn.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-error-and-success-constants) for details. -### Deprecated metric +### Result status -`windows_scheduled_task_last_result` is deprecated. Use -`windows_scheduled_task_last_result_status` to distinguish success, running, +Use `windows_scheduled_task_last_result_status` to distinguish success, running, tasks that have never run, and other scheduler statuses. For example, use `windows_scheduled_task_last_result_status{status="success"} == 1` to select -successful results. - -The deprecated metric remains available with its existing labels and values for -compatibility. A running result code still produces 0, which does not necessarily -mean the task failed. `windows_scheduled_task_last_result` and -`windows_scheduled_task_missed_runs` are omitted when the result is `has_not_run`. +successful results. `windows_scheduled_task_missed_runs` is omitted when the +result is `has_not_run`. ### State @@ -116,7 +110,6 @@ A task can be in the following states: This Windows task is only reported with `--collector.scheduled_task.exclude=""`. ``` -windows_scheduled_task_last_result{task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 1 windows_scheduled_task_last_result_status{status="success",task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 1 windows_scheduled_task_last_result_status{status="ready",task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 0 windows_scheduled_task_last_result_status{status="running",task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 0 @@ -151,14 +144,6 @@ Tasks that have never run: windows_scheduled_task_last_result_status{status="has_not_run"} == 1 ``` -For dashboards still using the deprecated success/failure metric, exclude running tasks: - -```promql -(windows_scheduled_task_last_result == 0) -unless on (job, instance, task) -(windows_scheduled_task_state{state="running"} == 1) -``` - ## Alerting examples This example treats unknown or terminated results as failures. An `unknown` diff --git a/docs/collector.smb.md b/docs/collector.smb.md index d74f0319..9faa3694 100644 --- a/docs/collector.smb.md +++ b/docs/collector.smb.md @@ -17,8 +17,8 @@ None ## Metrics Name | Description | Type | Labels -----|-------------|------|------- -`windows_smb_server_shares_current_open_file_count` | Current total count open files on the SMB Server Share | gauge | `share` -`windows_smb_server_shares_tree_connect_count` | Count of user connections to the SMB Server Share | gauge | `share` +`windows_smb_server_shares_open_files` | Current total count open files on the SMB Server Share | gauge | `share` +`windows_smb_server_shares_tree_connects` | Count of user connections to the SMB Server Share | gauge | `share` `windows_smb_server_shares_received_bytes_total` | Received bytes on the SMB Server Share | counter | `share` `windows_smb_server_shares_write_requests_total` | Writes requests on the SMB Server Share | counter | `share` `windows_smb_server_shares_read_requests_total` | Read requests on the SMB Server Share | counter | `share` diff --git a/docs/collector.storage_spaces.md b/docs/collector.storage_spaces.md index a05b0587..f31a4e9e 100644 --- a/docs/collector.storage_spaces.md +++ b/docs/collector.storage_spaces.md @@ -50,7 +50,7 @@ Join on `unique_id` to restrict other pool metrics to concrete pools, as shown i | `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_percent` | Storage efficiency percentage (AllocatedSize / FootprintOnPool * 100), omitted while FootprintOnPool is 0 | 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` | ### Example metric @@ -72,7 +72,7 @@ Storage pool usage in percent, excluding the primordial pool Find virtual disks with low storage efficiency (over-provisioned) ``` -windows_storage_spaces_virtual_disk_storage_efficiency_percent < 50 +windows_storage_spaces_virtual_disk_storage_efficiency_ratio < 0.5 ``` Calculate total virtual disk capacity vs physical usage diff --git a/docs/collector.tcp.md b/docs/collector.tcp.md index de7006c0..3518469b 100644 --- a/docs/collector.tcp.md +++ b/docs/collector.tcp.md @@ -29,7 +29,7 @@ Example: `--collector.tcp.enabled=metrics` | `windows_tcp_segments_received_total` | Total segments received, including those received in error. This count includes segments received on currently established connections | counter | af | | `windows_tcp_segments_retransmitted_total` | Total segments retransmitted. That is, segments transmitted that contain one or more previously transmitted bytes | counter | af | | `windows_tcp_segments_sent_total` | Total segments sent, including those on current connections, but excluding those containing *only* retransmitted bytes | counter | af | -| `windows_tcp_connections_state_count` | Number of TCP connections by state among: CLOSED, LISTENING, SYN_SENT, SYN_RECEIVED, ESTABLISHED, FIN_WAIT1, FIN_WAIT2, CLOSE_WAIT, CLOSING, LAST_ACK, TIME_WAIT, DELETE_TCB | gauge | af, state | +| `windows_tcp_connections` | Number of TCP connections by state among: CLOSED, LISTENING, SYN_SENT, SYN_RECEIVED, ESTABLISHED, FIN_WAIT1, FIN_WAIT2, CLOSE_WAIT, CLOSING, LAST_ACK, TIME_WAIT, DELETE_TCB | gauge | af, state | ### Example metric _This collector does not yet have explained examples, we would appreciate your help adding them!_ diff --git a/docs/collector.time.md b/docs/collector.time.md index d31ff3af..cfe55955 100644 --- a/docs/collector.time.md +++ b/docs/collector.time.md @@ -25,7 +25,7 @@ Matching is case-sensitive. | Name | Description | Type | Labels | |----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|------------| | `windows_time_clock_frequency_adjustment` | Adjustment made to the local system clock frequency by W32Time in nominal clock units. This counter helps visualize the finer adjustments being made by W32Time to synchronize the local clock. | gauge | None | -| `windows_time_clock_frequency_adjustment_ppb` | Adjustment made to the local system clock frequency by W32Time in parts per billion (PPB) units. 1 PPB adjustment implies the system clock was adjusted at a rate of 1 nanosecond per second (1 ns/s). The smallest possible adjustment can vary and is expected to be in the order of 100's of PPB. | gauge | None | +| `windows_time_clock_frequency_adjustment_ratio` | Adjustment made to the local system clock frequency by W32Time, as a ratio. Windows reports it in parts per billion (PPB); 1 PPB (a ratio of 1e-9) implies the system clock was adjusted at a rate of 1 nanosecond per second (1 ns/s). The smallest possible adjustment can vary and is expected to be in the order of 100's of PPB. | gauge | None | | `windows_time_computed_time_offset_seconds` | The absolute time offset between the system clock and the chosen time source, as computed by the W32Time service, in seconds. When a new valid sample is available, the computed time is updated with the time offset indicated by the sample. This time is the actual time offset of the local clock. W32Time initiates clock correction by using this offset and updates the computed time in between samples with the remaining time offset that needs to be applied to the local clock. Clock accuracy can be tracked by using this performance counter with a low polling interval (for example, 256 seconds or less) and looking for the counter value to be smaller than the desired clock accuracy limit. | gauge | None | | `windows_time_ntp_client_time_sources` | Active number of NTP Time sources being used by the client. This is a count of active, distinct IP addresses of time servers that are responding to this client's requests. | gauge | None | | `windows_time_ntp_round_trip_delay_seconds` | Total roundtrip delay experienced by the NTP client in receiving a response from the server for the most recent request, in seconds. This is the time elapsed on the NTP client between transmitting a request to the NTP server and receiving a valid response from the server. | gauge | None | diff --git a/docs/collector.vmware.md b/docs/collector.vmware.md index 5a5f1bb1..c5a8c17f 100644 --- a/docs/collector.vmware.md +++ b/docs/collector.vmware.md @@ -28,13 +28,13 @@ None | `windows_vmware_mem_swapped_bytes` | The amount of memory associated with this virtual machine that has been swapped by ESX. | gauge | None | | `windows_vmware_mem_target_size_bytes` | Memory Target Size | gauge | None | | `windows_vmware_mem_used_bytes` | The estimated amount of physical host memory currently consumed for this virtual machine’s physical memory. | gauge | None | -| `windows_vmware_cpu_limit_mhz` | The maximum processing power in MHz allowed to the virtual machine. Assigning a CPU Limit ensures that this virtual machine never consumes more than a certain amount of the available processor power. By limiting the amount of processing power consumed, a portion of the processing power becomes available to other virtual machines. | gauge | None | -| `windows_vmware_cpu_reservation_mhz` | The minimum processing power in MHz available to the virtual machine. Assigning a CPU Reservation ensures that even as other virtual machines on the same host consume shared processing power, there is still a certain minimum amount for this virtual machine. | gauge | None | +| `windows_vmware_cpu_limit_hertz` | The maximum processing power in hertz allowed to the virtual machine. Assigning a CPU Limit ensures that this virtual machine never consumes more than a certain amount of the available processor power. By limiting the amount of processing power consumed, a portion of the processing power becomes available to other virtual machines. | gauge | None | +| `windows_vmware_cpu_reservation_hertz` | The minimum processing power in hertz available to the virtual machine. Assigning a CPU Reservation ensures that even as other virtual machines on the same host consume shared processing power, there is still a certain minimum amount for this virtual machine. | gauge | None | | `windows_vmware_cpu_shares` | The number of CPU shares allocated to the virtual machine. | gauge | None | | `windows_vmware_cpu_stolen_seconds_total` | The time that the VM was runnable but not scheduled to run | counter | None | | `windows_vmware_cpu_time_seconds_total` | Current load of the VM’s virtual processor | counter | None | -| `windows_vmware_cpu_effective_vm_speed_mhz_total` | The effective speed of the VM’s virtual CPU | gauge | None | -| `windows_vmware_host_processor_speed_mhz` | Host Processor speed | gauge | None | +| `windows_vmware_cpu_effective_vm_speed_hertz` | The effective speed of the VM’s virtual CPU in hertz | gauge | None | +| `windows_vmware_host_processor_speed_hertz` | Host processor speed in hertz | gauge | None | ### Example metric _This collector does not yet have explained examples, we would appreciate your help adding them!_ diff --git a/internal/collector/ad/ad.go b/internal/collector/ad/ad.go index 96fd8405..3fba4875 100644 --- a/internal/collector/ad/ad.go +++ b/internal/collector/ad/ad.go @@ -207,7 +207,7 @@ func (c *Collector) buildDescriptors() { nil, ) c.replicationHighestUsn = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "replication_highest_usn"), + prometheus.BuildFQName(types.Namespace, Name, "replication_highest_usn_total"), "Highest update sequence number (USN) committed or issued by this domain controller (DRA Highest USN Committed/Issued).", []string{"state"}, nil, diff --git a/internal/collector/cache/cache.go b/internal/collector/cache/cache.go index b6b9aeb2..f712af1f 100644 --- a/internal/collector/cache/cache.go +++ b/internal/collector/cache/cache.go @@ -53,7 +53,6 @@ type Collector struct { copyReadsTotal *prometheus.Desc dataFlushesTotal *prometheus.Desc dataFlushPagesTotal *prometheus.Desc - dataMapHitsPercent *prometheus.Desc dataMapHitsTotal *prometheus.Desc dataMapPinsTotal *prometheus.Desc dataMapsTotal *prometheus.Desc @@ -164,12 +163,6 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { "Number of data-map requests that hit the cache.", nil, nil, ) - c.dataMapHitsPercent = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "data_map_hits_percent"), - "Deprecated: raw data-map hit count, not a percentage. Use windows_cache_data_map_hits_total.", - nil, - nil, - ) c.dataMapPinsTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "data_map_pins_total"), "(DataMapPinsTotal)", @@ -364,12 +357,6 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric, _ time.Duration) error c.perfDataObject[0].DataMapHitsTotal, ) - ch <- prometheus.MustNewConstMetric( - c.dataMapHitsPercent, - prometheus.GaugeValue, - c.perfDataObject[0].DataMapHitsTotal, - ) - ch <- prometheus.MustNewConstMetric( c.dataMapPinsTotal, prometheus.CounterValue, diff --git a/internal/collector/cache/data_map_hits_test.go b/internal/collector/cache/data_map_hits_test.go index 61aeb8b3..5d1ee5b1 100644 --- a/internal/collector/cache/data_map_hits_test.go +++ b/internal/collector/cache/data_map_hits_test.go @@ -62,12 +62,11 @@ func TestDataMapHitCounterWireFormats(t *testing.T) { require.Contains(t, openMetrics.String(), "# TYPE windows_cache_data_map_hits counter") require.Contains(t, openMetrics.String(), "windows_cache_data_map_hits_total 1000") case "windows_cache_data_map_hits_percent": - found[family.GetName()] = true - require.InDelta(t, 1000, family.GetMetric()[0].GetGauge().GetValue(), 1e-9) + t.Fatalf("removed metric %s is still exported", family.GetName()) } } - require.Len(t, found, 2) + require.Len(t, found, 1) } type dataMapFixture struct{} diff --git a/internal/collector/container/container.go b/internal/collector/container/container.go index 81d4549d..baf5829f 100644 --- a/internal/collector/container/container.go +++ b/internal/collector/container/container.go @@ -281,7 +281,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, ) c.containersCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "count"), + prometheus.BuildFQName(types.Namespace, "", "containers"), "Number of containers", nil, nil, @@ -329,13 +329,13 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, ) c.runtimeUser = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "cpu_usage_seconds_usermode"), + prometheus.BuildFQName(types.Namespace, Name, "cpu_usage_usermode_seconds_total"), "Run Time in User mode in Seconds", []string{"container_id", "namespace", "pod", "container"}, nil, ) c.runtimeKernel = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "cpu_usage_seconds_kernelmode"), + prometheus.BuildFQName(types.Namespace, Name, "cpu_usage_kernelmode_seconds_total"), "Run time in Kernel mode in Seconds", []string{"container_id", "namespace", "pod", "container"}, nil, diff --git a/internal/collector/cpu/AGENTS.md b/internal/collector/cpu/AGENTS.md index 196a7449..909e213d 100644 --- a/internal/collector/cpu/AGENTS.md +++ b/internal/collector/cpu/AGENTS.md @@ -28,7 +28,8 @@ Hyper-V guest with 12 logical processors in one processor group. - `Interrupts/sec`, `DPCs Queued/sec` and `Clock Interrupts/sec` (`PERF_COUNTER_COUNTER`) and `C1/C2/C3 Transitions/sec`, `Idle Break Events/sec` (`PERF_COUNTER_BULK_COUNT`) are cumulative counts. -- `Processor Frequency` is a gauge in MHz (3700 here). `Parking Status` is a +- `Processor Frequency` is a gauge in MHz (3700 here); the collector multiplies + it by 1e6 for `windows_cpu_core_frequency_hertz`. `Parking Status` is a gauge, 0 when the processor is not parked. `% Performance Limit` is a gauge percentage (100 here). `% C3 Time` and `C3 Transitions/sec` stayed 0 on this virtual machine. diff --git a/internal/collector/cpu/cpu.go b/internal/collector/cpu/cpu.go index 10945d2c..f8f61190 100644 --- a/internal/collector/cpu/cpu.go +++ b/internal/collector/cpu/cpu.go @@ -57,7 +57,7 @@ type Collector struct { clockInterruptsTotal *prometheus.Desc idleBreakEventsTotal *prometheus.Desc parkingStatus *prometheus.Desc - processorFrequencyMHz *prometheus.Desc + processorFrequencyHertz *prometheus.Desc processorPerformance *prometheus.Desc processorMPerf *prometheus.Desc processorRTC *prometheus.Desc @@ -107,7 +107,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, ) c.timeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "time_total"), + prometheus.BuildFQName(types.Namespace, Name, "time_seconds_total"), "Time that processor spent in different modes (dpc, idle, interrupt, privileged, user)", []string{"core", "mode"}, nil, @@ -142,9 +142,9 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { []string{"core"}, nil, ) - c.processorFrequencyMHz = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "core_frequency_mhz"), - "Core frequency in megahertz", + c.processorFrequencyHertz = prometheus.NewDesc( + prometheus.BuildFQName(types.Namespace, Name, "core_frequency_hertz"), + "Core frequency in hertz", []string{"core"}, nil, ) @@ -321,9 +321,9 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric, _ time.Duration) error ) ch <- prometheus.MustNewConstMetric( - c.processorFrequencyMHz, + c.processorFrequencyHertz, prometheus.GaugeValue, - coreData.ProcessorFrequencyMHz, + coreData.ProcessorFrequencyMHz*1e6, core, ) diff --git a/internal/collector/cpu_info/cpu_info.go b/internal/collector/cpu_info/cpu_info.go index ee47decb..8ab4e7e7 100644 --- a/internal/collector/cpu_info/cpu_info.go +++ b/internal/collector/cpu_info/cpu_info.go @@ -123,16 +123,16 @@ func (c *Collector) Build(_ *slog.Logger, miSession *mi.Session) error { nil, ) c.cpuL2CacheSize = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "l2_cache_size"), - "Size of L2 cache per CPU", + prometheus.BuildFQName(types.Namespace, Name, "l2_cache_size_bytes"), + "Size of L2 cache per CPU in bytes", []string{ "device_id", }, nil, ) c.cpuL3CacheSize = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "l3_cache_size"), - "Size of L3 cache per CPU", + prometheus.BuildFQName(types.Namespace, Name, "l3_cache_size_bytes"), + "Size of L3 cache per CPU in bytes", []string{ "device_id", }, @@ -225,14 +225,14 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric, maxScrapeDuration time. ch <- prometheus.MustNewConstMetric( c.cpuL2CacheSize, prometheus.GaugeValue, - float64(processor.L2CacheSize), + float64(processor.L2CacheSize)*1024, strings.TrimRight(processor.DeviceID, " "), ) ch <- prometheus.MustNewConstMetric( c.cpuL3CacheSize, prometheus.GaugeValue, - float64(processor.L3CacheSize), + float64(processor.L3CacheSize)*1024, strings.TrimRight(processor.DeviceID, " "), ) } diff --git a/internal/collector/diskdrive/diskdrive.go b/internal/collector/diskdrive/diskdrive.go index 40f9e411..2f48ab28 100644 --- a/internal/collector/diskdrive/diskdrive.go +++ b/internal/collector/diskdrive/diskdrive.go @@ -97,7 +97,7 @@ func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error { nil, ) c.size = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "size"), + 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"}, nil, diff --git a/internal/collector/exchange/exchange_ad_access_processes.go b/internal/collector/exchange/exchange_ad_access_processes.go index f5f8fc23..b2564821 100644 --- a/internal/collector/exchange/exchange_ad_access_processes.go +++ b/internal/collector/exchange/exchange_ad_access_processes.go @@ -65,8 +65,8 @@ func (c *Collector) buildADAccessProcesses() error { } c.ldapReadTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "ldap_read_time_sec"), - "Time (sec) to send an LDAP read request and receive a response", + 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"}, nil, ) @@ -77,8 +77,8 @@ func (c *Collector) buildADAccessProcesses() error { nil, ) c.ldapSearchTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "ldap_search_time_sec"), - "Time (sec) to send an LDAP search request and receive a response", + 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"}, nil, ) @@ -89,8 +89,8 @@ func (c *Collector) buildADAccessProcesses() error { nil, ) c.ldapWriteTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "ldap_write_time_sec"), - "Time (sec) to send an LDAP Add/Modify/Delete request and receive a response", + 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"}, nil, ) @@ -107,8 +107,8 @@ func (c *Collector) buildADAccessProcesses() error { nil, ) c.longRunningLDAPOperationsPerMin = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "ldap_long_running_ops_per_sec"), - "Long Running LDAP operations per second", + 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"}, nil, ) @@ -185,8 +185,8 @@ func (c *Collector) collectADAccessProcesses(ch chan<- prometheus.Metric) error ch <- prometheus.MustNewConstMetric( c.longRunningLDAPOperationsPerMin, - prometheus.CounterValue, - data.LongRunningLDAPOperationsPerMin*60, + prometheus.GaugeValue, + data.LongRunningLDAPOperationsPerMin/60, labelName, ) } diff --git a/internal/collector/exchange/exchange_availability_service.go b/internal/collector/exchange/exchange_availability_service.go index 7f3531cd..c06de201 100644 --- a/internal/collector/exchange/exchange_availability_service.go +++ b/internal/collector/exchange/exchange_availability_service.go @@ -45,8 +45,8 @@ func (c *Collector) buildAvailabilityService() error { } c.availabilityRequestsSec = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availability_service_requests_per_sec"), - "Number of requests serviced per second", + prometheus.BuildFQName(types.Namespace, Name, "availability_service_requests_total"), + "Total number of requests serviced", nil, nil, ) diff --git a/internal/collector/exchange/exchange_http_proxy.go b/internal/collector/exchange/exchange_http_proxy.go index c49ac695..10fcfd99 100644 --- a/internal/collector/exchange/exchange_http_proxy.go +++ b/internal/collector/exchange/exchange_http_proxy.go @@ -58,14 +58,14 @@ func (c *Collector) buildHTTPProxy() error { } c.mailboxServerLocatorAverageLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "http_proxy_mailbox_server_locator_avg_latency_sec"), - "Average latency (sec) of MailboxServerLocator web service calls", + prometheus.BuildFQName(types.Namespace, Name, "http_proxy_mailbox_server_locator_avg_latency_seconds"), + "Average latency in seconds of MailboxServerLocator web service calls", []string{"name"}, nil, ) c.averageAuthenticationLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "http_proxy_avg_auth_latency"), - "Average time spent authenticating CAS requests over the last 200 samples", + 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"}, nil, ) @@ -82,14 +82,14 @@ func (c *Collector) buildHTTPProxy() error { nil, ) c.averageCASProcessingLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "http_proxy_avg_cas_processing_latency_sec"), - "Average latency (sec) of CAS processing time over the last 200 reqs", + 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"}, nil, ) c.mailboxServerProxyFailureRate = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "http_proxy_mailbox_proxy_failure_rate"), - "% of failures between this CAS and MBX servers over the last 200 samples", + 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"}, nil, ) @@ -115,7 +115,7 @@ func (c *Collector) collectHTTPProxy(ch chan<- prometheus.Metric) error { ch <- prometheus.MustNewConstMetric( c.averageAuthenticationLatency, prometheus.GaugeValue, - data.AverageAuthenticationLatency, + utils.MilliSecToSec(data.AverageAuthenticationLatency), labelName, ) @@ -129,7 +129,7 @@ func (c *Collector) collectHTTPProxy(ch chan<- prometheus.Metric) error { ch <- prometheus.MustNewConstMetric( c.mailboxServerProxyFailureRate, prometheus.GaugeValue, - data.MailboxServerProxyFailureRate, + data.MailboxServerProxyFailureRate/100, labelName, ) diff --git a/internal/collector/exchange/exchange_mapi_http_emsmdb.go b/internal/collector/exchange/exchange_mapi_http_emsmdb.go index 60f4b5a3..f03e58ab 100644 --- a/internal/collector/exchange/exchange_mapi_http_emsmdb.go +++ b/internal/collector/exchange/exchange_mapi_http_emsmdb.go @@ -45,7 +45,7 @@ func (c *Collector) buildMapiHTTPEmsMDB() error { } c.activeUserCountMapiHTTPEmsMDB = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "mapihttp_emsmdb_active_user_count"), + prometheus.BuildFQName(types.Namespace, Name, "mapihttp_emsmdb_active_users"), "Number of unique outlook users that have shown some kind of activity in the last 2 minutes", nil, nil, diff --git a/internal/collector/exchange/exchange_rpc_client_access.go b/internal/collector/exchange/exchange_rpc_client_access.go index eb50c8e6..8cb87030 100644 --- a/internal/collector/exchange/exchange_rpc_client_access.go +++ b/internal/collector/exchange/exchange_rpc_client_access.go @@ -56,8 +56,8 @@ func (c *Collector) buildRpcClientAccess() error { } c.rpcAveragedLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "rpc_avg_latency_sec"), - "The latency (sec) averaged for the past 1024 packets", + prometheus.BuildFQName(types.Namespace, Name, "rpc_avg_latency_seconds"), + "The latency in seconds averaged for the past 1024 packets", nil, nil, ) @@ -68,13 +68,13 @@ func (c *Collector) buildRpcClientAccess() error { nil, ) c.activeUserCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "rpc_active_user_count"), + prometheus.BuildFQName(types.Namespace, Name, "rpc_active_users"), "Number of unique users that have shown some kind of activity in the last 2 minutes", nil, nil, ) c.connectionCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "rpc_connection_count"), + prometheus.BuildFQName(types.Namespace, Name, "rpc_connections"), "Total number of client connections maintained", nil, nil, @@ -86,7 +86,7 @@ func (c *Collector) buildRpcClientAccess() error { nil, ) c.userCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "rpc_user_count"), + prometheus.BuildFQName(types.Namespace, Name, "rpc_users"), "Number of users", nil, nil, diff --git a/internal/collector/exchange/exchange_workload_management.go b/internal/collector/exchange/exchange_workload_management.go index 6fbd1e19..fa722d06 100644 --- a/internal/collector/exchange/exchange_workload_management.go +++ b/internal/collector/exchange/exchange_workload_management.go @@ -61,7 +61,7 @@ func (c *Collector) buildWorkloadManagementWorkloads() error { nil, ) c.completedTasks = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "workload_completed_tasks"), + prometheus.BuildFQName(types.Namespace, Name, "workload_completed_tasks_total"), "Number of workload management tasks that have been completed", []string{"name"}, nil, @@ -73,7 +73,7 @@ func (c *Collector) buildWorkloadManagementWorkloads() error { nil, ) c.yieldedTasks = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "workload_yielded_tasks"), + prometheus.BuildFQName(types.Namespace, Name, "workload_yielded_tasks_total"), "The total number of tasks that have been yielded by a workload", []string{"name"}, nil, @@ -113,7 +113,7 @@ func (c *Collector) collectWorkloadManagementWorkloads(ch chan<- prometheus.Metr ch <- prometheus.MustNewConstMetric( c.queuedTasks, - prometheus.CounterValue, + prometheus.GaugeValue, data.QueuedTasks, labelName, ) diff --git a/internal/collector/fsrmquota/fsrmquota.go b/internal/collector/fsrmquota/fsrmquota.go index 0aca4bc9..322e4820 100644 --- a/internal/collector/fsrmquota/fsrmquota.go +++ b/internal/collector/fsrmquota/fsrmquota.go @@ -204,7 +204,7 @@ func (c *Collector) emitQuotas(ch chan<- prometheus.Metric, dst []msftFSRMQuota) func (c *Collector) buildDescriptors() { c.quotasCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "count"), + prometheus.BuildFQName(types.Namespace, Name, "quotas"), "Number of Quotas", nil, nil, diff --git a/internal/collector/gpu/gpu.go b/internal/collector/gpu/gpu.go index 603de896..7bb31507 100644 --- a/internal/collector/gpu/gpu.go +++ b/internal/collector/gpu/gpu.go @@ -194,7 +194,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { ) c.gpuEngineRunningTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "engine_time_seconds"), + prometheus.BuildFQName(types.Namespace, Name, "engine_time_seconds_total"), "Total running time of the GPU engine in seconds.", []string{"process_id", "luid", "device_id", "phys", "eng", "engtype"}, nil, diff --git a/internal/collector/hyperv/AGENTS.md b/internal/collector/hyperv/AGENTS.md index 5336b9d9..1dd76bcc 100644 --- a/internal/collector/hyperv/AGENTS.md +++ b/internal/collector/hyperv/AGENTS.md @@ -44,7 +44,8 @@ memory) on a host with 12 logical processors. `... count` counters are cumulative. The `... latency microseconds` counters are not cumulative: `Commit operation latency microseconds` of the configuration file dropped from 6659 to 5213 while `Commit operation count` - stayed 1. + stayed 1. The collector converts the latencies to seconds + (`..._latency_seconds`) and publishes the counts as `_total` counters. - `Hyper-V VM Vid Partition`: pages are 4 KiB. The 2 GiB VM had 526336 `Physical Pages Allocated`. - `Hyper-V Virtual Storage Device`: instances are the disk path with `\` diff --git a/internal/collector/hyperv/hyperv_datastore.go b/internal/collector/hyperv/hyperv_datastore.go index 795373cb..17f0949e 100644 --- a/internal/collector/hyperv/hyperv_datastore.go +++ b/internal/collector/hyperv/hyperv_datastore.go @@ -229,187 +229,187 @@ func (c *Collector) buildDataStore() error { nil, ) c.dataStoreReconnectLatencyMicro = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_reconnect_latency_microseconds"), - "Represents the reconnect latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_reconnect_latency_seconds"), + "Represents the reconnect latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreDisconnectCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_disconnect_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_disconnects_total"), "Represents the disconnect count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreWriteToFileByteLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_file_byte_latency_microseconds"), - "Represents the write to file byte latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_file_byte_latency_seconds"), + "Represents the write to file byte latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreWriteToFileByteCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_file_byte_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_file_bytes_total"), "Represents the write to file byte count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreWriteToFileCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_file_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_file_operations_total"), "Represents the write to file count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreReadFromFileByteLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_file_byte_latency_microseconds"), - "Represents the read from file byte latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_file_byte_latency_seconds"), + "Represents the read from file byte latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreReadFromFileByteCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_file_byte_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_file_bytes_total"), "Represents the read from file byte count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreReadFromFileCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_file_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_file_operations_total"), "Represents the read from file count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreWriteToStorageByteLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_storage_byte_latency_microseconds"), - "Represents the write to storage byte latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_storage_byte_latency_seconds"), + "Represents the write to storage byte latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreWriteToStorageByteCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_storage_byte_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_storage_bytes_total"), "Represents the write to storage byte count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreWriteToStorageCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_storage_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_write_to_storage_operations_total"), "Represents the write to storage count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreReadFromStorageByteLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_storage_byte_latency_microseconds"), - "Represents the read from storage byte latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_storage_byte_latency_seconds"), + "Represents the read from storage byte latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreReadFromStorageByteCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_storage_byte_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_storage_bytes_total"), "Represents the read from storage byte count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreReadFromStorageCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_storage_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_read_from_storage_operations_total"), "Represents the read from storage count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCommitByteLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_byte_latency_microseconds"), - "Represents the commit byte latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_byte_latency_seconds"), + "Represents the commit byte latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCommitByteCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_byte_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_bytes_total"), "Represents the commit byte count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCommitCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_commits_total"), "Represents the commit count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCacheUpdateOperationLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_cache_update_operation_latency_microseconds"), - "Represents the cache update operation latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_cache_update_operation_latency_seconds"), + "Represents the cache update operation latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCacheUpdateOperationCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_cache_update_operation_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_cache_update_operations_total"), "Represents the cache update operation count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCommitOperationLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_operation_latency_microseconds"), - "Represents the commit operation latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_operation_latency_seconds"), + "Represents the commit operation latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCommitOperationCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_operation_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_commit_operations_total"), "Represents the commit operation count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCompactOperationLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_compact_operation_latency_microseconds"), - "Represents the compact operation latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_compact_operation_latency_seconds"), + "Represents the compact operation latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreCompactOperationCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_compact_operation_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_compact_operations_total"), "Represents the compact operation count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreLoadFileOperationLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_load_file_operation_latency_microseconds"), - "Represents the load file operation latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_load_file_operation_latency_seconds"), + "Represents the load file operation latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreLoadFileOperationCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_load_file_operation_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_load_file_operations_total"), "Represents the load file operation count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreRemoveOperationLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_remove_operation_latency_microseconds"), - "Represents the remove operation latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_remove_operation_latency_seconds"), + "Represents the remove operation latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreRemoveOperationCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_remove_operation_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_remove_operations_total"), "Represents the remove operation count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreQuerySizeOperationLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_query_size_operation_latency_microseconds"), - "Represents the query size operation latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_query_size_operation_latency_seconds"), + "Represents the query size operation latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreQuerySizeOperationCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_query_size_operation_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_query_size_operations_total"), "Represents the query size operation count of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreSetOperationLatencyMicro = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_set_operation_latency_microseconds"), - "Represents the set operation latency in microseconds of the DataStore.", + prometheus.BuildFQName(types.Namespace, Name, "datastore_set_operation_latency_seconds"), + "Represents the set operation latency in seconds of the DataStore.", []string{"datastore"}, nil, ) c.dataStoreSetOperationCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "datastore_set_operation_count"), + prometheus.BuildFQName(types.Namespace, Name, "datastore_set_operations_total"), "Represents the set operation count of the DataStore.", []string{"datastore"}, nil, @@ -533,7 +533,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreReconnectLatencyMicro, prometheus.GaugeValue, - data.DataStoreReconnectLatencyMicro, + data.DataStoreReconnectLatencyMicro*1e-6, data.Name, ) @@ -547,7 +547,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreWriteToFileByteLatency, prometheus.GaugeValue, - data.DataStoreWriteToFileByteLatency, + data.DataStoreWriteToFileByteLatency*1e-6, data.Name, ) @@ -568,7 +568,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreReadFromFileByteLatency, prometheus.GaugeValue, - data.DataStoreReadFromFileByteLatency, + data.DataStoreReadFromFileByteLatency*1e-6, data.Name, ) @@ -589,7 +589,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreWriteToStorageByteLatency, prometheus.GaugeValue, - data.DataStoreWriteToStorageByteLatency, + data.DataStoreWriteToStorageByteLatency*1e-6, data.Name, ) @@ -610,7 +610,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreReadFromStorageByteLatency, prometheus.GaugeValue, - data.DataStoreReadFromStorageByteLatency, + data.DataStoreReadFromStorageByteLatency*1e-6, data.Name, ) @@ -631,7 +631,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreCommitByteLatency, prometheus.GaugeValue, - data.DataStoreCommitByteLatency, + data.DataStoreCommitByteLatency*1e-6, data.Name, ) @@ -652,7 +652,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreCacheUpdateOperationLatency, prometheus.GaugeValue, - data.DataStoreCacheUpdateOperationLatency, + data.DataStoreCacheUpdateOperationLatency*1e-6, data.Name, ) @@ -666,7 +666,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreCommitOperationLatency, prometheus.GaugeValue, - data.DataStoreCommitOperationLatency, + data.DataStoreCommitOperationLatency*1e-6, data.Name, ) @@ -680,7 +680,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreCompactOperationLatency, prometheus.GaugeValue, - data.DataStoreCompactOperationLatency, + data.DataStoreCompactOperationLatency*1e-6, data.Name, ) @@ -694,7 +694,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreLoadFileOperationLatency, prometheus.GaugeValue, - data.DataStoreLoadFileOperationLatency, + data.DataStoreLoadFileOperationLatency*1e-6, data.Name, ) @@ -708,7 +708,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreRemoveOperationLatency, prometheus.GaugeValue, - data.DataStoreRemoveOperationLatency, + data.DataStoreRemoveOperationLatency*1e-6, data.Name, ) @@ -722,7 +722,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreQuerySizeOperationLatency, prometheus.GaugeValue, - data.DataStoreQuerySizeOperationLatency, + data.DataStoreQuerySizeOperationLatency*1e-6, data.Name, ) @@ -736,7 +736,7 @@ func (c *Collector) collectDataStore(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.dataStoreSetOperationLatencyMicro, prometheus.GaugeValue, - data.DataStoreSetOperationLatencyMicro, + data.DataStoreSetOperationLatencyMicro*1e-6, data.Name, ) diff --git a/internal/collector/hyperv/hyperv_host.go b/internal/collector/hyperv/hyperv_host.go index 613283d2..6a58f2a8 100644 --- a/internal/collector/hyperv/hyperv_host.go +++ b/internal/collector/hyperv/hyperv_host.go @@ -87,21 +87,21 @@ func (c *Collector) buildHost() error { } c.vmProcessorCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "vm_processor_count"), + prometheus.BuildFQName(types.Namespace, Name, "vm_processors"), "Number of virtual processors assigned to the VM", []string{"vm_id", "vm"}, nil, ) c.hostLogicalProcessorCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "host_logical_processor_count"), + prometheus.BuildFQName(types.Namespace, Name, "host_logical_processors"), "Number of logical processors on the host", nil, nil, ) c.totalVMProcessorCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "total_vm_processor_count"), + prometheus.BuildFQName(types.Namespace, Name, "assigned_vm_processors"), "Total number of virtual processors assigned to all VMs", nil, nil, diff --git a/internal/collector/hyperv/hyperv_hypervisor_logical_processor.go b/internal/collector/hyperv/hyperv_hypervisor_logical_processor.go index 2aaf3b70..c6fbb8ae 100644 --- a/internal/collector/hyperv/hyperv_hypervisor_logical_processor.go +++ b/internal/collector/hyperv/hyperv_hypervisor_logical_processor.go @@ -59,13 +59,13 @@ func (c *Collector) buildHypervisorLogicalProcessor() error { } c.hypervisorLogicalProcessorTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "hypervisor_logical_processor_time_total"), + prometheus.BuildFQName(types.Namespace, Name, "hypervisor_logical_processor_time_seconds_total"), "Time that processor spent in different modes (hypervisor, guest, idle)", []string{"core", "state"}, nil, ) c.hypervisorLogicalProcessorTotalRunTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "hypervisor_logical_processor_total_run_time_total"), + prometheus.BuildFQName(types.Namespace, Name, "hypervisor_logical_processor_total_run_time_seconds_total"), "Time that processor spent", []string{"core"}, nil, diff --git a/internal/collector/hyperv/hyperv_hypervisor_root_partition.go b/internal/collector/hyperv/hyperv_hypervisor_root_partition.go index b2cc5b16..16aaf9cc 100644 --- a/internal/collector/hyperv/hyperv_hypervisor_root_partition.go +++ b/internal/collector/hyperv/hyperv_hypervisor_root_partition.go @@ -174,37 +174,37 @@ func (c *Collector) buildHypervisorRootPartitionDescriptors() { nil, ) c.hypervisorRootPartition1GDevicePages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "root_partition_1G_device_pages"), + prometheus.BuildFQName(types.Namespace, Name, "root_partition_1g_device_pages"), "The number of 1G pages present in the device space of the partition", nil, nil, ) c.hypervisorRootPartition1GGPAPages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "root_partition_1G_gpa_pages"), + prometheus.BuildFQName(types.Namespace, Name, "root_partition_1g_gpa_pages"), "The number of 1G pages present in the GPA space of the partition", nil, nil, ) c.hypervisorRootPartition2MDevicePages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "root_partition_2M_device_pages"), + prometheus.BuildFQName(types.Namespace, Name, "root_partition_2m_device_pages"), "The number of 2M pages present in the device space of the partition", nil, nil, ) c.hypervisorRootPartition2MGPAPages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "root_partition_2M_gpa_pages"), + prometheus.BuildFQName(types.Namespace, Name, "root_partition_2m_gpa_pages"), "The number of 2M pages present in the GPA space of the partition", nil, nil, ) c.hypervisorRootPartition4KDevicePages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "root_partition_4K_device_pages"), + prometheus.BuildFQName(types.Namespace, Name, "root_partition_4k_device_pages"), "The number of 4K pages present in the device space of the partition", nil, nil, ) c.hypervisorRootPartition4KGPAPages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "root_partition_4K_gpa_pages"), + prometheus.BuildFQName(types.Namespace, Name, "root_partition_4k_gpa_pages"), "The number of 4K pages present in the GPA space of the partition", nil, nil, diff --git a/internal/collector/hyperv/hyperv_hypervisor_root_virtual_processor.go b/internal/collector/hyperv/hyperv_hypervisor_root_virtual_processor.go index de64628f..dd0cbd73 100644 --- a/internal/collector/hyperv/hyperv_hypervisor_root_virtual_processor.go +++ b/internal/collector/hyperv/hyperv_hypervisor_root_virtual_processor.go @@ -71,14 +71,14 @@ func (c *Collector) buildHypervisorRootVirtualProcessor() error { func (c *Collector) buildHypervisorRootVirtualProcessorDescriptors() { c.hypervisorRootVirtualProcessorTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "hypervisor_root_virtual_processor_time_total"), + prometheus.BuildFQName(types.Namespace, Name, "hypervisor_root_virtual_processor_time_seconds_total"), "Time in seconds that processor spent in different modes (guest_run, hypervisor, remote)", []string{"core", "state"}, nil, ) c.hypervisorRootVirtualProcessorTotalRunTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "hypervisor_root_virtual_processor_total_run_time_total"), + prometheus.BuildFQName(types.Namespace, Name, "hypervisor_root_virtual_processor_total_run_time_seconds_total"), "Time in seconds that processor spent running", []string{"core"}, nil, diff --git a/internal/collector/hyperv/hyperv_hypervisor_virtual_processor.go b/internal/collector/hyperv/hyperv_hypervisor_virtual_processor.go index fcefe48a..34aefd50 100644 --- a/internal/collector/hyperv/hyperv_hypervisor_virtual_processor.go +++ b/internal/collector/hyperv/hyperv_hypervisor_virtual_processor.go @@ -35,12 +35,10 @@ type collectorHypervisorVirtualProcessor struct { // \Hyper-V Hypervisor Virtual Processor(*)\% Guest Run Time // \Hyper-V Hypervisor Virtual Processor(*)\% Hypervisor Run Time // \Hyper-V Hypervisor Virtual Processor(*)\% Remote Run Time - hypervisorVirtualProcessorTimeTotal *prometheus.Desc - hypervisorVirtualProcessorModeTimeTotal *prometheus.Desc // New name for better clarity - hypervisorVirtualProcessorTotalRunTimeTotal *prometheus.Desc // \Hyper-V Hypervisor Virtual Processor(*)\% Total Run Time - hypervisorVirtualProcessorRunTimeTotal *prometheus.Desc // New name for better clarity - hypervisorVirtualProcessorCPUWaitSeconds *prometheus.Desc // \Hyper-V Hypervisor Virtual Processor(*)\CPU Wait Time Per Dispatch - hypervisorVirtualProcessorDispatches *prometheus.Desc // \Hyper-V Hypervisor Virtual Processor(*)\Logical Processor Dispatches/sec + hypervisorVirtualProcessorModeTimeTotal *prometheus.Desc + hypervisorVirtualProcessorRunTimeTotal *prometheus.Desc + hypervisorVirtualProcessorCPUWaitSeconds *prometheus.Desc // \Hyper-V Hypervisor Virtual Processor(*)\CPU Wait Time Per Dispatch + hypervisorVirtualProcessorDispatches *prometheus.Desc // \Hyper-V Hypervisor Virtual Processor(*)\Logical Processor Dispatches/sec } type perfDataCounterValuesHypervisorVirtualProcessor struct { @@ -72,34 +70,18 @@ func (c *Collector) buildHypervisorVirtualProcessor() error { } func (c *Collector) buildHypervisorVirtualProcessorDescriptors() { - c.hypervisorVirtualProcessorTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_time_total"), - "DEPRECATED: use hypervisor_virtual_processor_mode_time_total. Time in seconds that processor spent in different modes (hypervisor, guest, remote)", - []string{"vm", "core", "state"}, - nil, - ) - // New metric with better name for clarity, old one is kept for backward compatibility c.hypervisorVirtualProcessorModeTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_mode_time_total"), + prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_mode_time_seconds_total"), "Time in seconds that processor spent in different modes (hypervisor, guest, remote)", []string{"vm", "core", "state"}, nil, ) - // end same metric - c.hypervisorVirtualProcessorTotalRunTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_total_run_time_total"), - "DEPRECATED: use hypervisor_virtual_processor_run_time_total. Time in seconds that processor spent running", - []string{"vm", "core"}, - nil, - ) - // New metric with better name for clarity, old one is kept for backward compatibility c.hypervisorVirtualProcessorRunTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_run_time_total"), + prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_run_time_seconds_total"), "Time in seconds that processor spent running", []string{"vm", "core"}, nil, ) - // end same metric c.hypervisorVirtualProcessorCPUWaitSeconds = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_cpu_wait_seconds_total"), "The time spent waiting for a virtual processor to be dispatched onto a logical processor. "+ @@ -175,27 +157,6 @@ func (c *Collector) publishHypervisorVirtualProcessor(ch chan<- prometheus.Metri vmName := data.Name coreID := coreIDs[i] - ch <- scrape.MustNewConstMetric( - c.hypervisorVirtualProcessorTimeTotal, - prometheus.CounterValue, - data.HypervisorVirtualProcessorHypervisorRunTimePercent, - vmName, coreID, "hypervisor", - ) - - ch <- scrape.MustNewConstMetric( - c.hypervisorVirtualProcessorTimeTotal, - prometheus.CounterValue, - data.HypervisorVirtualProcessorGuestRunTimePercent, - vmName, coreID, "guest", - ) - - ch <- scrape.MustNewConstMetric( - c.hypervisorVirtualProcessorTimeTotal, - prometheus.CounterValue, - data.HypervisorVirtualProcessorRemoteRunTimePercent, - vmName, coreID, "remote", - ) - // Same metric with new name for better clarity, old one is kept for backward compatibility ch <- scrape.MustNewConstMetric( c.hypervisorVirtualProcessorModeTimeTotal, prometheus.CounterValue, @@ -216,21 +177,14 @@ func (c *Collector) publishHypervisorVirtualProcessor(ch chan<- prometheus.Metri data.HypervisorVirtualProcessorRemoteRunTimePercent, vmName, coreID, "remote", ) - // end same metric - ch <- scrape.MustNewConstMetric( - c.hypervisorVirtualProcessorTotalRunTimeTotal, - prometheus.CounterValue, - data.HypervisorVirtualProcessorTotalRunTimePercent, - vmName, coreID, - ) - // Same metric with new name for better clarity, old one is kept for backward compatibility + ch <- scrape.MustNewConstMetric( c.hypervisorVirtualProcessorRunTimeTotal, prometheus.CounterValue, data.HypervisorVirtualProcessorTotalRunTimePercent, vmName, coreID, ) - // end same metric + ch <- scrape.MustNewConstMetric( c.hypervisorVirtualProcessorCPUWaitSeconds, prometheus.CounterValue, diff --git a/internal/collector/hyperv/hyperv_test.go b/internal/collector/hyperv/hyperv_test.go index 5509bdb5..2565f841 100644 --- a/internal/collector/hyperv/hyperv_test.go +++ b/internal/collector/hyperv/hyperv_test.go @@ -38,7 +38,7 @@ func BenchmarkCollector(b *testing.B) { func TestCollector(t *testing.T) { metrics := testutils.TestCollector(t, hyperv.New, nil) testutils.RequireFixtureMetric(t, metrics, hyperv.Name, "windows_hyperv_dynamic_memory_vm_physical_bytes", prometheus.Labels{"vm": "GitHubActions"}) - testutils.RequireFixtureMetric(t, metrics, hyperv.Name, "windows_hyperv_vm_processor_count", prometheus.Labels{"vm": "GitHubActions"}) + testutils.RequireFixtureMetric(t, metrics, hyperv.Name, "windows_hyperv_vm_processors", prometheus.Labels{"vm": "GitHubActions"}) // An empty "Hyper-V DataStore" counter set is tolerated as an optional // instance group, so require a series explicitly (#2328). @@ -58,28 +58,33 @@ func TestCollector(t *testing.T) { } } -// TestCollectorVirtualStorageDeviceLatency checks that the deprecated latency gauges -// expose the raw cumulative value in 100ns ticks of the *_io_latency_seconds_total counters. +// TestCollectorVirtualStorageDeviceLatency checks that the latencies are published +// as counters in seconds for every device, and that the removed gauges, which +// exposed the same raw value in 100ns ticks, are gone. func TestCollectorVirtualStorageDeviceLatency(t *testing.T) { metrics := testutils.TestCollector(t, hyperv.New, &hyperv.Config{CollectorsEnabled: []string{"virtual_storage_device"}}) - for deprecated, replacement := range map[string]string{ - "windows_hyperv_virtual_storage_device_latency_seconds": "windows_hyperv_virtual_storage_device_io_latency_seconds_total", - "windows_hyperv_virtual_storage_device_lower_latency_seconds": "windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total", - } { - want := testutils.MetricValuesByLabel(metrics, deprecated, "device") - got := testutils.MetricValuesByLabel(metrics, replacement, "device") + devices := testutils.MetricValuesByLabel(metrics, "windows_hyperv_virtual_storage_device_throughput_total", "device") - require.Len(t, got, len(want)) + for _, name := range []string{ + "windows_hyperv_virtual_storage_device_io_latency_seconds_total", + "windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total", + } { + got := testutils.MetricValuesByLabel(metrics, name, "device") + require.Len(t, got, len(devices), name) if len(got) > 0 { - require.Equal(t, dto.MetricType_COUNTER, metrics[replacement].GetType()) + require.Equal(t, dto.MetricType_COUNTER, metrics[name].GetType()) } + } - for device, ticks := range want { - require.Contains(t, got, device) - require.InDelta(t, ticks*pdh.TicksToSecondScaleFactor, got[device], 1e-6, "%s{device=%q}", replacement, device) - } + for _, removed := range []string{ + "windows_hyperv_virtual_storage_device_latency_seconds", + "windows_hyperv_virtual_storage_device_lower_latency_seconds", + "windows_hyperv_virtual_storage_device_queue_length", + "windows_hyperv_virtual_storage_device_lower_queue_length", + } { + require.NotContains(t, metrics, removed) } } @@ -118,7 +123,7 @@ func TestCollectorVirtualHardDisk(t *testing.T) { if metric := testutils.RequireFixtureMetric(t, metrics, hyperv.Name, "windows_hyperv_virtual_hard_disk_size_bytes", labels); metric != nil { device := labelValue(metric, "device") require.NotEmpty(t, device, "the running VM's disk has no device") - require.Contains(t, testutils.MetricValuesByLabel(metrics, "windows_hyperv_virtual_storage_device_queue_length", "device"), device, + require.Contains(t, testutils.MetricValuesByLabel(metrics, "windows_hyperv_virtual_storage_device_throughput_total", "device"), device, "device %q is not a virtual_storage_device instance", device) } diff --git a/internal/collector/hyperv/hyperv_virtual_machine_health_summary.go b/internal/collector/hyperv/hyperv_virtual_machine_health_summary.go index 67ab1cb8..09248373 100644 --- a/internal/collector/hyperv/hyperv_virtual_machine_health_summary.go +++ b/internal/collector/hyperv/hyperv_virtual_machine_health_summary.go @@ -51,8 +51,8 @@ func (c *Collector) buildVirtualMachineHealthSummary() error { } c.health = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_machine_health_total_count"), - "Represents the number of virtual machines with critical health", + prometheus.BuildFQName(types.Namespace, Name, "virtual_machines"), + "Number of virtual machines by health state", []string{"state"}, nil, ) diff --git a/internal/collector/hyperv/hyperv_virtual_network_adapter_drop_reasons.go b/internal/collector/hyperv/hyperv_virtual_network_adapter_drop_reasons.go index d4ac129e..b80ab0cd 100644 --- a/internal/collector/hyperv/hyperv_virtual_network_adapter_drop_reasons.go +++ b/internal/collector/hyperv/hyperv_virtual_network_adapter_drop_reasons.go @@ -174,8 +174,8 @@ func (c *Collector) buildVirtualNetworkAdapterDropReasons() error { } c.virtualNetworkAdapterDropReasons = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_network_adapter_drop_reasons"), - "Hyper-V Virtual Network Adapter Drop Reasons", + prometheus.BuildFQName(types.Namespace, Name, "virtual_network_adapter_drop_reasons_total"), + "Number of packets dropped by a Hyper-V virtual network adapter, by drop reason and direction", []string{"adapter", "reason", "direction"}, nil, ) diff --git a/internal/collector/hyperv/hyperv_virtual_smb.go b/internal/collector/hyperv/hyperv_virtual_smb.go index 3148ed4e..adfb6ef3 100644 --- a/internal/collector/hyperv/hyperv_virtual_smb.go +++ b/internal/collector/hyperv/hyperv_virtual_smb.go @@ -93,56 +93,56 @@ func (c *Collector) buildVirtualSMB() error { nil, ) c.virtualSMBWriteBytesRDMA = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_write_bytes_rdma"), - "Represents the number of bytes written per second using RDMA in the virtual SMB", + 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"}, nil, ) c.virtualSMBWriteBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_write_bytes"), - "Represents the number of bytes written per second in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_write_bytes_total"), + "Represents the total number of bytes written in the virtual SMB", []string{"instance"}, nil, ) c.virtualSMBReadBytesRDMA = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_read_bytes_rdma"), - "Represents the number of bytes read per second using RDMA in the virtual SMB", + 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"}, nil, ) c.virtualSMBReadBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_read_bytes"), - "Represents the number of bytes read per second in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_read_bytes_total"), + "Represents the total number of bytes read in the virtual SMB", []string{"instance"}, nil, ) c.virtualSMBFlushRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_flush_requests"), - "Represents the number of flush requests per second in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_flush_requests_total"), + "Represents the total number of flush requests in the virtual SMB", []string{"instance"}, nil, ) c.virtualSMBWriteRequestsRDMA = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_write_requests_rdma"), - "Represents the number of write requests per second using RDMA in the virtual SMB", + 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"}, nil, ) c.virtualSMBWriteRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_write_requests"), - "Represents the number of write requests per second in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_write_requests_total"), + "Represents the total number of write requests in the virtual SMB", []string{"instance"}, nil, ) c.virtualSMBReadRequestsRDMA = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_read_requests_rdma"), - "Represents the number of read requests per second using RDMA in the virtual SMB", + 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"}, nil, ) c.virtualSMBReadRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_read_requests"), - "Represents the number of read requests per second in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_read_requests_total"), + "Represents the total number of read requests in the virtual SMB", []string{"instance"}, nil, ) @@ -153,32 +153,32 @@ func (c *Collector) buildVirtualSMB() error { nil, ) c.virtualSMBCurrentOpenFileCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_current_open_file_count"), + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_open_files"), "Represents the current number of open files in the virtual SMB", []string{"instance"}, nil, ) c.virtualSMBTreeConnectCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_tree_connect_count"), - "Represents the number of tree connects in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_tree_connects_total"), + "Represents the total number of tree connects in the virtual SMB", []string{"instance"}, nil, ) c.virtualSMBRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_requests"), - "Represents the number of requests per second in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_requests_total"), + "Represents the total number of requests in the virtual SMB", []string{"instance"}, nil, ) c.virtualSMBSentBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_sent_bytes"), - "Represents the number of bytes sent per second in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_sent_bytes_total"), + "Represents the total number of bytes sent in the virtual SMB", []string{"instance"}, nil, ) c.virtualSMBReceivedBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_received_bytes"), - "Represents the number of bytes received per second in the virtual SMB", + prometheus.BuildFQName(types.Namespace, Name, "virtual_smb_received_bytes_total"), + "Represents the total number of bytes received in the virtual SMB", []string{"instance"}, nil, ) @@ -286,7 +286,7 @@ func (c *Collector) collectVirtualSMB(ch chan<- prometheus.Metric, scrape *label ch <- scrape.MustNewConstMetric( c.virtualSMBTreeConnectCount, - prometheus.GaugeValue, + prometheus.CounterValue, data.VirtualSMBTreeConnectCount, data.Name, ) diff --git a/internal/collector/hyperv/hyperv_virtual_storage_device.go b/internal/collector/hyperv/hyperv_virtual_storage_device.go index 9248ec0f..8ddba046 100644 --- a/internal/collector/hyperv/hyperv_virtual_storage_device.go +++ b/internal/collector/hyperv/hyperv_virtual_storage_device.go @@ -32,16 +32,12 @@ type collectorVirtualStorageDevice struct { perfDataObjectVirtualStorageDevice []perfDataCounterValuesVirtualStorageDevice virtualStorageDeviceErrorCount *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Error Count - virtualStorageDeviceQueueLength *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Queue Length virtualStorageDeviceReadBytes *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Read Bytes/sec virtualStorageDeviceReadOperations *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Read Operations/Sec virtualStorageDeviceWriteBytes *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Write Bytes/sec virtualStorageDeviceWriteOperations *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Write Operations/Sec - virtualStorageDeviceLatency *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Latency virtualStorageDeviceThroughput *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Throughput virtualStorageDeviceNormalizedThroughput *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Normalized Throughput - virtualStorageDeviceLowerQueueLength *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Lower Queue Length - virtualStorageDeviceLowerLatency *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Lower Latency virtualStorageDeviceIOQuotaReplenishmentRate *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\IO Quota Replenishment Rate virtualStorageDeviceIOLatency *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Latency virtualStorageDeviceLowerIOLatency *prometheus.Desc // \Hyper-V Virtual Storage Device(*)\Lower Latency @@ -51,7 +47,6 @@ type perfDataCounterValuesVirtualStorageDevice struct { Name string VirtualStorageDeviceErrorCount float64 `perfdata:"Error Count"` - VirtualStorageDeviceQueueLength float64 `perfdata:"Queue Length"` VirtualStorageDeviceReadBytes float64 `perfdata:"Read Bytes/sec"` VirtualStorageDeviceReadOperations float64 `perfdata:"Read Count"` VirtualStorageDeviceWriteBytes float64 `perfdata:"Write Bytes/sec"` @@ -59,7 +54,6 @@ type perfDataCounterValuesVirtualStorageDevice struct { VirtualStorageDeviceLatency float64 `perfdata:"Latency"` VirtualStorageDeviceThroughput float64 `perfdata:"Throughput"` VirtualStorageDeviceNormalizedThroughput float64 `perfdata:"Normalized Throughput"` - VirtualStorageDeviceLowerQueueLength float64 `perfdata:"Lower Queue Length"` VirtualStorageDeviceLowerLatency float64 `perfdata:"Lower Latency"` VirtualStorageDeviceIOQuotaReplenishmentRate float64 `perfdata:"IO Quota Replenishment Rate"` } @@ -79,20 +73,13 @@ func (c *Collector) buildVirtualStorageDevice() error { func (c *Collector) buildVirtualStorageDeviceDescriptors() { c.virtualStorageDeviceErrorCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_error_count_total"), + prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_errors_total"), "Represents the total number of errors that have occurred on this virtual device.", []string{"device"}, nil, ) - c.virtualStorageDeviceQueueLength = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_queue_length"), - "DEPRECATED: use rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total). "+ - "Cumulative queue length in 100ns ticks, identical to the raw latency.", - []string{"device"}, - nil, - ) c.virtualStorageDeviceReadBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_bytes_read"), + prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_read_bytes_total"), "Represents the total number of bytes that have been read on this virtual device.", []string{"device"}, nil, @@ -104,7 +91,7 @@ func (c *Collector) buildVirtualStorageDeviceDescriptors() { nil, ) c.virtualStorageDeviceWriteBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_bytes_written"), + prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_written_bytes_total"), "Represents the total number of bytes that have been written on this virtual device.", []string{"device"}, nil, @@ -115,13 +102,6 @@ func (c *Collector) buildVirtualStorageDeviceDescriptors() { []string{"device"}, nil, ) - c.virtualStorageDeviceLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_latency_seconds"), - "DEPRECATED: use windows_hyperv_virtual_storage_device_io_latency_seconds_total. "+ - "Cumulative IO transfer latency in 100ns ticks for this virtual device.", - []string{"device"}, - nil, - ) c.virtualStorageDeviceThroughput = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_throughput_total"), "Represents the total number of IO transfers completed by this virtual device.", @@ -134,20 +114,6 @@ func (c *Collector) buildVirtualStorageDeviceDescriptors() { []string{"device"}, nil, ) - c.virtualStorageDeviceLowerQueueLength = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_lower_queue_length"), - "DEPRECATED: use rate(windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total). "+ - "Cumulative queue length in 100ns ticks on the underlying storage subsystem, identical to the raw lower latency.", - []string{"device"}, - nil, - ) - c.virtualStorageDeviceLowerLatency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_lower_latency_seconds"), - "DEPRECATED: use windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total. "+ - "Cumulative IO transfer latency in 100ns ticks on the underlying storage subsystem for this virtual device.", - []string{"device"}, - nil, - ) c.virtualStorageDeviceIOLatency = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_io_latency_seconds_total"), "Represents the total IO transfer latency for this virtual device. "+ @@ -190,13 +156,6 @@ func (c *Collector) publishVirtualStorageDevice(ch chan<- prometheus.Metric, scr data.Name, ) - ch <- scrape.MustNewConstMetric( - c.virtualStorageDeviceQueueLength, - prometheus.GaugeValue, - data.VirtualStorageDeviceQueueLength, - data.Name, - ) - ch <- scrape.MustNewConstMetric( c.virtualStorageDeviceReadBytes, prometheus.CounterValue, @@ -225,13 +184,6 @@ func (c *Collector) publishVirtualStorageDevice(ch chan<- prometheus.Metric, scr data.Name, ) - ch <- scrape.MustNewConstMetric( - c.virtualStorageDeviceLatency, - prometheus.GaugeValue, - data.VirtualStorageDeviceLatency, - data.Name, - ) - ch <- scrape.MustNewConstMetric( c.virtualStorageDeviceThroughput, prometheus.CounterValue, @@ -246,20 +198,6 @@ func (c *Collector) publishVirtualStorageDevice(ch chan<- prometheus.Metric, scr data.Name, ) - ch <- scrape.MustNewConstMetric( - c.virtualStorageDeviceLowerQueueLength, - prometheus.GaugeValue, - data.VirtualStorageDeviceLowerQueueLength, - data.Name, - ) - - ch <- scrape.MustNewConstMetric( - c.virtualStorageDeviceLowerLatency, - prometheus.GaugeValue, - data.VirtualStorageDeviceLowerLatency, - data.Name, - ) - ch <- scrape.MustNewConstMetric( c.virtualStorageDeviceIOQuotaReplenishmentRate, prometheus.CounterValue, diff --git a/internal/collector/iis/iis_app_pool_was.go b/internal/collector/iis/iis_app_pool_was.go index 79817d4f..7755509e 100644 --- a/internal/collector/iis/iis_app_pool_was.go +++ b/internal/collector/iis/iis_app_pool_was.go @@ -130,7 +130,7 @@ func (c *Collector) buildAppPoolWASDescriptors() { nil, ) c.totalApplicationPoolRecycles = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "total_application_pool_recycles"), + prometheus.BuildFQName(types.Namespace, Name, "application_pool_recycles_total"), "The number of times that the application pool has been recycled since Windows Process Activation Service (WAS) started (TotalApplicationPoolRecycles)", []string{"app"}, nil, @@ -142,31 +142,31 @@ func (c *Collector) buildAppPoolWASDescriptors() { nil, ) c.totalWorkerProcessesCreated = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "total_worker_processes_created"), + prometheus.BuildFQName(types.Namespace, Name, "worker_processes_created_total"), "The number of worker processes created for the application pool since Windows Process Activation Service (WAS) started (TotalWorkerProcessesCreated)", []string{"app"}, nil, ) c.totalWorkerProcessFailures = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "total_worker_process_failures"), + prometheus.BuildFQName(types.Namespace, Name, "worker_process_failures_total"), "The number of times that worker processes have crashed since the application pool was started (TotalWorkerProcessFailures)", []string{"app"}, nil, ) c.totalWorkerProcessPingFailures = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "total_worker_process_ping_failures"), + prometheus.BuildFQName(types.Namespace, Name, "worker_process_ping_failures_total"), "The number of times that Windows Process Activation Service (WAS) did not receive a response to ping messages sent to a worker process (TotalWorkerProcessPingFailures)", []string{"app"}, nil, ) c.totalWorkerProcessShutdownFailures = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "total_worker_process_shutdown_failures"), + prometheus.BuildFQName(types.Namespace, Name, "worker_process_shutdown_failures_total"), "The number of times that Windows Process Activation Service (WAS) failed to shut down a worker process (TotalWorkerProcessShutdownFailures)", []string{"app"}, nil, ) c.totalWorkerProcessStartupFailures = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "total_worker_process_startup_failures"), + prometheus.BuildFQName(types.Namespace, Name, "worker_process_startup_failures_total"), "The number of times that Windows Process Activation Service (WAS) failed to start a worker process (TotalWorkerProcessStartupFailures)", []string{"app"}, nil, diff --git a/internal/collector/iis/iis_w3svc_w3wp.go b/internal/collector/iis/iis_w3svc_w3wp.go index 2408f3cf..4176a526 100644 --- a/internal/collector/iis/iis_w3svc_w3wp.go +++ b/internal/collector/iis/iis_w3svc_w3wp.go @@ -573,7 +573,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error { ch <- prometheus.MustNewConstMetric( c.w3SVCW3WPMaximumFileCacheMemoryUsage, - prometheus.CounterValue, + prometheus.GaugeValue, data.W3SVCW3WPMaximumFileCacheMemoryUsage, name, pid, diff --git a/internal/collector/iis/iis_web_service.go b/internal/collector/iis/iis_web_service.go index 4f828289..9c9f86ad 100644 --- a/internal/collector/iis/iis_web_service.go +++ b/internal/collector/iis/iis_web_service.go @@ -144,7 +144,7 @@ func (c *Collector) buildWebService() error { nil, ) c.webServiceServiceUptime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "service_uptime"), + prometheus.BuildFQName(types.Namespace, Name, "service_uptime_seconds"), "Number of seconds the WebService is up (WebService.ServiceUptime)", []string{"site"}, nil, @@ -204,7 +204,7 @@ func (c *Collector) buildWebService() error { nil, ) c.webServiceTotalISAPIExtensionRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "ipapi_extension_requests_total"), + prometheus.BuildFQName(types.Namespace, Name, "isapi_extension_requests_total"), "ISAPI Extension Requests received (WebService.TotalISAPIExtensionRequests)", []string{"site"}, nil, diff --git a/internal/collector/iis/iis_web_service_cache.go b/internal/collector/iis/iis_web_service_cache.go index c9f9a265..0eb1431b 100644 --- a/internal/collector/iis/iis_web_service_cache.go +++ b/internal/collector/iis/iis_web_service_cache.go @@ -307,7 +307,7 @@ func (c *Collector) collectWebServiceCache(ch chan<- prometheus.Metric) error { ch <- prometheus.MustNewConstMetric( c.serviceCacheMaximumFileCacheMemoryUsage, - prometheus.CounterValue, + prometheus.GaugeValue, data.ServiceCacheMaximumFileCacheMemoryUsage, ) diff --git a/internal/collector/iis/metric_types_test.go b/internal/collector/iis/metric_types_test.go index 1ad1415b..0682d499 100644 --- a/internal/collector/iis/metric_types_test.go +++ b/internal/collector/iis/metric_types_test.go @@ -121,7 +121,7 @@ func TestAppPoolWASUptimeMetrics(t *testing.T) { requireMetric(t, metrics, "windows_iis_current_application_pool_uptime_seconds", dto.MetricType_GAUGE, 298, app) requireMetric(t, metrics, "windows_iis_total_application_pool_uptime_seconds", dto.MetricType_GAUGE, 600, app) requireMetric(t, metrics, "windows_iis_time_since_last_worker_process_failure_seconds", dto.MetricType_GAUGE, 298, app) - requireMetric(t, metrics, "windows_iis_total_application_pool_recycles", dto.MetricType_COUNTER, 2, app) + requireMetric(t, metrics, "windows_iis_application_pool_recycles_total", dto.MetricType_COUNTER, 2, app) require.NotContains(t, metrics, "windows_iis_current_application_pool_start_time") require.NotContains(t, metrics, "windows_iis_total_application_pool_start_time") } diff --git a/internal/collector/mscluster/AGENTS.md b/internal/collector/mscluster/AGENTS.md index f0c02b56..8e801513 100644 --- a/internal/collector/mscluster/AGENTS.md +++ b/internal/collector/mscluster/AGENTS.md @@ -62,3 +62,13 @@ build-dependent rules of `objectField`), owner node and node names. Objects with missing fields are not cached, so they report the same errors on every scrape. Shared volume sizes change constantly and are not cached. +- Many cluster, group and resource properties are durations or sizes in + milliseconds, minutes, hours, KiB or MiB (for example + `ClusSvcRegroupTickInMilliseconds`, `ShutdownTimeoutInMinutes`, + `FailoverPeriod` in hours, `S2DCachePageSizeKBytes`, `ClusterLogSize` in + MiB). Publish them in base units with a unit suffix: set `objectField.scale` + for cluster and group fields and `fieldScales` for resources. The parity + tests feed WMI values through the same scale, so they cannot catch a wrong + factor; check units against a live cluster (`Get-Cluster | Format-List *`). + The WMI help texts are not reliable: `QuarantineDuration` is seconds + (default 7200), not milliseconds. diff --git a/internal/collector/mscluster/mscluster_cluster.go b/internal/collector/mscluster/mscluster_cluster.go index a0fd3346..7468645b 100644 --- a/internal/collector/mscluster/mscluster_cluster.go +++ b/internal/collector/mscluster/mscluster_cluster.go @@ -92,12 +92,10 @@ type collectorCluster struct { clusterQuarantineThreshold *prometheus.Desc clusterQuorumArbitrationTimeMax *prometheus.Desc clusterQuorumArbitrationTimeMin *prometheus.Desc - clusterQuorumLogFileSize *prometheus.Desc clusterQuorumTypeValue *prometheus.Desc clusterRequestReplyTimeout *prometheus.Desc clusterResiliencyDefaultPeriod *prometheus.Desc clusterResiliencyLevel *prometheus.Desc - clusterResourceDllDeadlockPeriod *prometheus.Desc clusterRootMemoryReserved *prometheus.Desc clusterRouteHistoryLength *prometheus.Desc clusterS2DBusTypes *prometheus.Desc @@ -177,12 +175,10 @@ type msClusterCluster struct { QuarantineThreshold uint `mi:"QuarantineThreshold"` QuorumArbitrationTimeMax uint `mi:"QuorumArbitrationTimeMax"` QuorumArbitrationTimeMin uint `mi:"QuorumArbitrationTimeMin"` - QuorumLogFileSize uint `mi:"QuorumLogFileSize"` QuorumTypeValue uint `mi:"QuorumTypeValue"` RequestReplyTimeout uint `mi:"RequestReplyTimeout"` ResiliencyDefaultPeriod uint `mi:"ResiliencyDefaultPeriod"` ResiliencyLevel uint `mi:"ResiliencyLevel"` - ResourceDllDeadlockPeriod uint `mi:"ResourceDllDeadlockPeriod"` RootMemoryReserved uint `mi:"RootMemoryReserved"` RouteHistoryLength uint `mi:"RouteHistoryLength"` S2DBusTypes uint `mi:"S2DBusTypes"` @@ -218,8 +214,8 @@ func (c *Collector) buildCluster() error { func (c *Collector) buildClusterDescriptors() { c.clusterAddEvictDelay = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "add_evict_delay"), - "Provides access to the cluster's AddEvictDelay property, which is the number a seconds that a new node is delayed after an eviction of another node.", + 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"}, nil, ) @@ -254,38 +250,38 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterBlockCacheSize = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "block_cache_size"), - "CSV BlockCache Size in MB.", + prometheus.BuildFQName(types.Namespace, nameCluster, "block_cache_size_bytes"), + "CSV BlockCache size in bytes.", []string{"name"}, nil, ) c.clusterClusSvcHangTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_hang_timeout"), - "Controls how long the cluster network driver waits between Failover Cluster Service heartbeats before it determines that the Failover Cluster Service has stopped responding.", + 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"}, nil, ) c.clusterClusSvcRegroupOpeningTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_regroup_opening_timeout"), - "Controls how long a node will wait on other nodes in the opening stage before deciding that they failed.", + 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"}, nil, ) c.clusterClusSvcRegroupPruningTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_regroup_pruning_timeout"), - "Controls how long the membership leader will wait to reach full connectivity between cluster nodes.", + 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"}, nil, ) c.clusterClusSvcRegroupStageTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_regroup_stage_timeout"), - "Controls how long a node will wait on other nodes in a membership stage before deciding that they failed.", + 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"}, nil, ) c.clusterClusSvcRegroupTickInMilliseconds = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "clus_svc_regroup_tick_in_milliseconds"), - "Controls how frequently the membership algorithm is sending periodic membership messages.", + 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"}, nil, ) @@ -302,7 +298,7 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterClusterGroupWaitDelay = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "cluster_group_wait_delay"), + 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"}, nil, @@ -314,8 +310,8 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterClusterLogSize = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "cluster_log_size"), - "Controls the maximum size of the cluster log files on each of the nodes.", + 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"}, nil, ) @@ -326,8 +322,8 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterCrossSiteDelay = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "cross_site_delay"), - "Controls how long the cluster network driver waits in milliseconds between sending Cluster Service heartbeats across sites.", + 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"}, nil, ) @@ -338,8 +334,8 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterCrossSubnetDelay = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "cross_subnet_delay"), - "Controls how long the cluster network driver waits in milliseconds between sending Cluster Service heartbeats across subnets.", + 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"}, nil, ) @@ -422,14 +418,14 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterGracePeriodTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "grace_period_timeout"), - "The grace period timeout in milliseconds.", + prometheus.BuildFQName(types.Namespace, nameCluster, "grace_period_timeout_seconds"), + "The grace period timeout in seconds.", []string{"name"}, nil, ) c.clusterGroupDependencyTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "group_dependency_timeout"), - "The timeout after which a group will be brought online despite unsatisfied dependencies", + 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"}, nil, ) @@ -506,8 +502,8 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterQuarantineDuration = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "quarantine_duration"), - "The quarantine period timeout in milliseconds.", + prometheus.BuildFQName(types.Namespace, nameCluster, "quarantine_duration_seconds"), + "The quarantine period timeout in seconds.", []string{"name"}, nil, ) @@ -518,20 +514,14 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterQuorumArbitrationTimeMax = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "quorum_arbitration_time_max"), - "Controls the maximum time necessary to decide the Quorum owner node.", + 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"}, nil, ) c.clusterQuorumArbitrationTimeMin = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "quorum_arbitration_time_min"), - "Controls the minimum time necessary to decide the Quorum owner node.", - []string{"name"}, - nil, - ) - c.clusterQuorumLogFileSize = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "quorum_log_file_size"), - "This property is obsolete.", + 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"}, nil, ) @@ -542,13 +532,13 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterRequestReplyTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "request_reply_timeout"), - "Controls the request reply time-out period.", + prometheus.BuildFQName(types.Namespace, nameCluster, "request_reply_timeout_seconds"), + "Controls the request reply time-out period in seconds.", []string{"name"}, nil, ) c.clusterResiliencyDefaultPeriod = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "resiliency_default_period"), + prometheus.BuildFQName(types.Namespace, nameCluster, "resiliency_default_period_seconds"), "The default resiliency period, in seconds, for the cluster.", []string{"name"}, nil, @@ -559,15 +549,9 @@ func (c *Collector) buildClusterDescriptors() { []string{"name"}, nil, ) - c.clusterResourceDllDeadlockPeriod = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "resource_dll_deadlock_period"), - "This property is obsolete.", - []string{"name"}, - nil, - ) c.clusterRootMemoryReserved = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "root_memory_reserved"), - "Controls the amount of memory reserved for the parent partition on all cluster nodes.", + 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"}, nil, ) @@ -590,14 +574,14 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterS2DCacheFlashReservePercent = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_cache_flash_reserve_percent"), - "Percentage of allocated flash space to utilize when caching.", + prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_cache_flash_reserve_ratio"), + "Ratio (0-1) of allocated flash space to utilize when caching.", []string{"name"}, nil, ) c.clusterS2DCachePageSizeKBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_cache_page_size_k_bytes"), - "Page size in KB used by S2D cache.", + prometheus.BuildFQName(types.Namespace, nameCluster, "s2d_cache_page_size_bytes"), + "Page size in bytes used by S2D cache.", []string{"name"}, nil, ) @@ -608,8 +592,8 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterS2DIOLatencyThreshold = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "s2dio_latency_threshold"), - "The I/O latency threshold for storage spaces direct.", + prometheus.BuildFQName(types.Namespace, nameCluster, "s2dio_latency_threshold_seconds"), + "The I/O latency threshold in seconds for storage spaces direct.", []string{"name"}, nil, ) @@ -620,8 +604,8 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterSameSubnetDelay = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "same_subnet_delay"), - "Controls how long the cluster network driver waits in milliseconds between sending Cluster Service heartbeats on the same subnet.", + 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"}, nil, ) @@ -644,14 +628,14 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterSharedVolumeVssWriterOperationTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "shared_volume_vss_writer_operation_timeout"), + prometheus.BuildFQName(types.Namespace, nameCluster, "shared_volume_vss_writer_operation_timeout_seconds"), "CSV VSS Writer operation timeout in seconds.", []string{"name"}, nil, ) c.clusterShutdownTimeoutInMinutes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "shutdown_timeout_in_minutes"), - "The maximum time in minutes allowed for cluster resources to come offline during cluster service shutdown.", + 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"}, nil, ) @@ -662,7 +646,7 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterWitnessDatabaseWriteTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "witness_database_write_timeout"), + 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"}, nil, @@ -674,8 +658,8 @@ func (c *Collector) buildClusterDescriptors() { nil, ) c.clusterWitnessRestartInterval = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameCluster, "witness_restart_interval"), - "Controls the witness restart interval.", + prometheus.BuildFQName(types.Namespace, nameCluster, "witness_restart_interval_seconds"), + "Controls the witness restart interval in seconds.", []string{"name"}, nil, ) @@ -716,21 +700,21 @@ func (c *Collector) publishCluster(ch chan<- prometheus.Metric, cluster clusapi. {name: "AutoBalancerLevel", desc: c.clusterAutoBalancerLevel, minBuild: ws2016}, {name: "AutoBalancerMode", desc: c.clusterAutoBalancerMode, minBuild: ws2016}, {name: "BackupInProgress", desc: c.clusterBackupInProgress}, - {name: "BlockCacheSize", desc: c.clusterBlockCacheSize}, + {name: "BlockCacheSize", desc: c.clusterBlockCacheSize, scale: 1 << 20}, {name: "ClusSvcHangTimeout", desc: c.clusterClusSvcHangTimeout}, {name: "ClusSvcRegroupOpeningTimeout", desc: c.clusterClusSvcRegroupOpeningTimeout, absent: zero}, {name: "ClusSvcRegroupPruningTimeout", desc: c.clusterClusSvcRegroupPruningTimeout, absent: zero}, {name: "ClusSvcRegroupStageTimeout", desc: c.clusterClusSvcRegroupStageTimeout}, - {name: "ClusSvcRegroupTickInMilliseconds", desc: c.clusterClusSvcRegroupTickInMilliseconds}, + {name: "ClusSvcRegroupTickInMilliseconds", desc: c.clusterClusSvcRegroupTickInMilliseconds, scale: 1e-3}, {name: "ClusterEnforcedAntiAffinity", desc: c.clusterClusterEnforcedAntiAffinity}, {name: "ClusterFunctionalLevel", desc: c.clusterClusterFunctionalLevel, minBuild: ws2016}, {name: "ClusterGroupWaitDelay", desc: c.clusterClusterGroupWaitDelay}, {name: "ClusterLogLevel", desc: c.clusterClusterLogLevel}, - {name: "ClusterLogSize", desc: c.clusterClusterLogSize}, + {name: "ClusterLogSize", desc: c.clusterClusterLogSize, scale: 1 << 20}, {name: "ClusterUpgradeVersion", desc: c.clusterClusterUpgradeVersion, minBuild: ws2016}, - {name: "CrossSiteDelay", desc: c.clusterCrossSiteDelay, minBuild: ws2016}, + {name: "CrossSiteDelay", desc: c.clusterCrossSiteDelay, scale: 1e-3, minBuild: ws2016}, {name: "CrossSiteThreshold", desc: c.clusterCrossSiteThreshold, minBuild: ws2016}, - {name: "CrossSubnetDelay", desc: c.clusterCrossSubnetDelay}, + {name: "CrossSubnetDelay", desc: c.clusterCrossSubnetDelay, scale: 1e-3}, {name: "CrossSubnetThreshold", desc: c.clusterCrossSubnetThreshold}, {name: "CsvBalancer", desc: c.clusterCsvBalancer}, {name: "DatabaseReadWriteMode", desc: c.clusterDatabaseReadWriteMode}, @@ -741,7 +725,7 @@ func (c *Collector) publishCluster(ch chan<- prometheus.Metric, cluster clusapi. {name: "EnableSharedVolumes", desc: c.clusterEnableSharedVolumes}, {name: "FixQuorum", desc: c.clusterFixQuorum}, {name: "GracePeriodEnabled", desc: c.clusterGracePeriodEnabled, minBuild: ws2016, absent: zero}, - {name: "GracePeriodTimeout", desc: c.clusterGracePeriodTimeout, minBuild: ws2016, absent: zero}, + {name: "GracePeriodTimeout", desc: c.clusterGracePeriodTimeout, scale: 1e-3, minBuild: ws2016, absent: zero}, {name: "GroupDependencyTimeout", desc: c.clusterGroupDependencyTimeout, minBuild: ws2016}, {name: "HangRecoveryAction", desc: c.clusterHangRecoveryAction}, {name: "IgnorePersistentStateOnStartup", desc: c.clusterIgnorePersistentStateOnStartup}, @@ -758,26 +742,24 @@ func (c *Collector) publishCluster(ch chan<- prometheus.Metric, cluster clusapi. {name: "QuarantineThreshold", desc: c.clusterQuarantineThreshold, minBuild: ws2016}, {name: "QuorumArbitrationTimeMax", desc: c.clusterQuorumArbitrationTimeMax}, {name: "QuorumArbitrationTimeMin", desc: c.clusterQuorumArbitrationTimeMin, absent: zero}, - {name: "QuorumLogFileSize", desc: c.clusterQuorumLogFileSize}, {name: "QuorumTypeValue", desc: c.clusterQuorumTypeValue}, {name: "RequestReplyTimeout", desc: c.clusterRequestReplyTimeout}, {name: "ResiliencyDefaultPeriod", desc: c.clusterResiliencyDefaultPeriod, minBuild: ws2016}, {name: "ResiliencyLevel", desc: c.clusterResiliencyLevel, minBuild: ws2016}, - {name: "ResourceDllDeadlockPeriod", desc: c.clusterResourceDllDeadlockPeriod, absent: zero}, - {name: "RootMemoryReserved", desc: c.clusterRootMemoryReserved, absent: zero}, + {name: "RootMemoryReserved", desc: c.clusterRootMemoryReserved, scale: 1 << 20, absent: zero}, {name: "RouteHistoryLength", desc: c.clusterRouteHistoryLength}, {name: "S2DBusTypes", desc: c.clusterS2DBusTypes, minBuild: ws2016}, {name: "S2DCacheDesiredState", desc: c.clusterS2DCacheDesiredState, minBuild: ws2016}, - {name: "S2DCacheFlashReservePercent", desc: c.clusterS2DCacheFlashReservePercent, minBuild: ws2016}, - {name: "S2DCachePageSizeKBytes", desc: c.clusterS2DCachePageSizeKBytes, minBuild: ws2016}, + {name: "S2DCacheFlashReservePercent", desc: c.clusterS2DCacheFlashReservePercent, scale: 1e-2, minBuild: ws2016}, + {name: "S2DCachePageSizeKBytes", desc: c.clusterS2DCachePageSizeKBytes, scale: 1 << 10, minBuild: ws2016}, {name: "S2DEnabled", desc: c.clusterS2DEnabled, minBuild: ws2016}, - {name: "S2DIOLatencyThreshold", desc: c.clusterS2DIOLatencyThreshold, minBuild: ws2016}, + {name: "S2DIOLatencyThreshold", desc: c.clusterS2DIOLatencyThreshold, scale: 1e-3, minBuild: ws2016}, {name: "S2DOptimizations", desc: c.clusterS2DOptimizations, minBuild: ws2016}, - {name: "SameSubnetDelay", desc: c.clusterSameSubnetDelay}, + {name: "SameSubnetDelay", desc: c.clusterSameSubnetDelay, scale: 1e-3}, {name: "SameSubnetThreshold", desc: c.clusterSameSubnetThreshold}, {name: "SecurityLevel", desc: c.clusterSecurityLevel}, {name: "SharedVolumeVssWriterOperationTimeout", desc: c.clusterSharedVolumeVssWriterOperationTimeout}, - {name: "ShutdownTimeoutInMinutes", desc: c.clusterShutdownTimeoutInMinutes}, + {name: "ShutdownTimeoutInMinutes", desc: c.clusterShutdownTimeoutInMinutes, scale: 60}, {name: "UseClientAccessNetworksForSharedVolumes", desc: c.clusterUseClientAccessNetworksForSharedVolumes}, {name: "WitnessDatabaseWriteTimeout", desc: c.clusterWitnessDatabaseWriteTimeout}, {name: "WitnessDynamicWeight", desc: c.clusterWitnessDynamicWeight}, diff --git a/internal/collector/mscluster/mscluster_cluster_native_test.go b/internal/collector/mscluster/mscluster_cluster_native_test.go index d4053090..0e76b44c 100644 --- a/internal/collector/mscluster/mscluster_cluster_native_test.go +++ b/internal/collector/mscluster/mscluster_cluster_native_test.go @@ -21,6 +21,7 @@ import ( "errors" "log/slog" "maps" + "math" "reflect" "strings" "testing" @@ -115,18 +116,26 @@ func TestClusterNativeMetricContract(t *testing.T) { } } - for metric, property := range map[string]string{ - "add_evict_delay": "AddEvictDelay", - "s2dio_latency_threshold": "S2DIOLatencyThreshold", - "s2d_cache_page_size_k_bytes": "S2DCachePageSizeKBytes", - "netft_ip_sec_enabled": "NetftIPSecEnabled", - "detected_cloud_platform": "DetectedCloudPlatform", - "lower_quorum_priority_node_id": "LowerQuorumPriorityNodeId", - "detect_managed_events_threshold": "DetectManagedEventsThreshold", - "quorum_type_value": "QuorumTypeValue", + // Scale converts the raw property to the base unit of the metric. + for metric, field := range map[string]struct { + property string + scale float64 + }{ + "add_evict_delay_seconds": {"AddEvictDelay", 1}, + "s2dio_latency_threshold_seconds": {"S2DIOLatencyThreshold", 1e-3}, + "s2d_cache_page_size_bytes": {"S2DCachePageSizeKBytes", 1024}, + "s2d_cache_flash_reserve_ratio": {"S2DCacheFlashReservePercent", 1e-2}, + "clus_svc_regroup_tick_seconds": {"ClusSvcRegroupTickInMilliseconds", 1e-3}, + "shutdown_timeout_seconds": {"ShutdownTimeoutInMinutes", 60}, + "cluster_log_size_bytes": {"ClusterLogSize", 1 << 20}, + "netft_ip_sec_enabled": {"NetftIPSecEnabled", 1}, + "detected_cloud_platform": {"DetectedCloudPlatform", 1}, + "lower_quorum_priority_node_id": {"LowerQuorumPriorityNodeId", 1}, + "detect_managed_events_threshold": {"DetectManagedEventsThreshold", 1}, + "quorum_type_value": {"QuorumTypeValue", 1}, } { got := families["windows_mscluster_cluster_"+metric].GetMetric()[0].GetGauge().GetValue() - if want := float64(cluster.Values[property]); got != want { + if want := float64(cluster.Values[field.property]) * field.scale; math.Abs(got-want) > 1e-9*math.Max(1, math.Abs(want)) { t.Errorf("%s = %v, want %v", metric, got, want) } } @@ -167,7 +176,7 @@ func TestClusterWMISynthesizedValues(t *testing.T) { cluster := clusterFixture() synthesized := map[string]float64{ "ClusSvcRegroupOpeningTimeout": 0, "ClusSvcRegroupPruningTimeout": 0, "DisableGroupPreferredOwnerRandomization": 0, - "GracePeriodEnabled": 0, "GracePeriodTimeout": 0, "QuorumArbitrationTimeMin": 0, "ResourceDllDeadlockPeriod": 0, + "GracePeriodEnabled": 0, "GracePeriodTimeout": 0, "QuorumArbitrationTimeMin": 0, "RootMemoryReserved": 0, "MaxNumberOfNodes": 64, } @@ -180,7 +189,7 @@ func TestClusterWMISynthesizedValues(t *testing.T) { t.Fatal(err) } - for _, name := range []string{"clus_svc_regroup_opening_timeout", "grace_period_enabled", "root_memory_reserved"} { + for _, name := range []string{"clus_svc_regroup_opening_timeout_seconds", "grace_period_enabled", "root_memory_reserved_bytes"} { if got := families["windows_mscluster_cluster_"+name].GetMetric()[0].GetGauge().GetValue(); got != 0 { t.Errorf("%s = %v", name, got) } diff --git a/internal/collector/mscluster/mscluster_cluster_parity_test.go b/internal/collector/mscluster/mscluster_cluster_parity_test.go index fc58fe51..74443f2b 100644 --- a/internal/collector/mscluster/mscluster_cluster_parity_test.go +++ b/internal/collector/mscluster/mscluster_cluster_parity_test.go @@ -30,7 +30,7 @@ import ( // clusterParityQuery is the query of the previous WMI implementation. func clusterParityQuery() string { - query := "SELECT Name,AddEvictDelay,AdminAccessPoint,AutoAssignNodeSite,AutoBalancerLevel,AutoBalancerMode,BackupInProgress,BlockCacheSize,ClusSvcHangTimeout,ClusSvcRegroupOpeningTimeout,ClusSvcRegroupPruningTimeout,ClusSvcRegroupStageTimeout,ClusSvcRegroupTickInMilliseconds,ClusterEnforcedAntiAffinity,ClusterFunctionalLevel,ClusterGroupWaitDelay,ClusterLogLevel,ClusterLogSize,ClusterUpgradeVersion,CrossSiteDelay,CrossSiteThreshold,CrossSubnetDelay,CrossSubnetThreshold,CsvBalancer,DatabaseReadWriteMode,DefaultNetworkRole,DisableGroupPreferredOwnerRandomization,DrainOnShutdown,DynamicQuorumEnabled,EnableSharedVolumes,FixQuorum,GracePeriodEnabled,GracePeriodTimeout,GroupDependencyTimeout,HangRecoveryAction,IgnorePersistentStateOnStartup,LogResourceControls,LowerQuorumPriorityNodeId,MessageBufferLength,MinimumNeverPreemptPriority,MinimumPreemptorPriority,NetftIPSecEnabled,PlacementOptions,PlumbAllCrossSubnetRoutes,PreventQuorum,QuarantineDuration,QuarantineThreshold,QuorumArbitrationTimeMax,QuorumArbitrationTimeMin,QuorumLogFileSize,QuorumTypeValue,RequestReplyTimeout,ResiliencyDefaultPeriod,ResiliencyLevel,ResourceDllDeadlockPeriod,RootMemoryReserved,RouteHistoryLength,S2DBusTypes,S2DCacheDesiredState,S2DCacheFlashReservePercent,S2DCachePageSizeKBytes,S2DEnabled,S2DIOLatencyThreshold,S2DOptimizations,SameSubnetDelay,SameSubnetThreshold,SecurityLevel,SharedVolumeVssWriterOperationTimeout,ShutdownTimeoutInMinutes,UseClientAccessNetworksForSharedVolumes,WitnessDatabaseWriteTimeout,WitnessDynamicWeight,WitnessRestartInterval" + query := "SELECT Name,AddEvictDelay,AdminAccessPoint,AutoAssignNodeSite,AutoBalancerLevel,AutoBalancerMode,BackupInProgress,BlockCacheSize,ClusSvcHangTimeout,ClusSvcRegroupOpeningTimeout,ClusSvcRegroupPruningTimeout,ClusSvcRegroupStageTimeout,ClusSvcRegroupTickInMilliseconds,ClusterEnforcedAntiAffinity,ClusterFunctionalLevel,ClusterGroupWaitDelay,ClusterLogLevel,ClusterLogSize,ClusterUpgradeVersion,CrossSiteDelay,CrossSiteThreshold,CrossSubnetDelay,CrossSubnetThreshold,CsvBalancer,DatabaseReadWriteMode,DefaultNetworkRole,DisableGroupPreferredOwnerRandomization,DrainOnShutdown,DynamicQuorumEnabled,EnableSharedVolumes,FixQuorum,GracePeriodEnabled,GracePeriodTimeout,GroupDependencyTimeout,HangRecoveryAction,IgnorePersistentStateOnStartup,LogResourceControls,LowerQuorumPriorityNodeId,MessageBufferLength,MinimumNeverPreemptPriority,MinimumPreemptorPriority,NetftIPSecEnabled,PlacementOptions,PlumbAllCrossSubnetRoutes,PreventQuorum,QuarantineDuration,QuarantineThreshold,QuorumArbitrationTimeMax,QuorumArbitrationTimeMin,QuorumTypeValue,RequestReplyTimeout,ResiliencyDefaultPeriod,ResiliencyLevel,RootMemoryReserved,RouteHistoryLength,S2DBusTypes,S2DCacheDesiredState,S2DCacheFlashReservePercent,S2DCachePageSizeKBytes,S2DEnabled,S2DIOLatencyThreshold,S2DOptimizations,SameSubnetDelay,SameSubnetThreshold,SecurityLevel,SharedVolumeVssWriterOperationTimeout,ShutdownTimeoutInMinutes,UseClientAccessNetworksForSharedVolumes,WitnessDatabaseWriteTimeout,WitnessDynamicWeight,WitnessRestartInterval" if osversion.Build() >= osversion.LTSC2022 { query += ",DetectManagedEvents,SecurityLevelForStorage,MaxNumberOfNodes,DetectManagedEventsThreshold,DetectedCloudPlatform" } diff --git a/internal/collector/mscluster/mscluster_objects.go b/internal/collector/mscluster/mscluster_objects.go index c713159b..8e341689 100644 --- a/internal/collector/mscluster/mscluster_objects.go +++ b/internal/collector/mscluster/mscluster_objects.go @@ -50,6 +50,9 @@ type objectField struct { desc *prometheus.Desc // Signed fields are sint32 in WMI, so 0xFFFFFFFF is published as -1. signed bool + // Scale, if set, converts the raw value to the base unit of the metric, + // for example 1e-3 for milliseconds to seconds. + scale float64 // MinBuild is the first Windows build that has the property. minBuild uint16 older beforeMinBuild @@ -91,6 +94,10 @@ func (field objectField) metric(raw uint32, name string) prometheus.Metric { value = float64(int32(raw)) } + if field.scale != 0 { + value *= field.scale + } + return prometheus.MustNewConstMetric(field.desc, prometheus.GaugeValue, value, name) } diff --git a/internal/collector/mscluster/mscluster_resource.go b/internal/collector/mscluster/mscluster_resource.go index 6964067b..3eebc208 100644 --- a/internal/collector/mscluster/mscluster_resource.go +++ b/internal/collector/mscluster/mscluster_resource.go @@ -20,6 +20,7 @@ package mscluster import ( "errors" "fmt" + "math" "time" "github.com/prometheus-community/windows_exporter/internal/headers/clusapi" @@ -109,8 +110,8 @@ func (c *Collector) buildResourceDescriptors() { nil, ) c.resourceDeadlockTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResource, "deadlock_timeout"), - "Indicates the length of time to wait, in milliseconds, before declaring a deadlock in any call into a resource.", + 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"}, nil, ) @@ -127,14 +128,14 @@ func (c *Collector) buildResourceDescriptors() { nil, ) c.resourceIsAlivePollInterval = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResource, "is_alive_poll_interval"), - "Provides access to the resource's IsAlivePollInterval property, which is the recommended interval in milliseconds at which the Cluster Service should poll the resource to determine whether it is operational. If the property is set to 0xFFFFFFFF, the Cluster Service uses the IsAlivePollInterval property for the resource type associated with the resource.", + 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"}, nil, ) c.resourceLooksAlivePollInterval = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResource, "looks_alive_poll_interval"), - "Provides access to the resource's LooksAlivePollInterval property, which is the recommended interval in milliseconds at which the Cluster Service should poll the resource to determine whether it appears operational. If the property is set to 0xFFFFFFFF, the Cluster Service uses the LooksAlivePollInterval property for the resource type associated with the resource.", + 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"}, nil, ) @@ -157,8 +158,8 @@ func (c *Collector) buildResourceDescriptors() { nil, ) c.resourcePendingTimeout = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResource, "pending_timeout"), - "Provides access to the resource's PendingTimeout property. If a resource cannot be brought online or taken offline in the number of milliseconds specified by the PendingTimeout property, the resource is forcibly terminated.", + 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"}, nil, ) @@ -175,14 +176,14 @@ func (c *Collector) buildResourceDescriptors() { nil, ) c.resourceRestartDelay = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResource, "restart_delay"), - "Indicates the time delay before a failed resource is restarted.", + 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"}, nil, ) c.resourceRestartPeriod = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResource, "restart_period"), - "Provides access to the resource's RestartPeriod property, which is interval of time, in milliseconds, during which a specified number of restart attempts can be made on a nonresponsive resource.", + 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"}, nil, ) @@ -193,8 +194,8 @@ func (c *Collector) buildResourceDescriptors() { nil, ) c.resourceRetryPeriodOnFailure = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResource, "retry_period_on_failure"), - "Provides access to the resource's RetryPeriodOnFailure property, which is the interval of time (in milliseconds) that a resource should remain in a failed state before the Cluster service attempts to restart it.", + 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"}, nil, ) @@ -273,6 +274,29 @@ func (c *Collector) publishResources(ch chan<- prometheus.Metric, resources []cl c.resourceRetryPeriodOnFailure, c.resourceState, } + // fieldScales converts the millisecond properties to seconds. + fieldScales := [resourceFieldCount]float64{ + 1, // Characteristics + 1e-3, // DeadlockTimeout + 1, // EmbeddedFailureAction + 1, // Flags + 1e-3, // IsAlivePollInterval + 1e-3, // LooksAlivePollInterval + 1, // MonitorProcessId + 1e-3, // PendingTimeout + 1, // ResourceClass + 1, // RestartAction + 1e-3, // RestartDelay + 1e-3, // RestartPeriod + 1, // RestartThreshold + 1e-3, // RetryPeriodOnFailure + 1, // State + } + // The poll intervals are 0xFFFFFFFF when the resource uses the interval of its + // resource type. That is not a duration, so the series is left out. + useTypeDefault := func(index int, raw uint32) bool { + return raw == math.MaxUint32 && (fieldNames[index] == "IsAlivePollInterval" || fieldNames[index] == "LooksAlivePollInterval") + } var nodeNamesKey []byte for _, nodeName := range nodeNames { @@ -318,7 +342,11 @@ func (c *Collector) publishResources(ch chan<- prometheus.Metric, resources []cl continue } - ch <- prometheus.MustNewConstMetric(fieldDescs[index], prometheus.GaugeValue, float64(raw), resource.Type, resource.OwnerGroup, resource.Name) + if useTypeDefault(index, raw) { + continue + } + + ch <- prometheus.MustNewConstMetric(fieldDescs[index], prometheus.GaugeValue, float64(raw)*fieldScales[index], resource.Type, resource.OwnerGroup, resource.Name) } for _, metric := range c.resourceNodeMetrics(nil, resource, nodeNames) { @@ -330,8 +358,13 @@ func (c *Collector) publishResources(ch chan<- prometheus.Metric, resources []cl metrics := scrape.Get(resource.Name, value, func() []prometheus.Metric { metrics := make([]prometheus.Metric, 0, resourceFieldCount+1+len(nodeNames)) + for index, raw := range value.values { - metrics = append(metrics, prometheus.MustNewConstMetric(fieldDescs[index], prometheus.GaugeValue, float64(raw), resource.Type, resource.OwnerGroup, resource.Name)) + if useTypeDefault(index, raw) { + continue + } + + metrics = append(metrics, prometheus.MustNewConstMetric(fieldDescs[index], prometheus.GaugeValue, float64(raw)*fieldScales[index], resource.Type, resource.OwnerGroup, resource.Name)) } return c.resourceNodeMetrics(metrics, resource, nodeNames) diff --git a/internal/collector/mscluster/mscluster_resource_native_test.go b/internal/collector/mscluster/mscluster_resource_native_test.go index 50ae4e7e..43cab7c9 100644 --- a/internal/collector/mscluster/mscluster_resource_native_test.go +++ b/internal/collector/mscluster/mscluster_resource_native_test.go @@ -22,6 +22,7 @@ import ( "fmt" "log/slog" "maps" + "math" "testing" "time" @@ -134,13 +135,18 @@ func TestResourceNativeMetricContract(t *testing.T) { } expected := map[string]float64{ - "characteristics": 1, "deadlock_timeout": 2, "embedded_failure_action": 3, "flags": 4, "is_alive_poll_interval": 4294967295, "looks_alive_poll_interval": 6, "monitor_process_id": 7, "pending_timeout": 8, "resource_class": 1, "restart_action": 10, "restart_delay": 11, "restart_period": 12, "restart_threshold": 13, "retry_period_on_failure": 14, "state": 4294967295, "subclass": 0, + "characteristics": 1, "deadlock_timeout_seconds": 0.002, "embedded_failure_action": 3, "flags": 4, "looks_alive_poll_interval_seconds": 0.006, "monitor_process_id": 7, "pending_timeout_seconds": 0.008, "resource_class": 1, "restart_action": 10, "restart_delay_seconds": 0.011, "restart_period_seconds": 0.012, "restart_threshold": 13, "retry_period_on_failure_seconds": 0.014, "state": 4294967295, "subclass": 0, } - if len(families) != 17 { + if len(families) != 16 { t.Fatalf("families = %d", len(families)) } + // IsAlivePollInterval is 0xFFFFFFFF: the resource uses the interval of its type. + if _, exists := families["windows_mscluster_resource_is_alive_poll_interval_seconds"]; exists { + t.Fatal("published the resource type default sentinel as a duration") + } + for suffix, value := range expected { family := families["windows_mscluster_resource_"+suffix] if family == nil || family.GetType() != dto.MetricType_GAUGE || len(family.GetMetric()) != 1 { @@ -148,7 +154,7 @@ func TestResourceNativeMetricContract(t *testing.T) { } metric := family.GetMetric()[0] - if metric.GetGauge().GetValue() != value { + if math.Abs(metric.GetGauge().GetValue()-value) > 1e-9*math.Max(1, math.Abs(value)) { t.Errorf("%s value = %v, want %v", suffix, metric.GetGauge().GetValue(), value) } @@ -190,11 +196,11 @@ func TestResourcePartialResultsAndJoinedErrors(t *testing.T) { t.Fatalf("lost joined cause: %v", err) } - if _, exists := families["windows_mscluster_resource_deadlock_timeout"]; exists { + if _, exists := families["windows_mscluster_resource_deadlock_timeout_seconds"]; exists { t.Fatal("published missing field as zero") } - if len(families) != 16 { + if len(families) != 15 { t.Fatalf("lost successful properties: %d", len(families)) } @@ -298,7 +304,7 @@ func BenchmarkResourcePublication(b *testing.B) { b.Fatal(err) } - for range 18 { + for range 17 { <-ch } } @@ -336,7 +342,7 @@ func TestResourceMetricCache(t *testing.T) { t.Fatal(err) } - if len(first) != 18 || len(second) != len(first) || first[0] != second[0] { + if len(first) != 17 || len(second) != len(first) || first[0] != second[0] { t.Fatal("did not reuse the metrics of an unchanged resource") } @@ -376,7 +382,7 @@ func TestResourceMetricCache(t *testing.T) { for range 2 { metrics, err := publish(resource, "nodeA") - if err == nil || len(metrics) != 16 { + if err == nil || len(metrics) != 15 { t.Fatalf("missing field: %d metrics, %v", len(metrics), err) } } @@ -394,8 +400,8 @@ func TestResourceLargeClusterGather(t *testing.T) { t.Fatal(err) } - if len(families) != 17 { - t.Fatalf("families = %d, want 17", len(families)) + if len(families) != 16 { + t.Fatalf("families = %d, want 16", len(families)) } for name, family := range families { diff --git a/internal/collector/mscluster/mscluster_resourcegroup.go b/internal/collector/mscluster/mscluster_resourcegroup.go index b2b30d39..be47d792 100644 --- a/internal/collector/mscluster/mscluster_resourcegroup.go +++ b/internal/collector/mscluster/mscluster_resourcegroup.go @@ -128,8 +128,8 @@ func (c *Collector) buildResourceGroupDescriptors() { nil, ) c.resourceGroupFailOverPeriod = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResourceGroup, "failover_period"), - "The FailoverPeriod property specifies a number of hours during which a maximum number of failover attempts, specified by the FailoverThreshold property, can occur.", + 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"}, nil, ) @@ -164,7 +164,7 @@ func (c *Collector) buildResourceGroupDescriptors() { nil, ) c.resourceGroupResiliencyPeriod = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameResourceGroup, "resiliency_period"), + prometheus.BuildFQName(types.Namespace, nameResourceGroup, "resiliency_period_seconds"), "The resiliency period for this group, in seconds.", []string{"name"}, nil, @@ -197,7 +197,7 @@ func (c *Collector) publishResourceGroups(ch chan<- prometheus.Metric, groups [] {name: "DefaultOwner", desc: c.resourceGroupDefaultOwner}, {name: "FailbackWindowEnd", desc: c.resourceGroupFailbackWindowEnd, signed: true}, {name: "FailbackWindowStart", desc: c.resourceGroupFailbackWindowStart, signed: true}, - {name: "FailoverPeriod", desc: c.resourceGroupFailOverPeriod}, + {name: "FailoverPeriod", desc: c.resourceGroupFailOverPeriod, scale: 3600}, {name: "FailoverThreshold", desc: c.resourceGroupFailOverThreshold}, {name: "Flags", desc: c.resourceGroupFlags}, {name: "GroupType", desc: c.resourceGroupGroupType}, diff --git a/internal/collector/mscluster/mscluster_resourcegroup_native_test.go b/internal/collector/mscluster/mscluster_resourcegroup_native_test.go index e93cf251..296404e5 100644 --- a/internal/collector/mscluster/mscluster_resourcegroup_native_test.go +++ b/internal/collector/mscluster/mscluster_resourcegroup_native_test.go @@ -135,7 +135,7 @@ func TestResourceGroupNativeMetricContract(t *testing.T) { } expected := map[string]float64{ - "auto_failback_type": 1, "characteristics": 2, "cold_start_setting": 3, "default_owner": 4294967295, "failback_window_end": -1, "failback_window_start": 5, "failover_period": 6, "failover_threshold": 4294967294, "flags": 1, "group_type": 9999, "priority": 3000, "resiliency_period": 240, "state": 4294967295, + "auto_failback_type": 1, "characteristics": 2, "cold_start_setting": 3, "default_owner": 4294967295, "failback_window_end": -1, "failback_window_start": 5, "failover_period_seconds": 21600, "failover_threshold": 4294967294, "flags": 1, "group_type": 9999, "priority": 3000, "resiliency_period_seconds": 240, "state": 4294967295, } if len(families) != len(expected)+1 { diff --git a/internal/collector/msmq/msmq.go b/internal/collector/msmq/msmq.go index 8c7b319c..08f63805 100644 --- a/internal/collector/msmq/msmq.go +++ b/internal/collector/msmq/msmq.go @@ -80,13 +80,13 @@ func (c *Collector) Close() error { func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { c.bytesInJournalQueue = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bytes_in_journal_queue"), + prometheus.BuildFQName(types.Namespace, Name, "journal_queue_bytes"), "Size of queue journal in bytes", []string{"name"}, nil, ) c.bytesInQueue = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bytes_in_queue"), + prometheus.BuildFQName(types.Namespace, Name, "queue_bytes"), "Size of queue in bytes", []string{"name"}, nil, diff --git a/internal/collector/mssql/counter_units_test.go b/internal/collector/mssql/counter_units_test.go index b22b5ac0..d8cda42e 100644 --- a/internal/collector/mssql/counter_units_test.go +++ b/internal/collector/mssql/counter_units_test.go @@ -121,10 +121,9 @@ func TestCounterUnitConversions(t *testing.T) { GenStatsTempdbRowsetID: 11, }} c.locksPerfDataObject = []perfDataCounterValuesLocks{{ - Name: "locks", - LocksAverageWaitTimeMS: 499, - LocksAverageWaitTimeMSBase: 3, - LocksLockWaitTimeMS: 499, + Name: "locks", + LocksAverageWaitTimeMS: 499, + LocksLockWaitTimeMS: 499, }} c.transactionsPerfDataObject = []perfDataCounterValuesTransactions{{ TransactionsNonSnapshotVersionTransactions: 1, @@ -156,7 +155,7 @@ func TestCounterUnitConversions(t *testing.T) { gauge := dto.MetricType_GAUGE want := map[string]wantMetric{ - "windows_mssql_bufman_read_ahead_issuing_seconds": {counter, 882e-6}, + "windows_mssql_bufman_read_ahead_issuing_seconds_total": {counter, 882e-6}, "windows_mssql_databases_log_flush_wait_seconds_total": {counter, 0.004}, "windows_mssql_databases_log_flush_write_seconds_total": {counter, 0.003}, @@ -189,7 +188,6 @@ func TestCounterUnitConversions(t *testing.T) { "windows_mssql_genstats_tempdb_rowset_ids_generated_total": {counter, 11}, "windows_mssql_locks_wait_time_seconds_total": {counter, 0.499}, - "windows_mssql_locks_count_total": {counter, 3}, "windows_mssql_locks_lock_wait_seconds_total": {counter, 0.499}, "windows_mssql_transactions_nonsnapshot_version_active": {gauge, 1}, @@ -275,7 +273,7 @@ func TestMetricTypesMatchCounterTypes(t *testing.T) { waitStats := c.waitStatsPerfDataCollectors[instance].MetricType checks := []check{ - {"windows_mssql_bufman_read_ahead_issuing_seconds", "Readahead time/sec", false, bufMan}, + {"windows_mssql_bufman_read_ahead_issuing_seconds_total", "Readahead time/sec", false, bufMan}, {"windows_mssql_databases_log_flush_wait_seconds_total", "Log Flush Wait Time", false, databases}, {"windows_mssql_databases_log_flush_write_seconds_total", "Log Flush Write Time (ms)", false, databases}, {"windows_mssql_databases_log_growths_total", "Log Growths", true, databases}, diff --git a/internal/collector/mssql/mssql_access_methods.go b/internal/collector/mssql/mssql_access_methods.go index b4d6c60e..b2c34c4f 100644 --- a/internal/collector/mssql/mssql_access_methods.go +++ b/internal/collector/mssql/mssql_access_methods.go @@ -140,43 +140,43 @@ func (c *Collector) buildAccessMethods() error { // Win32_PerfRawData_{instance}_SQLServerAccessMethods c.accessMethodsAUcleanupbatches = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_batch_cleanups"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_batch_cleanups_total"), "(AccessMethods.AUcleanupbatches)", []string{"mssql_instance"}, nil, ) c.accessMethodsAUcleanups = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_cleanups"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_cleanups_total"), "(AccessMethods.AUcleanups)", []string{"mssql_instance"}, nil, ) c.accessMethodsByReferenceLobCreateCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_by_reference_lob_creates"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_by_reference_lob_creates_total"), "(AccessMethods.ByreferenceLobCreateCount)", []string{"mssql_instance"}, nil, ) c.accessMethodsByReferenceLobUseCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_by_reference_lob_uses"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_by_reference_lob_uses_total"), "(AccessMethods.ByreferenceLobUseCount)", []string{"mssql_instance"}, nil, ) c.accessMethodsCountLobReadahead = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_read_aheads"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_read_aheads_total"), "(AccessMethods.CountLobReadahead)", []string{"mssql_instance"}, nil, ) c.accessMethodsCountPullInRow = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_column_value_pulls"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_column_value_pulls_total"), "(AccessMethods.CountPullInRow)", []string{"mssql_instance"}, nil, ) c.accessMethodsCountPushOffRow = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_column_value_pushes"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_column_value_pushes_total"), "(AccessMethods.CountPushOffRow)", []string{"mssql_instance"}, nil, @@ -194,211 +194,211 @@ func (c *Collector) buildAccessMethods() error { nil, ) c.accessMethodsDroppedrowsetcleanups = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_dropped_rowset_cleanups"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_dropped_rowset_cleanups_total"), "(AccessMethods.Droppedrowsetcleanups)", []string{"mssql_instance"}, nil, ) c.accessMethodsDroppedrowsetsskipped = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_dropped_rowset_skips"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_dropped_rowset_skips_total"), "(AccessMethods.Droppedrowsetsskipped)", []string{"mssql_instance"}, nil, ) c.accessMethodsExtentDeallocations = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_extent_deallocations"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_extent_deallocations_total"), "(AccessMethods.ExtentDeallocations)", []string{"mssql_instance"}, nil, ) c.accessMethodsExtentsAllocated = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_extent_allocations"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_extent_allocations_total"), "(AccessMethods.ExtentsAllocated)", []string{"mssql_instance"}, nil, ) c.accessMethodsFailedAUcleanupbatches = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_batch_cleanup_failures"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_batch_cleanup_failures_total"), "(AccessMethods.FailedAUcleanupbatches)", []string{"mssql_instance"}, nil, ) c.accessMethodsFailedleafpagecookie = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_leaf_page_cookie_failures"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_leaf_page_cookie_failures_total"), "(AccessMethods.Failedleafpagecookie)", []string{"mssql_instance"}, nil, ) c.accessMethodsFailedtreepagecookie = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_tree_page_cookie_failures"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_tree_page_cookie_failures_total"), "(AccessMethods.Failedtreepagecookie)", []string{"mssql_instance"}, nil, ) c.accessMethodsForwardedRecords = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_forwarded_records"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_forwarded_records_total"), "(AccessMethods.ForwardedRecords)", []string{"mssql_instance"}, nil, ) c.accessMethodsFreeSpacePageFetches = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_free_space_page_fetches"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_free_space_page_fetches_total"), "(AccessMethods.FreeSpacePageFetches)", []string{"mssql_instance"}, nil, ) c.accessMethodsFreeSpaceScans = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_free_space_scans"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_free_space_scans_total"), "(AccessMethods.FreeSpaceScans)", []string{"mssql_instance"}, nil, ) c.accessMethodsFullScans = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_full_scans"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_full_scans_total"), "(AccessMethods.FullScans)", []string{"mssql_instance"}, nil, ) c.accessMethodsIndexSearches = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_index_searches"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_index_searches_total"), "(AccessMethods.IndexSearches)", []string{"mssql_instance"}, nil, ) c.accessMethodsInSysXactwaits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_insysxact_waits"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_insysxact_waits_total"), "(AccessMethods.InSysXactwaits)", []string{"mssql_instance"}, nil, ) c.accessMethodsLobHandleCreateCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_handle_creates"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_handle_creates_total"), "(AccessMethods.LobHandleCreateCount)", []string{"mssql_instance"}, nil, ) c.accessMethodsLobHandleDestroyCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_handle_destroys"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_handle_destroys_total"), "(AccessMethods.LobHandleDestroyCount)", []string{"mssql_instance"}, nil, ) c.accessMethodsLobSSProviderCreateCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_creates"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_creates_total"), "(AccessMethods.LobSSProviderCreateCount)", []string{"mssql_instance"}, nil, ) c.accessMethodsLobSSProviderDestroyCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_destroys"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_destroys_total"), "(AccessMethods.LobSSProviderDestroyCount)", []string{"mssql_instance"}, nil, ) c.accessMethodsLobSSProviderTruncationCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_truncations"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_truncations_total"), "(AccessMethods.LobSSProviderTruncationCount)", []string{"mssql_instance"}, nil, ) c.accessMethodsMixedPageAllocations = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_mixed_page_allocations"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_mixed_page_allocations_total"), "(AccessMethods.MixedpageallocationsPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsPageCompressionAttempts = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_compression_attempts"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_compression_attempts_total"), "(AccessMethods.PagecompressionattemptsPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsPageDeallocations = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_deallocations"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_deallocations_total"), "(AccessMethods.PageDeallocationsPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsPagesAllocated = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_allocations"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_allocations_total"), "(AccessMethods.PagesAllocatedPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsPagesCompressed = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_compressions"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_compressions_total"), "(AccessMethods.PagescompressedPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsPageSplits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_splits"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_splits_total"), "(AccessMethods.PageSplitsPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsProbeScans = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_probe_scans"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_probe_scans_total"), "(AccessMethods.ProbeScansPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsRangeScans = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_range_scans"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_range_scans_total"), "(AccessMethods.RangeScansPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsScanPointRevalidations = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_scan_point_revalidations"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_scan_point_revalidations_total"), "(AccessMethods.ScanPointRevalidationsPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsSkippedGhostedRecords = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_ghost_record_skips"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_ghost_record_skips_total"), "(AccessMethods.SkippedGhostedRecordsPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsTableLockEscalations = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_table_lock_escalations"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_table_lock_escalations_total"), "(AccessMethods.TableLockEscalationsPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsUsedleafpagecookie = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_leaf_page_cookie_uses"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_leaf_page_cookie_uses_total"), "(AccessMethods.Usedleafpagecookie)", []string{"mssql_instance"}, nil, ) c.accessMethodsUsedtreepagecookie = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_tree_page_cookie_uses"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_tree_page_cookie_uses_total"), "(AccessMethods.Usedtreepagecookie)", []string{"mssql_instance"}, nil, ) c.accessMethodsWorkfilesCreated = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_workfile_creates"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_workfile_creates_total"), "(AccessMethods.WorkfilesCreatedPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsWorktablesCreated = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_creates"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_creates_total"), "(AccessMethods.WorktablesCreatedPersec)", []string{"mssql_instance"}, nil, ) c.accessMethodsWorktablesFromCacheHits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_from_cache_hits"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_from_cache_hits_total"), "(AccessMethods.WorktablesFromCacheRatio)", []string{"mssql_instance"}, nil, ) c.accessMethodsWorktablesFromCacheLookups = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_from_cache_lookups"), + prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_from_cache_lookups_total"), "(AccessMethods.WorktablesFromCacheRatio_Base)", []string{"mssql_instance"}, nil, diff --git a/internal/collector/mssql/mssql_availability_replica.go b/internal/collector/mssql/mssql_availability_replica.go index bfde0e6d..f71987d5 100644 --- a/internal/collector/mssql/mssql_availability_replica.go +++ b/internal/collector/mssql/mssql_availability_replica.go @@ -71,55 +71,55 @@ func (c *Collector) buildAvailabilityReplica() error { // Win32_PerfRawData_{instance}_SQLServerAvailabilityReplica c.availReplicaBytesReceivedFromReplica = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_received_from_replica_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_received_from_replica_bytes_total"), "(AvailabilityReplica.BytesReceivedfromReplica)", []string{"mssql_instance", "replica"}, nil, ) c.availReplicaBytesSentToReplica = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_sent_to_replica_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_sent_to_replica_bytes_total"), "(AvailabilityReplica.BytesSenttoReplica)", []string{"mssql_instance", "replica"}, nil, ) c.availReplicaBytesSentToTransport = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_sent_to_transport_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_sent_to_transport_bytes_total"), "(AvailabilityReplica.BytesSenttoTransport)", []string{"mssql_instance", "replica"}, nil, ) c.availReplicaFlowControl = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_initiated_flow_controls"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_initiated_flow_controls_total"), "(AvailabilityReplica.FlowControl)", []string{"mssql_instance", "replica"}, nil, ) c.availReplicaFlowControlTimeMS = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_flow_control_wait_seconds"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_flow_control_wait_seconds_total"), "(AvailabilityReplica.FlowControlTimems)", []string{"mssql_instance", "replica"}, nil, ) c.availReplicaReceivesFromReplica = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_receives_from_replica"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_receives_from_replica_total"), "(AvailabilityReplica.ReceivesfromReplica)", []string{"mssql_instance", "replica"}, nil, ) c.availReplicaResentMessages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_resent_messages"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_resent_messages_total"), "(AvailabilityReplica.ResentMessages)", []string{"mssql_instance", "replica"}, nil, ) c.availReplicaSendsToReplica = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_sends_to_replica"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_sends_to_replica_total"), "(AvailabilityReplica.SendstoReplica)", []string{"mssql_instance", "replica"}, nil, ) c.availReplicaSendsToTransport = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "availreplica_sends_to_transport"), + prometheus.BuildFQName(types.Namespace, Name, "availreplica_sends_to_transport_total"), "(AvailabilityReplica.SendstoTransport)", []string{"mssql_instance", "replica"}, nil, diff --git a/internal/collector/mssql/mssql_buffer_manager.go b/internal/collector/mssql/mssql_buffer_manager.go index f4d503f6..ad14a6b1 100644 --- a/internal/collector/mssql/mssql_buffer_manager.go +++ b/internal/collector/mssql/mssql_buffer_manager.go @@ -97,7 +97,7 @@ func (c *Collector) buildBufferManager() error { } c.bufManBackgroundwriterpages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_background_writer_pages"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_background_writer_pages_total"), "(BufferManager.Backgroundwriterpages)", []string{"mssql_instance"}, nil, @@ -115,7 +115,7 @@ func (c *Collector) buildBufferManager() error { nil, ) c.bufManCheckpointpages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_checkpoint_pages"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_checkpoint_pages_total"), "(BufferManager.Checkpointpages)", []string{"mssql_instance"}, nil, @@ -139,8 +139,8 @@ func (c *Collector) buildBufferManager() error { nil, ) c.bufManExtensioninuseaspercentage = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_in_use_as_percentage"), - "(BufferManager.Extensioninuseaspercentage)", + prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_in_use_ratio"), + "(BufferManager.Extensioninuseaspercentage) Ratio (0-1) of the buffer pool extension file in use", []string{"mssql_instance"}, nil, ) @@ -151,13 +151,13 @@ func (c *Collector) buildBufferManager() error { nil, ) c.bufManExtensionpageevictions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_evictions"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_evictions_total"), "(BufferManager.Extensionpageevictions)", []string{"mssql_instance"}, nil, ) c.bufManExtensionpagereads = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_reads"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_reads_total"), "(BufferManager.Extensionpagereads)", []string{"mssql_instance"}, nil, @@ -169,13 +169,13 @@ func (c *Collector) buildBufferManager() error { nil, ) c.bufManExtensionpagewrites = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_writes"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_writes_total"), "(BufferManager.Extensionpagewrites)", []string{"mssql_instance"}, nil, ) c.bufManFreeliststalls = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_free_list_stalls"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_free_list_stalls_total"), "(BufferManager.Freeliststalls)", []string{"mssql_instance"}, nil, @@ -187,7 +187,7 @@ func (c *Collector) buildBufferManager() error { nil, ) c.bufManLazywrites = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_lazywrites"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_lazywrites_total"), "(BufferManager.Lazywrites)", []string{"mssql_instance"}, nil, @@ -199,31 +199,31 @@ func (c *Collector) buildBufferManager() error { nil, ) c.bufManPagelookups = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_page_lookups"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_page_lookups_total"), "(BufferManager.Pagelookups)", []string{"mssql_instance"}, nil, ) c.bufManPagereads = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_page_reads"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_page_reads_total"), "(BufferManager.Pagereads)", []string{"mssql_instance"}, nil, ) c.bufManPagewrites = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_page_writes"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_page_writes_total"), "(BufferManager.Pagewrites)", []string{"mssql_instance"}, nil, ) c.bufManReadaheadpages = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_read_ahead_pages"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_read_ahead_pages_total"), "(BufferManager.Readaheadpages)", []string{"mssql_instance"}, nil, ) c.bufManReadaheadtime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "bufman_read_ahead_issuing_seconds"), + prometheus.BuildFQName(types.Namespace, Name, "bufman_read_ahead_issuing_seconds_total"), "(BufferManager.Readaheadtime) Total time spent issuing read-ahead, in seconds", []string{"mssql_instance"}, nil, @@ -307,7 +307,7 @@ func (c *Collector) emitBufferManagerMetrics(ch chan<- prometheus.Metric, sqlIns ch <- prometheus.MustNewConstMetric( c.bufManExtensioninuseaspercentage, prometheus.GaugeValue, - data.BufManExtensionInUseAsPercentage, + data.BufManExtensionInUseAsPercentage/100, sqlInstance.name, ) diff --git a/internal/collector/mssql/mssql_database.go b/internal/collector/mssql/mssql_database.go index 623d67fa..0c82802b 100644 --- a/internal/collector/mssql/mssql_database.go +++ b/internal/collector/mssql/mssql_database.go @@ -177,19 +177,19 @@ func (c *Collector) buildDatabases() error { nil, ) c.databasesBackupPerRestoreThroughput = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_backup_restore_operations"), + prometheus.BuildFQName(types.Namespace, Name, "databases_backup_restore_operations_total"), "(Databases.BackupPerRestoreThroughput)", []string{"mssql_instance", "database"}, nil, ) c.databasesBulkCopyRows = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_bulk_copy_rows"), + prometheus.BuildFQName(types.Namespace, Name, "databases_bulk_copy_rows_total"), "(Databases.BulkCopyRows)", []string{"mssql_instance", "database"}, nil, ) c.databasesBulkCopyThroughput = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_bulk_copy_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_bulk_copy_bytes_total"), "(Databases.BulkCopyThroughput)", []string{"mssql_instance", "database"}, nil, @@ -207,19 +207,19 @@ func (c *Collector) buildDatabases() error { nil, ) c.databasesDBCCLogicalScanBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_dbcc_logical_scan_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_dbcc_logical_scan_bytes_total"), "(Databases.DBCCLogicalScanBytes)", []string{"mssql_instance", "database"}, nil, ) c.databasesGroupCommitTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_group_commit_stall_seconds"), + prometheus.BuildFQName(types.Namespace, Name, "databases_group_commit_stall_seconds_total"), "(Databases.GroupCommitTime)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogBytesFlushed = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_flushed_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_flushed_bytes_total"), "(Databases.LogBytesFlushed)", []string{"mssql_instance", "database"}, nil, @@ -237,7 +237,7 @@ func (c *Collector) buildDatabases() error { nil, ) c.databasesLogCacheReads = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_cache_reads"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_cache_reads_total"), "(Databases.LogCacheReads)", []string{"mssql_instance", "database"}, nil, @@ -255,13 +255,13 @@ func (c *Collector) buildDatabases() error { nil, ) c.databasesLogFlushes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_flushes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_flushes_total"), "(Databases.LogFlushes)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogFlushWaits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_flush_waits"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_flush_waits_total"), "(Databases.LogFlushWaits)", []string{"mssql_instance", "database"}, nil, @@ -285,79 +285,79 @@ func (c *Collector) buildDatabases() error { nil, ) c.databasesLogPoolCacheMisses = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_cache_misses"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_cache_misses_total"), "(Databases.LogPoolCacheMisses)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolDiskReads = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_disk_reads"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_disk_reads_total"), "(Databases.LogPoolDiskReads)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolHashDeletes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_hash_deletes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_hash_deletes_total"), "(Databases.LogPoolHashDeletes)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolHashInserts = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_hash_inserts"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_hash_inserts_total"), "(Databases.LogPoolHashInserts)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolInvalidHashEntry = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_invalid_hash_entries"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_invalid_hash_entries_total"), "(Databases.LogPoolInvalidHashEntry)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolLogScanPushes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_log_scan_pushes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_log_scan_pushes_total"), "(Databases.LogPoolLogScanPushes)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolLogWriterPushes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_log_writer_pushes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_log_writer_pushes_total"), "(Databases.LogPoolLogWriterPushes)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolPushEmptyFreePool = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_empty_free_pool_pushes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_empty_free_pool_pushes_total"), "(Databases.LogPoolPushEmptyFreePool)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolPushLowMemory = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_low_memory_pushes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_low_memory_pushes_total"), "(Databases.LogPoolPushLowMemory)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolPushNoFreeBuffer = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_no_free_buffer_pushes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_no_free_buffer_pushes_total"), "(Databases.LogPoolPushNoFreeBuffer)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolReqBehindTrunc = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_req_behind_trunc"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_req_behind_trunc_total"), "(Databases.LogPoolReqBehindTrunc)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolRequestsOldVLF = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_requests_old_vlf"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_requests_old_vlf_total"), "(Databases.LogPoolRequestsOldVLF)", []string{"mssql_instance", "database"}, nil, ) c.databasesLogPoolRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_requests"), + prometheus.BuildFQName(types.Namespace, Name, "databases_log_pool_requests_total"), "(Databases.LogPoolRequests)", []string{"mssql_instance", "database"}, nil, @@ -387,8 +387,8 @@ func (c *Collector) buildDatabases() error { nil, ) c.databasesPercentLogUsed = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_log_used_percent"), - "(Databases.PercentLogUsed)", + prometheus.BuildFQName(types.Namespace, Name, "databases_log_used_ratio"), + "(Databases.PercentLogUsed) Ratio (0-1) of the transaction log space in use", []string{"mssql_instance", "database"}, nil, ) @@ -399,31 +399,31 @@ func (c *Collector) buildDatabases() error { nil, ) c.databasesReplTransRate = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_repl_transactions"), + prometheus.BuildFQName(types.Namespace, Name, "databases_repl_transactions_total"), "(Databases.ReplTranactions)", []string{"mssql_instance", "database"}, nil, ) c.databasesShrinkDataMovementBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_shrink_data_movement_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_shrink_data_movement_bytes_total"), "(Databases.ShrinkDataMovementBytes)", []string{"mssql_instance", "database"}, nil, ) c.databasesTrackedTransactions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_tracked_transactions"), + prometheus.BuildFQName(types.Namespace, Name, "databases_tracked_transactions_total"), "(Databases.Trackedtransactions)", []string{"mssql_instance", "database"}, nil, ) c.databasesTransactions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_transactions"), + prometheus.BuildFQName(types.Namespace, Name, "databases_transactions_total"), "(Databases.Transactions)", []string{"mssql_instance", "database"}, nil, ) c.databasesWriteTransactions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_write_transactions"), + prometheus.BuildFQName(types.Namespace, Name, "databases_write_transactions_total"), "(Databases.WriteTransactions)", []string{"mssql_instance", "database"}, nil, @@ -447,7 +447,7 @@ func (c *Collector) buildDatabases() error { nil, ) c.databasesXTPControllerLogProcessed = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "databases_xtp_controller_log_processed_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "databases_xtp_controller_log_processed_bytes_total"), "(Databases.XTPControllerLogProcessed)", []string{"mssql_instance", "database"}, nil, @@ -737,7 +737,7 @@ func (c *Collector) emitDatabasesMetrics(ch chan<- prometheus.Metric, sqlInstanc ch <- prometheus.MustNewConstMetric( c.databasesPercentLogUsed, prometheus.GaugeValue, - data.DatabasesPercentLogUsed, + data.DatabasesPercentLogUsed/100, sqlInstance.name, data.Name, ) diff --git a/internal/collector/mssql/mssql_database_replica.go b/internal/collector/mssql/mssql_database_replica.go index ff1c84e3..660f7b00 100644 --- a/internal/collector/mssql/mssql_database_replica.go +++ b/internal/collector/mssql/mssql_database_replica.go @@ -106,19 +106,19 @@ func (c *Collector) buildDatabaseReplica() error { nil, ) c.dbReplicaDatabaseFlowControls = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_database_initiated_flow_controls"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_database_initiated_flow_controls_total"), "(DatabaseReplica.DatabaseFlowControls)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaFileBytesReceived = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_received_file_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_received_file_bytes_total"), "(DatabaseReplica.FileBytesReceived)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaGroupCommits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_group_commits"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_group_commits_total"), "(DatabaseReplica.GroupCommits)", []string{"mssql_instance", "replica"}, nil, @@ -142,43 +142,43 @@ func (c *Collector) buildDatabaseReplica() error { nil, ) c.dbReplicaLogBytesCompressed = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compressed_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compressed_bytes_total"), "(DatabaseReplica.LogBytesCompressed)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaLogBytesDecompressed = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_decompressed_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_decompressed_bytes_total"), "(DatabaseReplica.LogBytesDecompressed)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaLogBytesReceived = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_received_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_received_bytes_total"), "(DatabaseReplica.LogBytesReceived)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaLogCompressionCachehits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compression_cachehits"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compression_cachehits_total"), "(DatabaseReplica.LogCompressionCachehits)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaLogCompressionCachemisses = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compression_cachemisses"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compression_cachemisses_total"), "(DatabaseReplica.LogCompressionCachemisses)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaLogCompressions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compressions"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compressions_total"), "(DatabaseReplica.LogCompressions)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaLogDecompressions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_decompressions"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_decompressions_total"), "(DatabaseReplica.LogDecompressions)", []string{"mssql_instance", "replica"}, nil, @@ -196,7 +196,7 @@ func (c *Collector) buildDatabaseReplica() error { nil, ) c.dbReplicaMirroredWritetransactions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_mirrored_write_transactions"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_mirrored_write_transactions_total"), "(DatabaseReplica.MirroredWriteTransactions)", []string{"mssql_instance", "replica"}, nil, @@ -208,7 +208,7 @@ func (c *Collector) buildDatabaseReplica() error { nil, ) c.dbReplicaRedoblocked = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_redo_blocks"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_redo_blocks_total"), "(DatabaseReplica.Redoblocked)", []string{"mssql_instance", "replica"}, nil, @@ -220,13 +220,13 @@ func (c *Collector) buildDatabaseReplica() error { nil, ) c.dbReplicaRedoneBytes = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_redone_bytes"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_redone_bytes_total"), "(DatabaseReplica.RedoneBytes)", []string{"mssql_instance", "replica"}, nil, ) c.dbReplicaRedones = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "dbreplica_redones"), + prometheus.BuildFQName(types.Namespace, Name, "dbreplica_redones_total"), "(DatabaseReplica.Redones)", []string{"mssql_instance", "replica"}, nil, diff --git a/internal/collector/mssql/mssql_general_statistics.go b/internal/collector/mssql/mssql_general_statistics.go index ee96f04e..d8aba6cc 100644 --- a/internal/collector/mssql/mssql_general_statistics.go +++ b/internal/collector/mssql/mssql_general_statistics.go @@ -104,7 +104,7 @@ func (c *Collector) buildGeneralStatistics() error { nil, ) c.genStatsConnectionReset = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "genstats_connection_resets"), + prometheus.BuildFQName(types.Namespace, Name, "genstats_connection_resets_total"), "(GeneralStatistics.ConnectionReset)", []string{"mssql_instance"}, nil, @@ -128,13 +128,13 @@ func (c *Collector) buildGeneralStatistics() error { nil, ) c.genStatsLogins = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "genstats_logins"), + prometheus.BuildFQName(types.Namespace, Name, "genstats_logins_total"), "(GeneralStatistics.Logins)", []string{"mssql_instance"}, nil, ) c.genStatsLogouts = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "genstats_logouts"), + prometheus.BuildFQName(types.Namespace, Name, "genstats_logouts_total"), "(GeneralStatistics.Logouts)", []string{"mssql_instance"}, nil, @@ -146,7 +146,7 @@ func (c *Collector) buildGeneralStatistics() error { nil, ) c.genStatsNonAtomicYieldRate = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "genstats_non_atomic_yields"), + prometheus.BuildFQName(types.Namespace, Name, "genstats_non_atomic_yields_total"), "(GeneralStatistics.Nonatomicyields)", []string{"mssql_instance"}, nil, @@ -212,7 +212,7 @@ func (c *Collector) buildGeneralStatistics() error { nil, ) c.genStatsTempTablesCreationRate = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "genstats_temp_tables_creations"), + prometheus.BuildFQName(types.Namespace, Name, "genstats_temp_tables_creations_total"), "(GeneralStatistics.TempTablesCreations)", []string{"mssql_instance"}, nil, diff --git a/internal/collector/mssql/mssql_locks.go b/internal/collector/mssql/mssql_locks.go index a550e094..8fa85811 100644 --- a/internal/collector/mssql/mssql_locks.go +++ b/internal/collector/mssql/mssql_locks.go @@ -32,7 +32,6 @@ type collectorLocks struct { // Win32_PerfRawData_{instance}_SQLServerLocks locksWaitTime *prometheus.Desc - locksCount *prometheus.Desc locksLockRequests *prometheus.Desc locksLockTimeouts *prometheus.Desc locksLockTimeoutstimeout0 *prometheus.Desc @@ -45,7 +44,6 @@ type perfDataCounterValuesLocks struct { Name string LocksAverageWaitTimeMS float64 `perfdata:"Average Wait Time (ms)"` - LocksAverageWaitTimeMSBase float64 `perfdata:"Average Wait Time (ms),secondvalue"` LocksLockRequestsPerSec float64 `perfdata:"Lock Requests/sec"` LocksLockTimeoutsPerSec float64 `perfdata:"Lock Timeouts/sec"` LocksLockTimeoutsTimeout0PerSec float64 `perfdata:"Lock Timeouts (timeout > 0)/sec"` @@ -69,36 +67,30 @@ func (c *Collector) buildLocks() error { c.locksWaitTime = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "locks_wait_time_seconds_total"), - "(Locks.AverageWaitTimems) Total time lock requests waited, in seconds. Numerator of Average Wait Time (ms)", - []string{"mssql_instance", "resource"}, - nil, - ) - c.locksCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "locks_count_total"), - "(Locks.AverageWaitTimems_Base) Total number of lock requests that waited. Base of Average Wait Time (ms)", + "(Locks.AverageWaitTimems) Total time lock requests waited, in seconds. Divide its rate by the rate of windows_mssql_locks_lock_waits_total for the average wait", []string{"mssql_instance", "resource"}, nil, ) c.locksLockRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "locks_lock_requests"), + prometheus.BuildFQName(types.Namespace, Name, "locks_lock_requests_total"), "(Locks.LockRequests)", []string{"mssql_instance", "resource"}, nil, ) c.locksLockTimeouts = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "locks_lock_timeouts"), + prometheus.BuildFQName(types.Namespace, Name, "locks_lock_timeouts_total"), "(Locks.LockTimeouts)", []string{"mssql_instance", "resource"}, nil, ) c.locksLockTimeoutstimeout0 = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "locks_lock_timeouts_excluding_NOWAIT"), + prometheus.BuildFQName(types.Namespace, Name, "locks_lock_timeouts_excluding_nowait_total"), "(Locks.LockTimeoutstimeout0)", []string{"mssql_instance", "resource"}, nil, ) c.locksLockWaits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "locks_lock_waits"), + prometheus.BuildFQName(types.Namespace, Name, "locks_lock_waits_total"), "(Locks.LockWaits)", []string{"mssql_instance", "resource"}, nil, @@ -110,7 +102,7 @@ func (c *Collector) buildLocks() error { nil, ) c.locksNumberOfDeadlocks = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "locks_deadlocks"), + prometheus.BuildFQName(types.Namespace, Name, "locks_deadlocks_total"), "(Locks.NumberOfDeadlocks)", []string{"mssql_instance", "resource"}, nil, @@ -143,13 +135,6 @@ func (c *Collector) emitLocksMetrics(ch chan<- prometheus.Metric, sqlInstance ms sqlInstance.name, data.Name, ) - ch <- prometheus.MustNewConstMetric( - c.locksCount, - prometheus.CounterValue, - data.LocksAverageWaitTimeMSBase, - sqlInstance.name, data.Name, - ) - ch <- prometheus.MustNewConstMetric( c.locksLockRequests, prometheus.CounterValue, diff --git a/internal/collector/mssql/mssql_sql_stats.go b/internal/collector/mssql/mssql_sql_stats.go index 3868cf41..445e042e 100644 --- a/internal/collector/mssql/mssql_sql_stats.go +++ b/internal/collector/mssql/mssql_sql_stats.go @@ -71,67 +71,67 @@ func (c *Collector) buildSQLStats() error { } c.sqlStatsAutoParamAttempts = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_auto_parameterization_attempts"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_auto_parameterization_attempts_total"), "(SQLStatistics.AutoParamAttempts)", []string{"mssql_instance"}, nil, ) c.sqlStatsBatchRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_batch_requests"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_batch_requests_total"), "(SQLStatistics.BatchRequests)", []string{"mssql_instance"}, nil, ) c.sqlStatsFailedAutoParams = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_failed_auto_parameterization_attempts"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_failed_auto_parameterization_attempts_total"), "(SQLStatistics.FailedAutoParams)", []string{"mssql_instance"}, nil, ) c.sqlStatsForcedParameterizations = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_forced_parameterizations"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_forced_parameterizations_total"), "(SQLStatistics.ForcedParameterizations)", []string{"mssql_instance"}, nil, ) c.sqlStatsGuidedplanexecutions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_guided_plan_executions"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_guided_plan_executions_total"), "(SQLStatistics.Guidedplanexecutions)", []string{"mssql_instance"}, nil, ) c.sqlStatsMisguidedplanexecutions = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_misguided_plan_executions"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_misguided_plan_executions_total"), "(SQLStatistics.Misguidedplanexecutions)", []string{"mssql_instance"}, nil, ) c.sqlStatsSafeAutoParams = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_safe_auto_parameterization_attempts"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_safe_auto_parameterization_attempts_total"), "(SQLStatistics.SafeAutoParams)", []string{"mssql_instance"}, nil, ) c.sqlStatsSQLAttentionrate = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_sql_attentions"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_sql_attentions_total"), "(SQLStatistics.SQLAttentions)", []string{"mssql_instance"}, nil, ) c.sqlStatsSQLCompilations = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_sql_compilations"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_sql_compilations_total"), "(SQLStatistics.SQLCompilations)", []string{"mssql_instance"}, nil, ) c.sqlStatsSQLReCompilations = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_sql_recompilations"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_sql_recompilations_total"), "(SQLStatistics.SQLReCompilations)", []string{"mssql_instance"}, nil, ) c.sqlStatsUnsafeAutoParams = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "sqlstats_unsafe_auto_parameterization_attempts"), + prometheus.BuildFQName(types.Namespace, Name, "sqlstats_unsafe_auto_parameterization_attempts_total"), "(SQLStatistics.UnsafeAutoParams)", []string{"mssql_instance"}, nil, diff --git a/internal/collector/mssql/mssql_transactions.go b/internal/collector/mssql/mssql_transactions.go index c59d9394..248e8d9d 100644 --- a/internal/collector/mssql/mssql_transactions.go +++ b/internal/collector/mssql/mssql_transactions.go @@ -149,13 +149,13 @@ func (c *Collector) buildTransactions() error { nil, ) c.transactionsVersionStoreCreationUnits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "transactions_version_store_creation_units"), + prometheus.BuildFQName(types.Namespace, Name, "transactions_version_store_creation_units_total"), "(Transactions.VersionStoreUnitCreation)", []string{"mssql_instance"}, nil, ) c.transactionsVersionStoreTruncationUnits = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "transactions_version_store_truncation_units"), + prometheus.BuildFQName(types.Namespace, Name, "transactions_version_store_truncation_units_total"), "(Transactions.VersionStoreUnitTruncation)", []string{"mssql_instance"}, nil, diff --git a/internal/collector/netframework/netframework.go b/internal/collector/netframework/netframework.go index 4ca8edf2..95d625b0 100644 --- a/internal/collector/netframework/netframework.go +++ b/internal/collector/netframework/netframework.go @@ -25,7 +25,6 @@ import ( "slices" "strings" "time" - "unsafe" "github.com/alecthomas/kingpin/v2" "github.com/prometheus-community/windows_exporter/internal/labelcache" @@ -34,7 +33,6 @@ import ( "github.com/prometheus-community/windows_exporter/internal/scrapecache" "github.com/prometheus-community/windows_exporter/internal/utils/recovery" "github.com/prometheus/client_golang/prometheus" - "golang.org/x/sys/windows" ) type perfCollector[T any] interface { @@ -78,11 +76,10 @@ type Collector struct { // labels keeps the label pairs of the series of the last scrape. The // counters change on every scrape, but their process labels stay the // same while the process runs. - labels labelcache.Cache - config Config - logger *slog.Logger - perfFrequency float64 - closeFns []func() + labels labelcache.Cache + config Config + logger *slog.Logger + closeFns []func() // perfQuery samples the counters of all enabled sub-collectors at once. // The .NET CLR counter provider serves one query at a time and walks // every .NET process for each, so separate queries wait for each other. @@ -231,16 +228,6 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { } c.logger = logger - if slices.Contains(c.config.CollectorsEnabled, collectorClrJIT) || slices.Contains(c.config.CollectorsEnabled, collectorClrSecurity) { - var frequency int64 - - ret, _, err := windows.NewLazySystemDLL("kernel32.dll").NewProc("QueryPerformanceFrequency").Call(uintptr(unsafe.Pointer(&frequency))) - if ret == 0 || frequency <= 0 { - return fmt.Errorf("QueryPerformanceFrequency: %w", err) - } - - c.perfFrequency = float64(frequency) - } var err error diff --git a/internal/collector/netframework/netframework_clrjit.go b/internal/collector/netframework/netframework_clrjit.go index 07915e30..ad3e06cf 100644 --- a/internal/collector/netframework/netframework_clrjit.go +++ b/internal/collector/netframework/netframework_clrjit.go @@ -34,8 +34,8 @@ func (c *Collector) describeClrJIT() { nil, ) c.timeInJit = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, collectorClrJIT+"_jit_time_percent"), - "Displays the percentage of time spent in JIT compilation. This counter is updated at the end of every JIT compilation phase. A JIT compilation phase occurs when a method and its dependencies are compiled.", + prometheus.BuildFQName(types.Namespace, Name, collectorClrJIT+"_jit_time_ratio"), + "Displays the ratio (0-1) of elapsed time spent in JIT compilation since the last JIT compilation phase. This counter is updated at the end of every JIT compilation phase. A JIT compilation phase occurs when a method and its dependencies are compiled.", []string{"process"}, nil, ) @@ -68,6 +68,7 @@ type perfDataClrJIT struct { Occurrence int NumberofMethodsJitted float64 `perfdata:"# of Methods JITted"` PercentTimeinJit float64 `perfdata:"% Time in Jit"` + PercentTimeinJitBase float64 `perfdata:"% Time in Jit,secondvalue"` StandardJitFailures float64 `perfdata:"Standard Jit Failures"` TotalNumberofILBytesJitted float64 `perfdata:"Total # of IL Bytes Jitted"` } @@ -94,16 +95,18 @@ func (c *Collector) collectClrJIT(ch chan<- prometheus.Metric, scrape *labelcach process.Name, ) - ch <- scrape.MustNewConstMetric( - c.timeInJit, - prometheus.GaugeValue, - float64(process.PercentTimeinJit)/c.perfFrequency, - process.Name, - ) + if process.PercentTimeinJitBase > 0 { + ch <- scrape.MustNewConstMetric( + c.timeInJit, + prometheus.GaugeValue, + process.PercentTimeinJit/process.PercentTimeinJitBase, + process.Name, + ) + } ch <- scrape.MustNewConstMetric( c.standardJitFailures, - prometheus.GaugeValue, + prometheus.CounterValue, float64(process.StandardJitFailures), process.Name, ) diff --git a/internal/collector/netframework/netframework_clrmemory.go b/internal/collector/netframework/netframework_clrmemory.go index 755153c9..c70af66a 100644 --- a/internal/collector/netframework/netframework_clrmemory.go +++ b/internal/collector/netframework/netframework_clrmemory.go @@ -95,8 +95,8 @@ func (c *Collector) describeClrMemory() { nil, ) c.timeInGC = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, collectorClrMemory+"_gc_time_percent"), - "Displays the percentage of time that was spent performing a garbage collection in the last sample.", + prometheus.BuildFQName(types.Namespace, Name, collectorClrMemory+"_gc_time_ratio"), + "Displays the ratio (0-1) of elapsed time spent performing a garbage collection since the end of the last garbage collection cycle.", []string{"process", "process_id"}, nil, ) @@ -304,7 +304,7 @@ func (c *Collector) collectClrMemory(ch chan<- prometheus.Metric, scrape *labelc ch <- scrape.MustNewConstMetric( c.timeInGC, prometheus.GaugeValue, - 100*process.PercentTimeinGC/process.PercentTimeinGC_base, + process.PercentTimeinGC/process.PercentTimeinGC_base, process.Name, strconv.FormatUint(uint64(process.ProcessID), 10), ) diff --git a/internal/collector/netframework/netframework_clrsecurity.go b/internal/collector/netframework/netframework_clrsecurity.go index 3539503b..38c481e3 100644 --- a/internal/collector/netframework/netframework_clrsecurity.go +++ b/internal/collector/netframework/netframework_clrsecurity.go @@ -34,8 +34,8 @@ func (c *Collector) describeClrSecurity() { nil, ) c.timeInRTChecks = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, collectorClrSecurity+"_rt_checks_time_percent"), - "Displays the percentage of time spent performing runtime code access security checks in the last sample.", + prometheus.BuildFQName(types.Namespace, Name, collectorClrSecurity+"_rt_checks_time_ratio"), + "Displays the ratio (0-1) of time spent performing runtime code access security checks in the last sample.", []string{"process"}, nil, ) @@ -64,12 +64,13 @@ func (c *Collector) buildClrSecurity() error { } type perfDataClrSecurity struct { - Name string - Occurrence int - NumberLinkTimeChecks float64 `perfdata:"# Link Time Checks"` - PercentTimeinRTchecks float64 `perfdata:"% Time in RT checks"` - StackWalkDepth float64 `perfdata:"Stack Walk Depth"` - TotalRuntimeChecks float64 `perfdata:"Total Runtime Checks"` + Name string + Occurrence int + NumberLinkTimeChecks float64 `perfdata:"# Link Time Checks"` + PercentTimeinRTchecks float64 `perfdata:"% Time in RT checks"` + PercentTimeinRTchecksBase float64 `perfdata:"% Time in RT checks,secondvalue"` + StackWalkDepth float64 `perfdata:"Stack Walk Depth"` + TotalRuntimeChecks float64 `perfdata:"Total Runtime Checks"` } func (p *perfDataClrSecurity) instance() (*string, int) { return &p.Name, p.Occurrence } @@ -94,12 +95,14 @@ func (c *Collector) collectClrSecurity(ch chan<- prometheus.Metric, scrape *labe process.Name, ) - ch <- scrape.MustNewConstMetric( - c.timeInRTChecks, - prometheus.GaugeValue, - float64(process.PercentTimeinRTchecks)/c.perfFrequency, - process.Name, - ) + if process.PercentTimeinRTchecksBase > 0 { + ch <- scrape.MustNewConstMetric( + c.timeInRTChecks, + prometheus.GaugeValue, + process.PercentTimeinRTchecks/process.PercentTimeinRTchecksBase, + process.Name, + ) + } ch <- scrape.MustNewConstMetric( c.stackWalkDepth, diff --git a/internal/collector/netframework/netframework_counter_paths_test.go b/internal/collector/netframework/netframework_counter_paths_test.go index 86ec3233..dc85d60d 100644 --- a/internal/collector/netframework/netframework_counter_paths_test.go +++ b/internal/collector/netframework/netframework_counter_paths_test.go @@ -60,12 +60,12 @@ func TestClrCounterPaths(t *testing.T) { }{ {reflect.TypeFor[perfDataClrExceptions](), []string{"# of Exceps Thrown", "# of Filters / sec", "# of Finallys / sec", "Throw To Catch Depth / sec"}}, {reflect.TypeFor[perfDataClrInterop](), []string{"# of CCWs", "# of Stubs", "# of marshalling"}}, - {reflect.TypeFor[perfDataClrJIT](), []string{"# of Methods Jitted", "% Time in Jit", "Standard Jit Failures", "Total # of IL Bytes Jitted"}}, + {reflect.TypeFor[perfDataClrJIT](), []string{"# of Methods Jitted", "% Time in Jit", "% Time in Jit,secondvalue", "Standard Jit Failures", "Total # of IL Bytes Jitted"}}, {reflect.TypeFor[perfDataClrLoading](), []string{"Bytes in Loader Heap", "Current appdomains", "Current Assemblies", "Current Classes Loaded", "Total Appdomains", "Total appdomains unloaded", "Total Assemblies", "Total Classes Loaded", "Total # of Load Failures"}}, {reflect.TypeFor[perfDataClrLocksAndThreads](), []string{"Current Queue Length", "# of current logical Threads", "# of current physical Threads", "# of current recognized threads", "# of total recognized threads", "Queue Length Peak", "Total # of Contentions"}}, {reflect.TypeFor[perfDataClrMemory](), []string{"Allocated Bytes/sec", "Finalization Survivors", "Gen 0 heap size", "Gen 0 Promoted Bytes/Sec", "Gen 1 heap size", "Gen 1 Promoted Bytes/Sec", "Gen 2 heap size", "Large Object Heap size", "# GC Handles", "# Gen 0 Collections", "# Gen 1 Collections", "# Gen 2 Collections", "# Induced GC", "# of Pinned Objects", "# of Sink Blocks in use", "# Total committed Bytes", "# Total reserved Bytes", "% Time in GC", "% Time in GC,secondvalue", "Process ID"}}, {reflect.TypeFor[perfDataClrRemoting](), []string{"Channels", "Context-Bound Classes Loaded", "Context-Bound Objects Alloc / sec", "Context Proxies", "Contexts", "Total Remote Calls"}}, - {reflect.TypeFor[perfDataClrSecurity](), []string{"# Link Time Checks", "% Time in RT checks", "Stack Walk Depth", "Total Runtime Checks"}}, + {reflect.TypeFor[perfDataClrSecurity](), []string{"# Link Time Checks", "% Time in RT checks", "% Time in RT checks,secondvalue", "Stack Walk Depth", "Total Runtime Checks"}}, } for _, tc := range cases { t.Run(tc.rowType.Name(), func(t *testing.T) { diff --git a/internal/collector/netframework/netframework_pdh_test.go b/internal/collector/netframework/netframework_pdh_test.go index 30e3fb42..463cad3d 100644 --- a/internal/collector/netframework/netframework_pdh_test.go +++ b/internal/collector/netframework/netframework_pdh_test.go @@ -136,7 +136,7 @@ func assertFixtureMetrics(t *testing.T, collect func(chan<- prometheus.Metric, * } func TestClrExceptionsMetricCompatibility(t *testing.T) { - c := &Collector{perfFrequency: 1000} + c := &Collector{} c.describeClrExceptions() row := perfDataClrExceptions{ @@ -162,7 +162,7 @@ func TestClrExceptionsMetricCompatibility(t *testing.T) { } func TestClrInteropMetricCompatibility(t *testing.T) { - c := &Collector{perfFrequency: 1000} + c := &Collector{} c.describeClrInterop() row := perfDataClrInterop{ @@ -186,12 +186,13 @@ func TestClrInteropMetricCompatibility(t *testing.T) { } func TestClrJITMetricCompatibility(t *testing.T) { - c := &Collector{perfFrequency: 1000} + c := &Collector{} c.describeClrJIT() row := perfDataClrJIT{ NumberofMethodsJitted: 11, PercentTimeinJit: 50, + PercentTimeinJitBase: 200, StandardJitFailures: 13, TotalNumberofILBytesJitted: 14, } @@ -205,14 +206,14 @@ func TestClrJITMetricCompatibility(t *testing.T) { c.perfClrJIT = &fixturePerfCollector[perfDataClrJIT]{rows: rows} assertFixtureMetrics(t, c.collectClrJIT, []expectedMetric{ {"windows_netframework_clrjit_jit_methods_total", dto.MetricType_COUNTER, 11, ""}, - {"windows_netframework_clrjit_jit_time_percent", dto.MetricType_GAUGE, 0.05, ""}, - {"windows_netframework_clrjit_jit_standard_failures_total", dto.MetricType_GAUGE, 13, ""}, + {"windows_netframework_clrjit_jit_time_ratio", dto.MetricType_GAUGE, 0.25, ""}, + {"windows_netframework_clrjit_jit_standard_failures_total", dto.MetricType_COUNTER, 13, ""}, {"windows_netframework_clrjit_jit_il_bytes_total", dto.MetricType_COUNTER, 14, ""}, }, false) } func TestClrLoadingMetricCompatibility(t *testing.T) { - c := &Collector{perfFrequency: 1000} + c := &Collector{} c.describeClrLoading() row := perfDataClrLoading{ @@ -248,7 +249,7 @@ func TestClrLoadingMetricCompatibility(t *testing.T) { } func TestClrLocksAndThreadsMetricCompatibility(t *testing.T) { - c := &Collector{perfFrequency: 1000} + c := &Collector{} c.describeClrLocksAndThreads() row := perfDataClrLocksAndThreads{ @@ -280,7 +281,7 @@ func TestClrLocksAndThreadsMetricCompatibility(t *testing.T) { } func TestClrMemoryMetricCompatibility(t *testing.T) { - c := &Collector{perfFrequency: 1000} + c := &Collector{} c.describeClrMemory() row := perfDataClrMemory{ @@ -331,12 +332,12 @@ func TestClrMemoryMetricCompatibility(t *testing.T) { {"windows_netframework_clrmemory_number_sink_blocksinuse", dto.MetricType_GAUGE, 27, ""}, {"windows_netframework_clrmemory_committed_bytes", dto.MetricType_GAUGE, 24, ""}, {"windows_netframework_clrmemory_reserved_bytes", dto.MetricType_GAUGE, 25, ""}, - {"windows_netframework_clrmemory_gc_time_percent", dto.MetricType_GAUGE, 25, ""}, + {"windows_netframework_clrmemory_gc_time_ratio", dto.MetricType_GAUGE, 0.25, ""}, }, true) } func TestClrRemotingMetricCompatibility(t *testing.T) { - c := &Collector{perfFrequency: 1000} + c := &Collector{} c.describeClrRemoting() row := perfDataClrRemoting{ @@ -366,14 +367,15 @@ func TestClrRemotingMetricCompatibility(t *testing.T) { } func TestClrSecurityMetricCompatibility(t *testing.T) { - c := &Collector{perfFrequency: 1000} + c := &Collector{} c.describeClrSecurity() row := perfDataClrSecurity{ - NumberLinkTimeChecks: 11, - PercentTimeinRTchecks: 50, - StackWalkDepth: 13, - TotalRuntimeChecks: 14, + NumberLinkTimeChecks: 11, + PercentTimeinRTchecks: 50, + PercentTimeinRTchecksBase: 200, + StackWalkDepth: 13, + TotalRuntimeChecks: 14, } rows := make([]perfDataClrSecurity, 0, 4) @@ -385,7 +387,7 @@ func TestClrSecurityMetricCompatibility(t *testing.T) { c.perfClrSecurity = &fixturePerfCollector[perfDataClrSecurity]{rows: rows} assertFixtureMetrics(t, c.collectClrSecurity, []expectedMetric{ {"windows_netframework_clrsecurity_link_time_checks_total", dto.MetricType_COUNTER, 11, ""}, - {"windows_netframework_clrsecurity_rt_checks_time_percent", dto.MetricType_GAUGE, 0.05, ""}, + {"windows_netframework_clrsecurity_rt_checks_time_ratio", dto.MetricType_GAUGE, 0.25, ""}, {"windows_netframework_clrsecurity_stack_walk_depth", dto.MetricType_GAUGE, 13, ""}, {"windows_netframework_clrsecurity_runtime_checks_total", dto.MetricType_COUNTER, 14, ""}, }, false) @@ -403,7 +405,7 @@ func TestGCZeroBaseDoesNotPublishInvalidRatio(t *testing.T) { foundAllocated := false for _, family := range families { - require.NotEqual(t, "windows_netframework_clrmemory_gc_time_percent", family.GetName()) + require.NotEqual(t, "windows_netframework_clrmemory_gc_time_ratio", family.GetName()) if family.GetName() == "windows_netframework_clrmemory_allocated_bytes_total" { require.InDelta(t, 99.0, family.GetMetric()[0].GetCounter().GetValue(), 1e-12) @@ -415,6 +417,31 @@ func TestGCZeroBaseDoesNotPublishInvalidRatio(t *testing.T) { require.True(t, foundAllocated) } +func TestJITAndSecurityZeroBaseDoNotPublishInvalidRatio(t *testing.T) { + c := &Collector{} + c.describeClrJIT() + c.describeClrSecurity() + c.perfClrJIT = &fixturePerfCollector[perfDataClrJIT]{rows: []perfDataClrJIT{{Name: "worker", PercentTimeinJit: 50, NumberofMethodsJitted: 7}}} + c.perfClrSecurity = &fixturePerfCollector[perfDataClrSecurity]{rows: []perfDataClrSecurity{{Name: "worker", PercentTimeinRTchecks: 50, TotalRuntimeChecks: 7}}} + registry := prometheus.NewRegistry() + registry.MustRegister(fixturePromCollector{collect: func(ch chan<- prometheus.Metric) { + require.NoError(t, c.collectClrJIT(ch, nil, time.Second)) + require.NoError(t, c.collectClrSecurity(ch, nil, time.Second)) + }}) + families, err := registry.Gather() + require.NoError(t, err) + + names := make([]string, 0, len(families)) + for _, family := range families { + names = append(names, family.GetName()) + } + + require.Contains(t, names, "windows_netframework_clrjit_jit_methods_total") + require.Contains(t, names, "windows_netframework_clrsecurity_runtime_checks_total") + require.NotContains(t, names, "windows_netframework_clrjit_jit_time_ratio") + require.NotContains(t, names, "windows_netframework_clrsecurity_rt_checks_time_ratio") +} + // TestDuplicateProcessNames checks that processes with the same name, which // the CLR objects report with the same instance name, are published apart. func TestDuplicateProcessNames(t *testing.T) { diff --git a/internal/collector/nps/AGENTS.md b/internal/collector/nps/AGENTS.md index e78d6cb7..c502c13d 100644 --- a/internal/collector/nps/AGENTS.md +++ b/internal/collector/nps/AGENTS.md @@ -11,6 +11,8 @@ recorded on Windows Server 2025 (build 26100) with almost no RADIUS traffic. - `Server Up Time` and `Server Reset Time` are elapsed times. The help text says "in hundredths of a second", but the raw value is seconds: 303 about 304 s after the `IAS` service started. Both objects report the same values. + The collector publishes them as gauges (`..._time_seconds`); the other + counters are counters with a `_total` suffix. - Each `X / sec.` twin (`PERF_COUNTER_COUNTER`, not read) has the same raw value as `X` (`Packets Received / sec.` 1 = `Packets Received` 1). - `No Record` exists only on `NPS Accounting Server`; diff --git a/internal/collector/nps/nps.go b/internal/collector/nps/nps.go index 7107a507..2087081f 100644 --- a/internal/collector/nps/nps.go +++ b/internal/collector/nps/nps.go @@ -101,152 +101,152 @@ func (c *Collector) Close() error { func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { c.accessAccepts = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_accepts"), + prometheus.BuildFQName(types.Namespace, Name, "access_accepts_total"), "(AccessAccepts)", nil, nil, ) c.accessChallenges = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_challenges"), + prometheus.BuildFQName(types.Namespace, Name, "access_challenges_total"), "(AccessChallenges)", nil, nil, ) c.accessRejects = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_rejects"), + prometheus.BuildFQName(types.Namespace, Name, "access_rejects_total"), "(AccessRejects)", nil, nil, ) c.accessRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_requests"), + prometheus.BuildFQName(types.Namespace, Name, "access_requests_total"), "(AccessRequests)", nil, nil, ) c.accessBadAuthenticators = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_bad_authenticators"), + prometheus.BuildFQName(types.Namespace, Name, "access_bad_authenticators_total"), "(BadAuthenticators)", nil, nil, ) c.accessDroppedPackets = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_dropped_packets"), + prometheus.BuildFQName(types.Namespace, Name, "access_dropped_packets_total"), "(DroppedPackets)", nil, nil, ) c.accessInvalidRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_invalid_requests"), + prometheus.BuildFQName(types.Namespace, Name, "access_invalid_requests_total"), "(InvalidRequests)", nil, nil, ) c.accessMalformedPackets = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_malformed_packets"), + prometheus.BuildFQName(types.Namespace, Name, "access_malformed_packets_total"), "(MalformedPackets)", nil, nil, ) c.accessPacketsReceived = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_packets_received"), + prometheus.BuildFQName(types.Namespace, Name, "access_packets_received_total"), "(PacketsReceived)", nil, nil, ) c.accessPacketsSent = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_packets_sent"), + prometheus.BuildFQName(types.Namespace, Name, "access_packets_sent_total"), "(PacketsSent)", nil, nil, ) c.accessServerResetTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_server_reset_time"), - "(ServerResetTime)", + prometheus.BuildFQName(types.Namespace, Name, "access_server_reset_time_seconds"), + "(ServerResetTime) Elapsed time in seconds since the NPS server counters were last reset", nil, nil, ) c.accessServerUpTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_server_up_time"), - "(ServerUpTime)", + prometheus.BuildFQName(types.Namespace, Name, "access_server_up_time_seconds"), + "(ServerUpTime) Elapsed time in seconds since the NPS service started", nil, nil, ) c.accessUnknownType = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "access_unknown_type"), + prometheus.BuildFQName(types.Namespace, Name, "access_unknown_type_total"), "(UnknownType)", nil, nil, ) c.accountingRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_requests"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_requests_total"), "(AccountingRequests)", nil, nil, ) c.accountingResponses = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_responses"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_responses_total"), "(AccountingResponses)", nil, nil, ) c.accountingBadAuthenticators = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_bad_authenticators"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_bad_authenticators_total"), "(BadAuthenticators)", nil, nil, ) c.accountingDroppedPackets = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_dropped_packets"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_dropped_packets_total"), "(DroppedPackets)", nil, nil, ) c.accountingInvalidRequests = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_invalid_requests"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_invalid_requests_total"), "(InvalidRequests)", nil, nil, ) c.accountingMalformedPackets = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_malformed_packets"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_malformed_packets_total"), "(MalformedPackets)", nil, nil, ) c.accountingNoRecord = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_no_record"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_no_record_total"), "(NoRecord)", nil, nil, ) c.accountingPacketsReceived = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_packets_received"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_packets_received_total"), "(PacketsReceived)", nil, nil, ) c.accountingPacketsSent = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_packets_sent"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_packets_sent_total"), "(PacketsSent)", nil, nil, ) c.accountingServerResetTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_server_reset_time"), - "(ServerResetTime)", + prometheus.BuildFQName(types.Namespace, Name, "accounting_server_reset_time_seconds"), + "(ServerResetTime) Elapsed time in seconds since the NPS server counters were last reset", nil, nil, ) c.accountingServerUpTime = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_server_up_time"), - "(ServerUpTime)", + prometheus.BuildFQName(types.Namespace, Name, "accounting_server_up_time_seconds"), + "(ServerUpTime) Elapsed time in seconds since the NPS service started", nil, nil, ) c.accountingUnknownType = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "accounting_unknown_type"), + prometheus.BuildFQName(types.Namespace, Name, "accounting_unknown_type_total"), "(UnknownType)", nil, nil, @@ -355,13 +355,13 @@ func (c *Collector) collectAccept(ch chan<- prometheus.Metric) error { ch <- prometheus.MustNewConstMetric( c.accessServerResetTime, - prometheus.CounterValue, + prometheus.GaugeValue, c.accessPerfDataObject[0].AccessServerResetTime, ) ch <- prometheus.MustNewConstMetric( c.accessServerUpTime, - prometheus.CounterValue, + prometheus.GaugeValue, c.accessPerfDataObject[0].AccessServerUpTime, ) @@ -436,13 +436,13 @@ func (c *Collector) collectAccounting(ch chan<- prometheus.Metric) error { ch <- prometheus.MustNewConstMetric( c.accountingServerResetTime, - prometheus.CounterValue, + prometheus.GaugeValue, c.accountingPerfDataObject[0].AccountingServerResetTime, ) ch <- prometheus.MustNewConstMetric( c.accountingServerUpTime, - prometheus.CounterValue, + prometheus.GaugeValue, c.accountingPerfDataObject[0].AccountingServerUpTime, ) diff --git a/internal/collector/printer/printer.go b/internal/collector/printer/printer.go index 50954ff0..df7af540 100644 --- a/internal/collector/printer/printer.go +++ b/internal/collector/printer/printer.go @@ -151,8 +151,8 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error { nil, ) c.printerJobCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "job_count"), - "Number of jobs processed by the printer since the last reset", + prometheus.BuildFQName(types.Namespace, Name, "jobs"), + "Number of jobs in the queue of the printer", []string{"printer"}, nil, ) @@ -190,7 +190,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric, _ time.Duration) error // Win32_Printer JobCountSinceLastReset is PRINTER_INFO_2.cJobs, the number of queued jobs. ch <- prometheus.MustNewConstMetric( c.printerJobCount, - prometheus.CounterValue, + prometheus.GaugeValue, float64(printer.Jobs), printer.Name, ) diff --git a/internal/collector/printer/printer_test.go b/internal/collector/printer/printer_test.go index 4d53613e..e9800fda 100644 --- a/internal/collector/printer/printer_test.go +++ b/internal/collector/printer/printer_test.go @@ -35,7 +35,7 @@ func BenchmarkCollector(b *testing.B) { func TestCollector(t *testing.T) { metrics := testutils.TestCollector(t, printer.New, nil) - testutils.RequireFixtureMetric(t, metrics, printer.Name, "windows_printer_job_count", prometheus.Labels{"printer": "CIPrinter"}) + testutils.RequireFixtureMetric(t, metrics, printer.Name, "windows_printer_jobs", prometheus.Labels{"printer": "CIPrinter"}) } // TestCollectorWithoutMISession checks that the collector does not depend on WMI. diff --git a/internal/collector/process/process.go b/internal/collector/process/process.go index a172b8ba..6ed734b9 100644 --- a/internal/collector/process/process.go +++ b/internal/collector/process/process.go @@ -202,7 +202,7 @@ func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error { nil, ) c.cpuTimeTotal = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "cpu_time_total"), + prometheus.BuildFQName(types.Namespace, Name, "cpu_time_seconds_total"), "Returns elapsed time that all of the threads of this process used the processor to execute instructions by mode (privileged, user).", []string{"process", "process_id", "mode"}, nil, diff --git a/internal/collector/process/process_test.go b/internal/collector/process/process_test.go index 3714f5a7..ae311c50 100644 --- a/internal/collector/process/process_test.go +++ b/internal/collector/process/process_test.go @@ -68,7 +68,7 @@ func TestCollectorCurrentProcess(t *testing.T) { require.Positive(t, testutils.MetricValuesByLabel(families, name, "process_id")[pid], name) } - cpu := families["windows_process_cpu_time_total"].GetMetric() + cpu := families["windows_process_cpu_time_seconds_total"].GetMetric() require.Len(t, cpu, 2) require.NotNil(t, cpu[0].GetCounter()) } diff --git a/internal/collector/scheduled_task/scheduled_task.go b/internal/collector/scheduled_task/scheduled_task.go index f3dd9e32..2852082a 100644 --- a/internal/collector/scheduled_task/scheduled_task.go +++ b/internal/collector/scheduled_task/scheduled_task.go @@ -61,7 +61,6 @@ type Collector struct { config Config logger *slog.Logger - lastResult *prometheus.Desc lastResultStatus *prometheus.Desc missedRuns *prometheus.Desc state *prometheus.Desc @@ -208,14 +207,6 @@ func (c *Collector) Close() error { func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { c.logger = logger.With(slog.String("collector", Name)) - c.lastResult = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "last_result"), - "DEPRECATED: use windows_scheduled_task_last_result_status. "+ - "1 if the last result code of the registered task is zero, 0 otherwise", - []string{"task"}, - nil, - ) - c.lastResultStatus = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "last_result_status"), "The last result status of a scheduled task, 1 if the current status, 0 otherwise", @@ -370,18 +361,6 @@ func (c *Collector) taskMetrics(task ScheduledTask) []prometheus.Metric { return metrics } - lastResult := 0.0 - if task.LastTaskResult == SCHED_S_SUCCESS { - lastResult = 1.0 - } - - metrics = append(metrics, prometheus.MustNewConstMetric( - c.lastResult, - prometheus.GaugeValue, - lastResult, - task.Path, - )) - if !c.config.MissedRuns { return metrics } diff --git a/internal/collector/scheduled_task/scheduled_task_internal_test.go b/internal/collector/scheduled_task/scheduled_task_internal_test.go index e64d01ce..eee32c7c 100644 --- a/internal/collector/scheduled_task/scheduled_task_internal_test.go +++ b/internal/collector/scheduled_task/scheduled_task_internal_test.go @@ -167,23 +167,13 @@ func TestCollectMetrics(t *testing.T) { if tc.result == 0x41303 { require.Len(t, families, 2) - require.NotContains(t, families, "windows_scheduled_task_last_result") require.NotContains(t, families, "windows_scheduled_task_missed_runs") return } - require.Len(t, families, 4) - lastResult := families["windows_scheduled_task_last_result"] - require.NotNil(t, lastResult) - require.Len(t, lastResult.GetMetric(), 1) - - wantSuccess := 0.0 - if tc.result == 0 { - wantSuccess = 1 - } - - require.InDelta(t, wantSuccess, lastResult.GetMetric()[0].GetGauge().GetValue(), 0) + require.Len(t, families, 3) + require.NotContains(t, families, "windows_scheduled_task_last_result") missedRuns := families["windows_scheduled_task_missed_runs"] require.NotNil(t, missedRuns) @@ -252,7 +242,7 @@ func TestCollectMetricsCache(t *testing.T) { for i, scrape := range []ScheduledTasks{tasks, tasks, changed, changed} { // Collect once outside the registry, which calls Collect for Describe too. - collected := make(chan prometheus.Metric, len(scrape)*19) + collected := make(chan prometheus.Metric, len(scrape)*18) cacheScrape := scrapecache.Begin(c) c.collectMetrics(collected, scrape) cacheScrape.End(nil) @@ -283,7 +273,7 @@ func TestCollectMetricsCache(t *testing.T) { current := make(map[string][]prometheus.Metric, len(scrape)) for _, task := range scrape { - n := 19 + n := 18 if task.LastTaskResult == SCHED_S_TASK_HAS_NOT_RUN { n = 17 } @@ -359,7 +349,7 @@ func BenchmarkCollectMetrics(b *testing.B) { require.NoError(b, c.Build(slog.New(slog.DiscardHandler), nil)) tasks := benchmarkTasks(265) - ch := make(chan prometheus.Metric, len(tasks)*19) + ch := make(chan prometheus.Metric, len(tasks)*18) b.ReportAllocs() diff --git a/internal/collector/scheduled_task/scheduled_task_native_test.go b/internal/collector/scheduled_task/scheduled_task_native_test.go index bb321903..6e1e2d1f 100644 --- a/internal/collector/scheduled_task/scheduled_task_native_test.go +++ b/internal/collector/scheduled_task/scheduled_task_native_test.go @@ -229,7 +229,7 @@ func TestFetchTasksFilters(t *testing.T) { return } - require.Len(t, families, 4) + require.Len(t, families, 3) for _, family := range families { paths := make([]string, 0, len(family.GetMetric())) @@ -321,7 +321,7 @@ func TestFetchTasksInFolderSkipsMissedRuns(t *testing.T) { require.Zero(t, task.reads[taskSlotMissedRuns]) families := gatherTaskMetrics(t, config, tasks) - require.Contains(t, families, "windows_scheduled_task_last_result") + require.Contains(t, families, "windows_scheduled_task_last_result_status") require.NotContains(t, families, "windows_scheduled_task_missed_runs") } diff --git a/internal/collector/smb/smb.go b/internal/collector/smb/smb.go index a6412dd3..d10a22c0 100644 --- a/internal/collector/smb/smb.go +++ b/internal/collector/smb/smb.go @@ -103,13 +103,13 @@ func (c *Collector) Close() error { func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { c.currentOpenFileCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "server_shares_current_open_file_count"), + prometheus.BuildFQName(types.Namespace, Name, "server_shares_open_files"), "Current total count open files on the SMB Server Share", []string{"share"}, nil, ) c.treeConnectCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "server_shares_tree_connect_count"), + prometheus.BuildFQName(types.Namespace, Name, "server_shares_tree_connects"), "Count of user connections to the SMB Server Share", []string{"share"}, nil, diff --git a/internal/collector/smb/smb_test.go b/internal/collector/smb/smb_test.go index df961742..212e2513 100644 --- a/internal/collector/smb/smb_test.go +++ b/internal/collector/smb/smb_test.go @@ -38,8 +38,8 @@ func TestCollector(t *testing.T) { } for _, name := range []string{ - "windows_smb_server_shares_current_open_file_count", - "windows_smb_server_shares_tree_connect_count", + "windows_smb_server_shares_open_files", + "windows_smb_server_shares_tree_connects", } { require.Contains(t, metrics, name) require.Equal(t, dto.MetricType_GAUGE, metrics[name].GetType(), name) diff --git a/internal/collector/storage_spaces/storage_spaces_test.go b/internal/collector/storage_spaces/storage_spaces_test.go index e2fea55b..bacf4575 100644 --- a/internal/collector/storage_spaces/storage_spaces_test.go +++ b/internal/collector/storage_spaces/storage_spaces_test.go @@ -61,10 +61,10 @@ func TestCollector(t *testing.T) { require.GreaterOrEqual(t, metric.GetGauge().GetValue(), float64(1<<30)) } - if metric := testutils.RequireFixtureMetric(t, metrics, storage_spaces.Name, "windows_storage_spaces_virtual_disk_storage_efficiency_percent", virtualDisk); metric != nil { + if metric := testutils.RequireFixtureMetric(t, metrics, storage_spaces.Name, "windows_storage_spaces_virtual_disk_storage_efficiency_ratio", virtualDisk); metric != nil { value := metric.GetGauge().GetValue() require.Greater(t, value, 0.0) - require.LessOrEqual(t, value, 100.0) + require.LessOrEqual(t, value, 1.0) } // Every pool, including the built-in primordial pool, must carry a boolean primordial label. diff --git a/internal/collector/storage_spaces/storage_spaces_virtual_disk.go b/internal/collector/storage_spaces/storage_spaces_virtual_disk.go index 9d82e69d..09cb06ee 100644 --- a/internal/collector/storage_spaces/storage_spaces_virtual_disk.go +++ b/internal/collector/storage_spaces/storage_spaces_virtual_disk.go @@ -96,8 +96,8 @@ func (c *Collector) buildVirtualDisk() error { ) c.virtualDiskStorageEfficiency = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, nameVirtualDisk, "storage_efficiency_percent"), - "Storage efficiency percentage (AllocatedSize / FootprintOnPool * 100), omitted while FootprintOnPool is 0", + prometheus.BuildFQName(types.Namespace, nameVirtualDisk, "storage_efficiency_ratio"), + "Storage efficiency ratio (AllocatedSize / FootprintOnPool), omitted while FootprintOnPool is 0", []string{"name", "unique_id"}, nil, ) @@ -169,7 +169,7 @@ func (c *Collector) collectVirtualDisk(ch chan<- prometheus.Metric, maxScrapeDur ch <- prometheus.MustNewConstMetric( c.virtualDiskStorageEfficiency, prometheus.GaugeValue, - float64(vdisk.AllocatedSize)/float64(vdisk.FootprintOnPool)*100, + float64(vdisk.AllocatedSize)/float64(vdisk.FootprintOnPool), vdisk.FriendlyName, vdisk.UniqueId, ) diff --git a/internal/collector/tcp/tcp.go b/internal/collector/tcp/tcp.go index a6d52834..6339608c 100644 --- a/internal/collector/tcp/tcp.go +++ b/internal/collector/tcp/tcp.go @@ -206,7 +206,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, ) c.connectionsStateCount = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "connections_state_count"), + prometheus.BuildFQName(types.Namespace, Name, "connections"), "Number of TCP connections by state and address family", []string{"af", "state"}, nil, diff --git a/internal/collector/time/time.go b/internal/collector/time/time.go index 45e32a29..9dbef663 100644 --- a/internal/collector/time/time.go +++ b/internal/collector/time/time.go @@ -171,8 +171,8 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, ) c.clockFrequencyAdjustmentPPB = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "clock_frequency_adjustment_ppb"), - "This value reflects the adjustment made to the local system clock frequency by W32Time in Parts Per Billion (PPB) units. 1 PPB adjustment imples the system clock was adjusted at a rate of 1 nanosecond per second. The smallest possible adjustment can vary and can be expected to be in the order of 100's of PPB. This counter helps visualize the finer actions being taken by W32time to synchronize the local clock.", + prometheus.BuildFQName(types.Namespace, Name, "clock_frequency_adjustment_ratio"), + "This value reflects the adjustment made to the local system clock frequency by W32Time as a ratio. Windows reports it in Parts Per Billion (PPB): an adjustment of 1e-9 implies the system clock was adjusted at a rate of 1 nanosecond per second. The smallest possible adjustment can vary and can be expected to be in the order of 100's of PPB. This counter helps visualize the finer actions being taken by W32time to synchronize the local clock.", nil, nil, ) @@ -320,7 +320,7 @@ func (c *Collector) collectNTP(ch chan<- prometheus.Metric) error { ch <- prometheus.MustNewConstMetric( c.clockFrequencyAdjustmentPPB, prometheus.GaugeValue, - c.perfDataObject[0].ClockFrequencyAdjustmentPPB, + c.perfDataObject[0].ClockFrequencyAdjustmentPPB*1e-9, ) } diff --git a/internal/collector/vmware/vmware.go b/internal/collector/vmware/vmware.go index 2f35e9a3..95ff5a28 100644 --- a/internal/collector/vmware/vmware.go +++ b/internal/collector/vmware/vmware.go @@ -59,13 +59,13 @@ type Collector struct { memTargetSize *prometheus.Desc memUsed *prometheus.Desc - cpuLimitMHz *prometheus.Desc - cpuReservationMHz *prometheus.Desc - cpuShares *prometheus.Desc - cpuStolenTotal *prometheus.Desc - cpuTimeTotal *prometheus.Desc - cpuEffectiveVMSpeedMHz *prometheus.Desc - hostProcessorSpeedMHz *prometheus.Desc + cpuLimitHertz *prometheus.Desc + cpuReservationHertz *prometheus.Desc + cpuShares *prometheus.Desc + cpuStolenTotal *prometheus.Desc + cpuTimeTotal *prometheus.Desc + cpuEffectiveVMSpeedHertz *prometheus.Desc + hostProcessorSpeedHertz *prometheus.Desc } func New(config *Config) *Collector { @@ -111,15 +111,15 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { errs = append(errs, fmt.Errorf("failed to create VM Memory collector: %w", err)) } - c.cpuLimitMHz = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "cpu_limit_mhz"), - "The maximum processing power in MHz allowed to the virtual machine. Assigning a CPU Limit ensures that this virtual machine never consumes more than a certain amount of the available processor power. By limiting the amount of processing power consumed, a portion of the processing power becomes available to other virtual machines.", + c.cpuLimitHertz = prometheus.NewDesc( + prometheus.BuildFQName(types.Namespace, Name, "cpu_limit_hertz"), + "The maximum processing power in hertz allowed to the virtual machine. Assigning a CPU Limit ensures that this virtual machine never consumes more than a certain amount of the available processor power. By limiting the amount of processing power consumed, a portion of the processing power becomes available to other virtual machines.", nil, nil, ) - c.cpuReservationMHz = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "cpu_reservation_mhz"), - "The minimum processing power in MHz available to the virtual machine. Assigning a CPU Reservation ensures that even as other virtual machines on the same host consume shared processing power, there is still a certain minimum amount for this virtual machine.", + c.cpuReservationHertz = prometheus.NewDesc( + prometheus.BuildFQName(types.Namespace, Name, "cpu_reservation_hertz"), + "The minimum processing power in hertz available to the virtual machine. Assigning a CPU Reservation ensures that even as other virtual machines on the same host consume shared processing power, there is still a certain minimum amount for this virtual machine.", nil, nil, ) @@ -141,15 +141,15 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error { nil, nil, ) - c.cpuEffectiveVMSpeedMHz = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "cpu_effective_vm_speed_mhz_total"), - "The effective speed of the VM’s virtual CPU", + c.cpuEffectiveVMSpeedHertz = prometheus.NewDesc( + prometheus.BuildFQName(types.Namespace, Name, "cpu_effective_vm_speed_hertz"), + "The effective speed of the VM’s virtual CPU in hertz", nil, nil, ) - c.hostProcessorSpeedMHz = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "host_processor_speed_mhz"), - "Host Processor speed", + c.hostProcessorSpeedHertz = prometheus.NewDesc( + prometheus.BuildFQName(types.Namespace, Name, "host_processor_speed_hertz"), + "Host processor speed in hertz", nil, nil, ) @@ -334,15 +334,15 @@ func (c *Collector) collectCpu(ch chan<- prometheus.Metric) error { } ch <- prometheus.MustNewConstMetric( - c.cpuLimitMHz, + c.cpuLimitHertz, prometheus.GaugeValue, - c.perfDataObjectCPU[0].CPULimitMHz, + c.perfDataObjectCPU[0].CPULimitMHz*1e6, ) ch <- prometheus.MustNewConstMetric( - c.cpuReservationMHz, + c.cpuReservationHertz, prometheus.GaugeValue, - c.perfDataObjectCPU[0].CPUReservationMHz, + c.perfDataObjectCPU[0].CPUReservationMHz*1e6, ) ch <- prometheus.MustNewConstMetric( @@ -364,15 +364,15 @@ func (c *Collector) collectCpu(ch chan<- prometheus.Metric) error { ) ch <- prometheus.MustNewConstMetric( - c.cpuEffectiveVMSpeedMHz, + c.cpuEffectiveVMSpeedHertz, prometheus.GaugeValue, - c.perfDataObjectCPU[0].CPUEffectiveVMSpeedMHz, + c.perfDataObjectCPU[0].CPUEffectiveVMSpeedMHz*1e6, ) ch <- prometheus.MustNewConstMetric( - c.hostProcessorSpeedMHz, + c.hostProcessorSpeedHertz, prometheus.GaugeValue, - c.perfDataObjectCPU[0].CPUHostProcessorSpeedMHz, + c.perfDataObjectCPU[0].CPUHostProcessorSpeedMHz*1e6, ) return nil diff --git a/kubernetes/kubernetes.md b/kubernetes/kubernetes.md index 756462fb..47640176 100644 --- a/kubernetes/kubernetes.md +++ b/kubernetes/kubernetes.md @@ -72,7 +72,7 @@ kubectl --namespace monitoring port-forward svc/prometheus-k8s 9091:9090 Navigate to the Prometheus UI and add a query to see the node CPU (replace the IP address with yours) ``` -sum by (mode) (irate(windows_cpu_time_total{instance="10.1.0.5:9182"}[5m])) +sum by (mode) (irate(windows_cpu_time_seconds_total{instance="10.1.0.5:9182"}[5m])) ``` ![windows cpu total time graph in prometheus ui](https://user-images.githubusercontent.com/648372/140547130-b535c766-6479-47d3-b2d3-cd8a551647df.png) diff --git a/tools/e2e-output.txt b/tools/e2e-output.txt index 297c017c..4dec5eab 100644 --- a/tools/e2e-output.txt +++ b/tools/e2e-output.txt @@ -19,8 +19,6 @@ test_alpha_total 42 # TYPE windows_cache_data_flush_pages_total counter # HELP windows_cache_data_flushes_total (DataFlushesTotal) # TYPE windows_cache_data_flushes_total counter -# HELP windows_cache_data_map_hits_percent (DataMapHitsPercent) -# TYPE windows_cache_data_map_hits_percent gauge # HELP windows_cache_data_map_pins_total (DataMapPinsTotal) # TYPE windows_cache_data_map_pins_total counter # HELP windows_cache_data_maps_total (DataMapsTotal) @@ -61,8 +59,8 @@ test_alpha_total 42 # TYPE windows_cache_sync_pin_reads_total counter # HELP windows_cpu_clock_interrupts_total Total number of received and serviced clock tick interrupts # TYPE windows_cpu_clock_interrupts_total counter -# HELP windows_cpu_core_frequency_mhz Core frequency in megahertz -# TYPE windows_cpu_core_frequency_mhz gauge +# HELP windows_cpu_core_frequency_hertz Core frequency in hertz +# TYPE windows_cpu_core_frequency_hertz gauge # HELP windows_cpu_cstate_seconds_total Time spent in low-power idle state # TYPE windows_cpu_cstate_seconds_total counter # HELP windows_cpu_dpcs_total Total number of received and serviced deferred procedure calls (DPCs) @@ -75,10 +73,10 @@ test_alpha_total 42 # TYPE windows_cpu_info_core gauge # HELP windows_cpu_info_enabled_core Number of enabled cores per CPU # TYPE windows_cpu_info_enabled_core gauge -# HELP windows_cpu_info_l2_cache_size Size of L2 cache per CPU -# TYPE windows_cpu_info_l2_cache_size gauge -# HELP windows_cpu_info_l3_cache_size Size of L3 cache per CPU -# TYPE windows_cpu_info_l3_cache_size gauge +# HELP windows_cpu_info_l2_cache_size_bytes Size of L2 cache per CPU in bytes +# TYPE windows_cpu_info_l2_cache_size_bytes gauge +# HELP windows_cpu_info_l3_cache_size_bytes Size of L3 cache per CPU in bytes +# TYPE windows_cpu_info_l3_cache_size_bytes gauge # HELP windows_cpu_info_logical_processor Number of logical processors per CPU # TYPE windows_cpu_info_logical_processor gauge # HELP windows_cpu_info_thread Number of threads per CPU @@ -99,8 +97,8 @@ test_alpha_total 42 # TYPE windows_cpu_processor_rtc_total counter # HELP windows_cpu_processor_utility_total Processor Utility represents is the amount of time the core spends executing instructions # TYPE windows_cpu_processor_utility_total counter -# HELP windows_cpu_time_total Time that processor spent in different modes (dpc, idle, interrupt, privileged, user) -# TYPE windows_cpu_time_total counter +# HELP windows_cpu_time_seconds_total Time that processor spent in different modes (dpc, idle, interrupt, privileged, user) +# TYPE windows_cpu_time_seconds_total counter # HELP windows_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which windows_exporter was built, and the goos and goarch for the build. # TYPE windows_exporter_build_info gauge # HELP windows_exporter_collector_duration_seconds windows_exporter: Duration of a collection. @@ -323,9 +321,6 @@ windows_exporter_collector_timeout{collector="udp"} 0 # TYPE windows_physical_disk_write_seconds_total counter # HELP windows_physical_disk_writes_total The number of write operations on the disk (PhysicalDisk.DiskWritesPerSec) # TYPE windows_physical_disk_writes_total counter -# HELP windows_scheduled_task_last_result DEPRECATED: use windows_scheduled_task_last_result_status. 1 if the last result code of the registered task is zero, 0 otherwise -# TYPE windows_scheduled_task_last_result gauge -windows_scheduled_task_last_result{task="/Microsoft/Windows/PLA/GAEvents"} 0 # HELP windows_scheduled_task_last_result_status The last result status of a scheduled task, 1 if the current status, 0 otherwise # TYPE windows_scheduled_task_last_result_status gauge windows_scheduled_task_last_result_status{status="disabled",task="/Microsoft/Windows/PLA/GAEvents"} 0 @@ -397,8 +392,8 @@ windows_service_state{name="Themes",state="stopped"} 0 # TYPE windows_tcp_connections_passive_total counter # HELP windows_tcp_connections_reset_total (TCP.ConnectionsReset) # TYPE windows_tcp_connections_reset_total counter -# HELP windows_tcp_connections_state_count Number of TCP connections by state and address family -# TYPE windows_tcp_connections_state_count gauge +# HELP windows_tcp_connections Number of TCP connections by state and address family +# TYPE windows_tcp_connections gauge # HELP windows_tcp_segments_received_total (TCP.SegmentsReceivedTotal) # TYPE windows_tcp_segments_received_total counter # HELP windows_tcp_segments_retransmitted_total (TCP.SegmentsRetransmittedTotal) @@ -413,8 +408,8 @@ windows_service_state{name="Themes",state="stopped"} 0 # TYPE windows_time_clock_sync_source gauge # HELP windows_time_clock_frequency_adjustment This value reflects the adjustment made to the local system clock frequency by W32Time in nominal clock units. This counter helps visualize the finer adjustments being made by W32time to synchronize the local clock. # TYPE windows_time_clock_frequency_adjustment gauge -# HELP windows_time_clock_frequency_adjustment_ppb This value reflects the adjustment made to the local system clock frequency by W32Time in Parts Per Billion (PPB) units. 1 PPB adjustment imples the system clock was adjusted at a rate of 1 nanosecond per second. The smallest possible adjustment can vary and can be expected to be in the order of 100's of PPB. This counter helps visualize the finer actions being taken by W32time to synchronize the local clock. -# TYPE windows_time_clock_frequency_adjustment_ppb gauge +# HELP windows_time_clock_frequency_adjustment_ratio This value reflects the adjustment made to the local system clock frequency by W32Time as a ratio. Windows reports it in Parts Per Billion (PPB): an adjustment of 1e-9 implies the system clock was adjusted at a rate of 1 nanosecond per second. The smallest possible adjustment can vary and can be expected to be in the order of 100's of PPB. This counter helps visualize the finer actions being taken by W32time to synchronize the local clock. +# TYPE windows_time_clock_frequency_adjustment_ratio gauge # HELP windows_time_computed_time_offset_seconds Absolute time offset between the system clock and the chosen time source, in seconds # TYPE windows_time_computed_time_offset_seconds gauge # HELP windows_time_current_timestamp_seconds Current time as reported by the operating system, in unix time.