Draft
hyperv: add Hyper-V Replication metrics subcollector#2481
Conversation
4 tasks
- Add NamespaceRootVirtualizationV2 to internal/mi/types.go - Create hyperv_replica.go with performance counter and WMI metrics for Hyper-V replication (health, state, size, latency, etc.) - Register replica subcollector in hyperv.go Build function Co-authored-by: jkroepke <1560587+jkroepke@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Hyper-V replication metrics collection
feat(hyperv): add Hyper-V Replication metrics subcollector
Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
hypervcollector had no support for Hyper-V Replication metrics, forcing users to combineperformancecounterconfigs and custom PowerShell/textfile collectors to monitor replication health and state.Changes
internal/mi/types.goNamespaceRootVirtualizationV2(root/virtualization/v2) namespace constantinternal/collector/hyperv/hyperv_replica.go(new)New
replicasubcollector collecting two data sources:Hyper-V Replica VMperf counters (per-VM labels):windows_hyperv_replica_compression_efficiencywindows_hyperv_replica_resynchronized_bytes_totalwindows_hyperv_replica_network_bytes_recv_totalwindows_hyperv_replica_network_bytes_sent_totalwindows_hyperv_replica_average_replication_latency_secondswindows_hyperv_replica_replication_latency_secondswindows_hyperv_replica_replication_count_totalwindows_hyperv_replica_average_replication_size_byteswindows_hyperv_replica_last_replication_size_bytesroot/virtualization/v2\Msvm_ReplicationRelationshipWMI (per-VM labels):windows_hyperv_replica_healthwindows_hyperv_replica_stateinternal/collector/hyperv/hyperv.goBuildnow accepts and forwardsmiSession(was discarded with_)replicasubcollector registered and enabled by default inConfigDefaultscollectorReplicaembedded inCollector