smb: extend smb share metrics (#1765)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2024-11-24 13:18:14 +01:00
committed by GitHub
parent 1ecc340659
commit e812584f27
67 changed files with 209 additions and 115 deletions

View File

@@ -114,7 +114,7 @@ const (
func (c *Collector) buildDataStore() error {
var err error
c.perfDataCollectorDataStore, err = perfdata.NewCollector("Hyper-V DataStore", perfdata.InstanceAll, []string{
c.perfDataCollectorDataStore, err = perfdata.NewCollector("Hyper-V DataStore", perfdata.InstancesAll, []string{
dataStoreFragmentationRatio,
dataStoreSectorSize,
dataStoreDataAlignment,

View File

@@ -30,7 +30,7 @@ func (c *Collector) buildDynamicMemoryBalancer() error {
var err error
// https://learn.microsoft.com/en-us/archive/blogs/chrisavis/monitoring-dynamic-memory-in-windows-server-hyper-v-2012
c.perfDataCollectorDynamicMemoryBalancer, err = perfdata.NewCollector("Hyper-V Dynamic Memory Balancer", perfdata.InstanceAll, []string{
c.perfDataCollectorDynamicMemoryBalancer, err = perfdata.NewCollector("Hyper-V Dynamic Memory Balancer", perfdata.InstancesAll, []string{
vmDynamicMemoryBalancerAvailableMemory,
vmDynamicMemoryBalancerAvailableMemoryForBalancing,
vmDynamicMemoryBalancerAveragePressure,

View File

@@ -42,7 +42,7 @@ const (
func (c *Collector) buildDynamicMemoryVM() error {
var err error
c.perfDataCollectorDynamicMemoryVM, err = perfdata.NewCollector("Hyper-V Dynamic Memory VM", perfdata.InstanceAll, []string{
c.perfDataCollectorDynamicMemoryVM, err = perfdata.NewCollector("Hyper-V Dynamic Memory VM", perfdata.InstancesAll, []string{
vmMemoryAddedMemory,
vmMemoryCurrentPressure,
vmMemoryGuestVisiblePhysicalMemory,

View File

@@ -32,7 +32,7 @@ const (
func (c *Collector) buildHypervisorLogicalProcessor() error {
var err error
c.perfDataCollectorHypervisorLogicalProcessor, err = perfdata.NewCollector("Hyper-V Hypervisor Logical Processor", perfdata.InstanceAll, []string{
c.perfDataCollectorHypervisorLogicalProcessor, err = perfdata.NewCollector("Hyper-V Hypervisor Logical Processor", perfdata.InstancesAll, []string{
hypervisorLogicalProcessorGuestRunTimePercent,
hypervisorLogicalProcessorHypervisorRunTimePercent,
hypervisorLogicalProcessorTotalRunTimePercent,

View File

@@ -35,7 +35,7 @@ const (
func (c *Collector) buildHypervisorRootVirtualProcessor() error {
var err error
c.perfDataCollectorHypervisorRootVirtualProcessor, err = perfdata.NewCollector("Hyper-V Hypervisor Root Virtual Processor", perfdata.InstanceAll, []string{
c.perfDataCollectorHypervisorRootVirtualProcessor, err = perfdata.NewCollector("Hyper-V Hypervisor Root Virtual Processor", perfdata.InstancesAll, []string{
hypervisorRootVirtualProcessorGuestIdleTimePercent,
hypervisorRootVirtualProcessorGuestRunTimePercent,
hypervisorRootVirtualProcessorHypervisorRunTimePercent,

View File

@@ -35,7 +35,7 @@ const (
func (c *Collector) buildHypervisorVirtualProcessor() error {
var err error
c.perfDataCollectorHypervisorVirtualProcessor, err = perfdata.NewCollector("Hyper-V Hypervisor Virtual Processor", perfdata.InstanceAll, []string{
c.perfDataCollectorHypervisorVirtualProcessor, err = perfdata.NewCollector("Hyper-V Hypervisor Virtual Processor", perfdata.InstancesAll, []string{
hypervisorVirtualProcessorGuestRunTimePercent,
hypervisorVirtualProcessorGuestIdleTimePercent,
hypervisorVirtualProcessorHypervisorRunTimePercent,

View File

@@ -33,7 +33,7 @@ const (
func (c *Collector) buildLegacyNetworkAdapter() error {
var err error
c.perfDataCollectorLegacyNetworkAdapter, err = perfdata.NewCollector("Hyper-V Legacy Network Adapter", perfdata.InstanceAll, []string{
c.perfDataCollectorLegacyNetworkAdapter, err = perfdata.NewCollector("Hyper-V Legacy Network Adapter", perfdata.InstancesAll, []string{
legacyNetworkAdapterBytesDropped,
legacyNetworkAdapterBytesReceived,
legacyNetworkAdapterBytesSent,

View File

@@ -51,7 +51,7 @@ func (c *Collector) collectVirtualMachineHealthSummary(ch chan<- prometheus.Metr
return fmt.Errorf("failed to collect Hyper-V Virtual Machine Health Summary metrics: %w", err)
}
healthData, ok := data[perfdata.EmptyInstance]
healthData, ok := data[perfdata.InstanceEmpty]
if !ok {
return errors.New("no data returned for Hyper-V Virtual Machine Health Summary")
}

View File

@@ -26,7 +26,7 @@ const (
func (c *Collector) buildVirtualMachineVidPartition() error {
var err error
c.perfDataCollectorVirtualMachineVidPartition, err = perfdata.NewCollector("Hyper-V VM Vid Partition", perfdata.InstanceAll, []string{
c.perfDataCollectorVirtualMachineVidPartition, err = perfdata.NewCollector("Hyper-V VM Vid Partition", perfdata.InstancesAll, []string{
physicalPagesAllocated,
preferredNUMANodeIndex,
remotePhysicalPages,

View File

@@ -33,7 +33,7 @@ const (
func (c *Collector) buildVirtualNetworkAdapter() error {
var err error
c.perfDataCollectorVirtualNetworkAdapter, err = perfdata.NewCollector("Hyper-V Virtual Network Adapter", perfdata.InstanceAll, []string{
c.perfDataCollectorVirtualNetworkAdapter, err = perfdata.NewCollector("Hyper-V Virtual Network Adapter", perfdata.InstancesAll, []string{
virtualNetworkAdapterBytesReceived,
virtualNetworkAdapterBytesSent,
virtualNetworkAdapterDroppedPacketsIncoming,

View File

@@ -148,7 +148,7 @@ const (
func (c *Collector) buildVirtualNetworkAdapterDropReasons() error {
var err error
c.perfDataCollectorVirtualNetworkAdapterDropReasons, err = perfdata.NewCollector("Hyper-V Virtual Network Adapter Drop Reasons", perfdata.InstanceAll, []string{
c.perfDataCollectorVirtualNetworkAdapterDropReasons, err = perfdata.NewCollector("Hyper-V Virtual Network Adapter Drop Reasons", perfdata.InstancesAll, []string{
virtualNetworkAdapterDropReasonsOutgoingNativeFwdingReq,
virtualNetworkAdapterDropReasonsIncomingNativeFwdingReq,
virtualNetworkAdapterDropReasonsOutgoingMTUMismatch,

View File

@@ -55,7 +55,7 @@ const (
func (c *Collector) buildVirtualSMB() error {
var err error
c.perfDataCollectorVirtualSMB, err = perfdata.NewCollector("Hyper-V Virtual SMB", perfdata.InstanceAll, []string{
c.perfDataCollectorVirtualSMB, err = perfdata.NewCollector("Hyper-V Virtual SMB", perfdata.InstancesAll, []string{
virtualSMBDirectMappedSections,
virtualSMBDirectMappedPages,
virtualSMBWriteBytesRDMA,

View File

@@ -45,7 +45,7 @@ const (
func (c *Collector) buildVirtualStorageDevice() error {
var err error
c.perfDataCollectorVirtualStorageDevice, err = perfdata.NewCollector("Hyper-V Virtual Storage Device", perfdata.InstanceAll, []string{
c.perfDataCollectorVirtualStorageDevice, err = perfdata.NewCollector("Hyper-V Virtual Storage Device", perfdata.InstancesAll, []string{
virtualStorageDeviceErrorCount,
virtualStorageDeviceQueueLength,
virtualStorageDeviceReadBytes,

View File

@@ -62,7 +62,7 @@ const (
func (c *Collector) buildVirtualSwitch() error {
var err error
c.perfDataCollectorVirtualSwitch, err = perfdata.NewCollector("Hyper-V Virtual Switch", perfdata.InstanceAll, []string{
c.perfDataCollectorVirtualSwitch, err = perfdata.NewCollector("Hyper-V Virtual Switch", perfdata.InstancesAll, []string{
virtualSwitchBroadcastPacketsReceived,
virtualSwitchBroadcastPacketsSent,
virtualSwitchBytes,