Changelog

May 22, 2026 · View on GitHub

All notable changes to this project will be documented in this file.

Upcoming Breaking Change — scheduled ≥ 2026-08-15

Legacy LHM metric names of the form hardware_<type>_<sensor_type>_<name> will be removed in a release tagged on or after 2026-08-15. After removal, only the Prometheus-conventional aliases will be emitted:

Old (removed)New (kept)
hardware_storage_throughput_read_ratehardware_storage_read_rate_bytes_per_second
hardware_storage_throughput_write_ratehardware_storage_write_rate_bytes_per_second
hardware_storage_data_read (in GB)hardware_storage_data_read_bytes (in bytes)
hardware_storage_data_written (in GB)hardware_storage_data_written_bytes (in bytes)
hardware_memory_data_memory_used (in GB)hardware_memory_used_bytes (in bytes)
hardware_memory_data_memory_availablehardware_memory_available_bytes
hardware_memory_data_virtual_memory_usedhardware_memory_virtual_memory_used_bytes
hardware_memory_data_virtual_memory_availablehardware_memory_virtual_memory_available_bytes
hardware_network_throughput_download_speedhardware_network_download_speed_bytes_per_second
hardware_network_throughput_upload_speedhardware_network_upload_speed_bytes_per_second
hardware_network_data_downloaded (in GB)hardware_network_downloaded_bytes (in bytes)
hardware_network_data_uploaded (in GB)hardware_network_uploaded_bytes (in bytes)
hardware_gpu_throughput_gpu_pcie_rxhardware_gpu_pcie_rx_bytes_per_second
hardware_gpu_throughput_gpu_pcie_txhardware_gpu_pcie_tx_bytes_per_second

Sensors that do not carry a unit (temperature, voltage, power, clock, fan, load, level, factor) are unaffected — their legacy form is the only form and will continue to be emitted unchanged.

How to prepare

  1. Update Prometheus / Grafana to use the new alias names. The bundled docs/grafana-dashboard.json was migrated to aliases on 2026-05-08; re-import it to refresh existing deploys.
  2. Audit any custom dashboards or alert rules with this Prometheus query:
    {__name__=~"hardware_(storage|memory|network|gpu)_(throughput|data)_.*"}
    
    Any series this returns is on a name that will go away.
  3. Once everything looks good, set HardwareMonitor:EmitLegacyMetricNames=false in appsettings.json to preview the post-removal /metrics. If something you care about disappears, you missed a migration step somewhere.

[Unreleased]

Added

  • Configuration support via appsettings.json
  • Ability to enable/disable specific hardware monitoring components
  • Structured logging with ILogger
  • Comprehensive error handling
  • Detailed README with installation and configuration instructions
  • XML documentation comments for public APIs

Changed

  • BREAKING: Refactored to use singleton pattern for Computer instance (major performance improvement)
  • Renamed Y.cs to HardwareMonitorBackgroundService.cs for clarity
  • Refactored MetricsController to use dependency injection
  • Improved metric name processing with better documentation
  • Made HTTPS redirection optional (disabled by default for internal networks)
  • Updated default port to 9888 (avoids conflict with windows_exporter on 9182)
  • The MSI now registers, starts, stops and removes the Windows service itself via Windows Installer ServiceInstall/ServiceControl instead of a New-Service call in install.ps1. install.ps1 still performs full service registration for standalone (zip) installs.

Fixed

  • Performance issue: Computer instance is now initialized once instead of on every request
  • Thread safety: Added semaphore lock for hardware updates
  • Memory leaks: Proper disposal of Computer instance
  • The MSI is now built as a 64-bit package (wix build -arch x64 + ProgramFiles6432Folder) so it installs straight to C:\Program Files. The previous x86 package installed to C:\Program Files (x86) and install.ps1 relocated the files, leaving a ~110 MB orphan directory behind.
  • MSI upgrades no longer need a reboot to replace HardwareExporterWindows.exe: the installer stops the service (at StopServices, before InstallFiles) prior to overwriting files.
  • msiexec /x (uninstall) now removes the HardwareExporter service instead of leaving it registered against a deleted executable.
  • The inbound firewall rule is removed-then-recreated on each install so repeated installs/upgrades no longer accumulate duplicate rules.

Technical Improvements

  • Added HardwareMonitorService as a hosted service
  • Introduced HardwareMonitorOptions configuration class
  • Better separation of concerns
  • Improved code readability with XML comments
  • Added async/await pattern where appropriate

Testing Required

Before merging, please test on Windows:

  1. ✅ Service starts successfully
  2. ✅ Metrics endpoint returns data: http://localhost:9888/metrics
  3. ✅ Configuration changes are respected (try disabling GPU monitoring)
  4. ✅ Service runs stably for extended period
  5. ✅ Memory usage remains stable (no leaks)
  6. ✅ CPU usage is low when idle
  7. ✅ Prometheus can scrape the metrics successfully

[Previous Versions]

See git history for previous changes.