Skip to content

Commit

Permalink
smb: extend smb share metrics (#1765)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke authored Nov 24, 2024
1 parent 1ecc340 commit e812584
Show file tree
Hide file tree
Showing 67 changed files with 209 additions and 115 deletions.
2 changes: 1 addition & 1 deletion internal/collector/ad/ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {

var err error

c.perfDataCollector, err = perfdata.NewCollector("DirectoryServices", perfdata.InstanceAll, counters)
c.perfDataCollector, err = perfdata.NewCollector("DirectoryServices", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create DirectoryServices collector: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/adcs/adcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (c *Collector) Close() error {
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
var err error

c.perfDataCollector, err = perfdata.NewCollector("Certification Authority", perfdata.InstanceAll, []string{
c.perfDataCollector, err = perfdata.NewCollector("Certification Authority", perfdata.InstancesAll, []string{
requestsPerSecond,
requestProcessingTime,
retrievalsPerSecond,
Expand Down
4 changes: 2 additions & 2 deletions internal/collector/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (c *Collector) Close() error {
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
var err error

c.perfDataCollector, err = perfdata.NewCollector("Cache", perfdata.InstanceAll, []string{
c.perfDataCollector, err = perfdata.NewCollector("Cache", perfdata.InstancesAll, []string{
asyncCopyReadsTotal,
asyncDataMapsTotal,
asyncFastReadsTotal,
Expand Down Expand Up @@ -306,7 +306,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
return fmt.Errorf("failed to collect Cache metrics: %w", err)
}

cacheData, ok := data[perfdata.EmptyInstance]
cacheData, ok := data[perfdata.InstanceEmpty]

if !ok {
return errors.New("perflib query for Cache returned empty result set")
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {

c.mu = sync.Mutex{}

c.perfDataCollector, err = perfdata.NewCollector("Processor Information", perfdata.InstanceAll, []string{
c.perfDataCollector, err = perfdata.NewCollector("Processor Information", perfdata.InstancesAll, []string{
c1TimeSeconds,
c2TimeSeconds,
c3TimeSeconds,
Expand Down
6 changes: 3 additions & 3 deletions internal/collector/dfsr/dfsr.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
var err error

if slices.Contains(c.config.CollectorsEnabled, "connection") {
c.perfDataCollectorConnection, err = perfdata.NewCollector("DFS Replication Connections", perfdata.InstanceAll, []string{
c.perfDataCollectorConnection, err = perfdata.NewCollector("DFS Replication Connections", perfdata.InstancesAll, []string{
bandwidthSavingsUsingDFSReplicationTotal,
bytesReceivedTotal,
compressedSizeOfFilesReceivedTotal,
Expand All @@ -163,7 +163,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
}

if slices.Contains(c.config.CollectorsEnabled, "folder") {
c.perfDataCollectorFolder, err = perfdata.NewCollector("DFS Replicated Folders", perfdata.InstanceAll, []string{
c.perfDataCollectorFolder, err = perfdata.NewCollector("DFS Replicated Folders", perfdata.InstancesAll, []string{
bandwidthSavingsUsingDFSReplicationTotal,
compressedSizeOfFilesReceivedTotal,
conflictBytesCleanedUpTotal,
Expand Down Expand Up @@ -198,7 +198,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
}

if slices.Contains(c.config.CollectorsEnabled, "volume") {
c.perfDataCollectorVolume, err = perfdata.NewCollector("DFS Replication Service Volumes", perfdata.InstanceAll, []string{
c.perfDataCollectorVolume, err = perfdata.NewCollector("DFS Replication Service Volumes", perfdata.InstancesAll, []string{
databaseCommitsTotal,
databaseLookupsTotal,
usnJournalRecordsReadTotal,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/dhcp/dhcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
return fmt.Errorf("failed to collect DHCP Server metrics: %w", err)
}

data, ok := perfData[perfdata.EmptyInstance]
data, ok := perfData[perfdata.InstanceEmpty]
if !ok {
return errors.New("perflib query for DHCP Server returned empty result set")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/collector/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c *Collector) Close() error {
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
var err error

c.perfDataCollector, err = perfdata.NewCollector("DNS", perfdata.InstanceAll, []string{
c.perfDataCollector, err = perfdata.NewCollector("DNS", perfdata.InstancesAll, []string{
axfrRequestReceived,
axfrRequestSent,
axfrResponseReceived,
Expand Down Expand Up @@ -269,7 +269,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
return fmt.Errorf("failed to collect DNS metrics: %w", err)
}

data, ok := perfData[perfdata.EmptyInstance]
data, ok := perfData[perfdata.InstanceEmpty]
if !ok {
return errors.New("perflib query for DNS returned empty result set")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/exchange/exchange_active_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c *Collector) buildActiveSync() error {

var err error

c.perfDataCollectorActiveSync, err = perfdata.NewCollector("MSExchange ActiveSync", perfdata.InstanceAll, counters)
c.perfDataCollectorActiveSync, err = perfdata.NewCollector("MSExchange ActiveSync", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange ActiveSync collector: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (c *Collector) buildADAccessProcesses() error {

var err error

c.perfDataCollectorADAccessProcesses, err = perfdata.NewCollector("MSExchange ADAccess Processes", perfdata.InstanceAll, counters)
c.perfDataCollectorADAccessProcesses, err = perfdata.NewCollector("MSExchange ADAccess Processes", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange ADAccess Processes collector: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/exchange/exchange_autodiscover.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (c *Collector) buildAutoDiscover() error {

var err error

c.perfDataCollectorAutoDiscover, err = perfdata.NewCollector("MSExchange Autodiscover", perfdata.InstanceAll, counters)
c.perfDataCollectorAutoDiscover, err = perfdata.NewCollector("MSExchange Autodiscover", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange Autodiscover collector: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (c *Collector) buildAvailabilityService() error {

var err error

c.perfDataCollectorAvailabilityService, err = perfdata.NewCollector("MSExchange Availability Service", perfdata.InstanceAll, counters)
c.perfDataCollectorAvailabilityService, err = perfdata.NewCollector("MSExchange Availability Service", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange Availability Service collector: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/exchange/exchange_http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *Collector) buildHTTPProxy() error {

var err error

c.perfDataCollectorHttpProxy, err = perfdata.NewCollector("MSExchange HttpProxy", perfdata.InstanceAll, counters)
c.perfDataCollectorHttpProxy, err = perfdata.NewCollector("MSExchange HttpProxy", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange HttpProxy collector: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/exchange/exchange_mapi_http_emsmdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (c *Collector) buildMapiHttpEmsmdb() error {

var err error

c.perfDataCollectorMapiHttpEmsmdb, err = perfdata.NewCollector("MSExchange MapiHttp Emsmdb", perfdata.InstanceAll, counters)
c.perfDataCollectorMapiHttpEmsmdb, err = perfdata.NewCollector("MSExchange MapiHttp Emsmdb", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange MapiHttp Emsmdb: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/exchange/exchange_outlook_web_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (c *Collector) buildOWA() error {

var err error

c.perfDataCollectorOWA, err = perfdata.NewCollector("MSExchange OWA", perfdata.InstanceAll, counters)
c.perfDataCollectorOWA, err = perfdata.NewCollector("MSExchange OWA", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange OWA collector: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/exchange/exchange_rpc_client_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *Collector) buildRPC() error {

var err error

c.perfDataCollectorRpcClientAccess, err = perfdata.NewCollector("MSExchange RpcClientAccess", perfdata.InstanceAll, counters)
c.perfDataCollectorRpcClientAccess, err = perfdata.NewCollector("MSExchange RpcClientAccess", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange RpcClientAccess collector: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/exchange/exchange_transport_queues.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c *Collector) buildTransportQueues() error {

var err error

c.perfDataCollectorTransportQueues, err = perfdata.NewCollector("MSExchangeTransport Queues", perfdata.InstanceAll, counters)
c.perfDataCollectorTransportQueues, err = perfdata.NewCollector("MSExchangeTransport Queues", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchangeTransport Queues collector: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (c *Collector) buildWorkloadManagementWorkloads() error {

var err error

c.perfDataCollectorWorkloadManagementWorkloads, err = perfdata.NewCollector("MSExchange WorkloadManagement Workloads", perfdata.InstanceAll, counters)
c.perfDataCollectorWorkloadManagementWorkloads, err = perfdata.NewCollector("MSExchange WorkloadManagement Workloads", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create MSExchange WorkloadManagement Workloads collector: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/hyperv/hyperv_datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/hyperv/hyperv_dynamic_memory_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/hyperv/hyperv_legacy_network_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/hyperv/hyperv_virtual_smb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/hyperv/hyperv_virtual_storage_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/hyperv/hyperv_virtual_switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/iis/iis_app_pool_was.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var applicationStates = map[uint32]string{
func (c *Collector) buildAppPoolWAS() error {
var err error

c.perfDataCollectorAppPoolWAS, err = perfdata.NewCollector("APP_POOL_WAS", perfdata.InstanceAll, []string{
c.perfDataCollectorAppPoolWAS, err = perfdata.NewCollector("APP_POOL_WAS", perfdata.InstancesAll, []string{
CurrentApplicationPoolState,
CurrentApplicationPoolUptime,
CurrentWorkerProcesses,
Expand Down
5 changes: 2 additions & 3 deletions internal/collector/iis/iis_w3svc_w3wp.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (c *Collector) buildW3SVCW3WP() error {

var err error

c.perfDataCollectorW3SVCW3WP, err = perfdata.NewCollector("W3SVC_W3WP", perfdata.InstanceAll, counters)
c.perfDataCollectorW3SVCW3WP, err = perfdata.NewCollector("W3SVC_W3WP", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create W3SVC_W3WP collector: %w", err)
}
Expand Down Expand Up @@ -432,8 +432,7 @@ func (c *Collector) collectW3SVCW3WP(ch chan<- prometheus.Metric) error {
pid := workerProcessNameExtractor.ReplaceAllString(name, "$1")

name := workerProcessNameExtractor.ReplaceAllString(name, "$2")
if name == "" || name == "_Total" ||
c.config.AppExclude.MatchString(name) ||
if name == "" || c.config.AppExclude.MatchString(name) ||
!c.config.AppInclude.MatchString(name) {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/iis/iis_web_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const (
func (c *Collector) buildWebService() error {
var err error

c.perfDataCollectorWebService, err = perfdata.NewCollector("Web Service", perfdata.InstanceAll, []string{
c.perfDataCollectorWebService, err = perfdata.NewCollector("Web Service", perfdata.InstancesAll, []string{
CurrentAnonymousUsers,
CurrentBlockedAsyncIORequests,
CurrentCGIRequests,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/iis/iis_web_service_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const (
func (c *Collector) buildWebServiceCache() error {
var err error

c.perfDataCollectorWebService, err = perfdata.NewCollector("Web Service Cache", perfdata.InstanceAll, []string{
c.perfDataCollectorWebService, err = perfdata.NewCollector("Web Service Cache", perfdata.InstancesAll, []string{
ServiceCacheActiveFlushedEntries,
ServiceCacheCurrentFileCacheMemoryUsage,
ServiceCacheMaximumFileCacheMemoryUsage,
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/logical_disk/logical_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {

var err error

c.perfDataCollector, err = perfdata.NewCollector("LogicalDisk", perfdata.InstanceAll, []string{
c.perfDataCollector, err = perfdata.NewCollector("LogicalDisk", perfdata.InstancesAll, []string{
currentDiskQueueLength,
avgDiskReadQueueLength,
avgDiskWriteQueueLength,
Expand Down
4 changes: 2 additions & 2 deletions internal/collector/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {

var err error

c.perfDataCollector, err = perfdata.NewCollector("Memory", perfdata.InstanceAll, counters)
c.perfDataCollector, err = perfdata.NewCollector("Memory", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create Memory collector: %w", err)
}
Expand Down Expand Up @@ -414,7 +414,7 @@ func (c *Collector) collectPDH(ch chan<- prometheus.Metric) error {
return fmt.Errorf("failed to collect Memory metrics: %w", err)
}

data, ok := perfData[perfdata.EmptyInstance]
data, ok := perfData[perfdata.InstanceEmpty]

if !ok {
return errors.New("perflib query for Memory returned empty result set")
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/mssql/mssql_access_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func (c *Collector) collectAccessMethodsInstance(ch chan<- prometheus.Metric, sq
return fmt.Errorf("failed to collect %s metrics: %w", c.mssqlGetPerfObjectName(sqlInstance, "AccessMethods"), err)
}

data, ok := perfData[perfdata.EmptyInstance]
data, ok := perfData[perfdata.InstanceEmpty]
if !ok {
return fmt.Errorf("perflib query for %s returned empty result set", c.mssqlGetPerfObjectName(sqlInstance, "AccessMethods"))
}
Expand Down
Loading

0 comments on commit e812584

Please sign in to comment.