mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-18 18:49:05 +02:00
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2.6 KiB
2.6 KiB
mscluster agent notes
- All subcollectors read through ClusAPI
(
internal/headers/clusapi) instead of theroot\MSClusterWMI provider (ClusWMI.dll). The WMI provider is a thin layer over ClusAPI: most WMI properties are common properties fromCLUSCTL_<OBJECT>_GET_RO_COMMON_PROPERTIESandCLUSCTL_<OBJECT>_GET_COMMON_PROPERTIES;Characteristics,FlagsandStatecome from their own control codes andGetCluster<Object>State. Some WMI values are synthesized or never filled (published as 0 from NULL); the parity tests show which ones, and the collector reproduces them. - Keep WMI types when publishing:
sint32properties (for exampleFailbackWindowStart) are converted from the raw 32-bit value withint32,uint32properties keep the unsigned bit pattern. Unknown states (-1) are values, as in WMI, not errors. - Each subcollector owns its own
clusapi.Cluster. AClusterruns one call at a time without holding its lock: ClusAPI RPCs cannot be cancelled, so a second call fails withclusapi.ErrBusy, andCloseleaves the handle to the running call.callSourcestops waiting at the scrape budget, so one stuck RPC does not holdCollectand the other subcollectors. closeSourcesdrops a source even when itsClosefails, soBuildcan recreate it. Grafana Alloy callsBuild/Closerepeatedly.- Every subcollector has a fixture test that checks gathered metric families
and a parity test against its WMI class. The CI cluster (
setup-msclusterin.github/workflows/ci.yml) is a single node without storage or administrative access point. It has online, offline and failed resources in two groups (CIResources,CIFailedResources) on a private network of an internal Hyper-V switch; the parity tests require them. It has no clustered disks, so shared volume parity still compares empty sets. - Property lists returned by the cluster service end with an extra
CLUSPROP_SYNTAX_ENDMARKafter the last value list; fixtures built only from the documentation miss this. The parser validates only the structure and accepts zero padding.TestDumpPropertyListslogs real lists as hex whenWINDOWS_EXPORTER_TEST_CLUSAPI_DUMPis set on a cluster node. clusapi.Openreports an unconfigured cluster or a missing ClusAPI witherrors.ErrUnsupported; the shared collector test treats that as an unsupported role on hosts wheremsclusteris not a required fixture.- Use
ClusterOpenEnumand theOpen*Exfunctions (Windows Server 2008 R2+), notClusterOpenEnumEx(Windows Server 2016+), to keep Windows Server 2012 R2 support.