Skip to content

Fix Windows monitoring for windows_exporter v0.31 and OTel Collector v0.127+ - #14117

Closed
wu-sheng wants to merge 1 commit into
masterfrom
fix/windows-exporter-current-versions
Closed

wu-sheng wants to merge 1 commit into
masterfrom
fix/windows-exporter-current-versions

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Windows host monitoring breaks with current versions of both pieces the documented setup uses.

windows_exporter v0.31.0 removed the memory metrics windows.yaml read

windows_cs_physical_memory_bytes, windows_os_physical_memory_free_bytes, windows_os_virtual_memory_bytes and windows_os_virtual_memory_free_bytes were deprecated in v0.29.0 and removed in v0.31.0 (prometheus-community/windows_exporter#2115, #2116). Every meter_win_memory_* of the windows_exporter source is empty on v0.31.x. The rule now reads the replacements the exporter's deprecation notes name: windows_memory_physical_total_bytes, windows_memory_physical_free_bytes, windows_memory_commit_limit and windows_memory_committed_bytes. They are in the default memory collector since v0.29.0, which the doc now states as the minimum.

meter_win_cpu_total_percentage counted interrupt and DPC time twice

The rule summed every mode but idle. Windows' % Privileged Time, which is windows_exporter's privileged mode, already includes % Interrupt Time and % DPC Time (Processor object). Busy time is now user + privileged.

OTel Collector v0.127.0+ sends no net.host.name

The Prometheus receiver puts a target's host in server.address only from v0.127.0 (feature gate receiver.prometheusreceiver.RemoveLegacyResourceAttributes, beta in v0.127, legacy code removed in v0.129). OAP mapped only net.host.name / host.name to node_identifier_host_name, so vm.yaml and windows.yaml got no host and created no service. The OTel receiver now falls back to server.address when neither is present, which gives the same label and value older Collectors produced. The e2e pins Collector 0.102.1, which is why CI did not see it.

Checked against real output, not only source

windows_exporter v0.31.8, v0.31.0 and v0.30.9 were run on a GitHub-hosted windows-latest runner with default collectors, together with OTel Collector contrib 0.158.0:

  • v0.31.x: the four old metrics are absent and the four new ones present; v0.30.9 has both, with identical values. The new ones match Win32_ComputerSystem.TotalPhysicalMemory and the \Memory\Commit Limit / \Committed Bytes / \Available Bytes counters.
  • Over 61 s under load, per core: idle + user + privileged = 1.0000 s/s, all five modes = 1.005–1.009 s/s.
  • The Collector sent server.address, server.port, url.scheme, and no net.host.name.
  • The documented Collector config (logging exporter) fails otelcol-contrib validate on 0.158.0; it now uses debug.

Tests

  • The Windows e2e replays that recording (windows_exporter v0.31.8 through Collector 0.158.0, the nine metrics the rule reads, unmodified otherwise) instead of the 2023 mock data in the old names, and checks all six memory metrics. The e2e mock sender's OTLP proto is updated to v1.11.1 so its strict JSON parser accepts the recording; every existing mock file still parses.

  • windows.data.yaml feeds the new metrics plus privileged / interrupt / dpc modes, and asserts the new values. MALExpressionExecutionTest (1427) passes locally.

  • OpenTelemetryMetricRequestProcessorTest covers server.address alone, and host.name / net.host.name winning over it.

  • Update the CHANGES log.

…v0.127+

- windows.yaml reads windows_exporter's memory collector
  (windows_memory_physical_total_bytes, _physical_free_bytes,
  _commit_limit, _committed_bytes). v0.31.0 removed the cs collector and
  the os collector's memory metrics it read, so every meter_win_memory_*
  of the windows_exporter source was empty. The new metrics carry the
  same values and are default since v0.29.0, now the documented minimum.
- meter_win_cpu_total_percentage counts user + privileged for
  windows_exporter: Windows' % Privileged Time already includes interrupt
  and DPC time, which the rule counted a second time.
- The OpenTelemetry receiver takes node_identifier_host_name from
  server.address when neither net.host.name nor host.name is present.
  The Collector's Prometheus receiver sends only server.address from
  v0.127.0, so vm.yaml and windows.yaml got no host and no service.
- The Windows e2e replays a recording of windows_exporter v0.31.8 through
  OTel Collector 0.158.0, taken on a GitHub-hosted Windows runner, and
  checks every memory metric. The e2e mock sender's OTLP proto is updated
  to v1.11.1 so it parses that recording.
- The documented Collector config uses the debug exporter; the logging
  exporter no longer exists.
@wu-sheng

Copy link
Copy Markdown
Member Author

Folded into #14116, which already carried the same windows.yaml fix. The receiver's server.address fallback, the real windows_exporter 0.31.8 recording in the win e2e, the mock sender's OTLP proto update and the Collector config fix are now part of it.

@wu-sheng wu-sheng closed this Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant