feat: Remove init functions from collectors

Behaviour of init functions has been centralised in `collector/init.go`,
and can be called during exporter startup. This allows the exporter to
control the timing of collector initialisation, rather than relying on
the import & `init()` method.

This should reduce unexpected behaviour arising from the use of
`init()`, such as #551.

Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
Ben Reedy
2022-12-21 15:37:14 +10:00
parent 8132083892
commit 9214a87d0d
52 changed files with 312 additions and 223 deletions

View File

@@ -11,10 +11,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("ad", NewADCollector)
}
// A ADCollector is a Prometheus collector for WMI Win32_PerfRawData_DirectoryServices_DirectoryServices metrics
type ADCollector struct {
AddressBookOperationsTotal *prometheus.Desc

View File

@@ -10,10 +10,6 @@ import (
"strings"
)
func init() {
registerCollector("adcs", adcsCollectorMethod, "Certification Authority")
}
type adcsCollector struct {
RequestsPerSecond *prometheus.Desc
RequestProcessingTime *prometheus.Desc

View File

@@ -8,10 +8,6 @@ import (
"math"
)
func init() {
registerCollector("adfs", newADFSCollector, "AD FS")
}
type adfsCollector struct {
adLoginConnectionFailures *prometheus.Desc
certificateAuthentications *prometheus.Desc

View File

@@ -8,10 +8,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("cache", newCacheCollector, "Cache")
}
// A CacheCollector is a Prometheus collector for Perflib Cache metrics
type CacheCollector struct {
AsyncCopyReadsTotal *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("container", NewContainerMetricsCollector)
}
// A ContainerMetricsCollector is a Prometheus collector for containers metrics
type ContainerMetricsCollector struct {
// Presence

View File

@@ -9,17 +9,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
var deps string
// See below for 6.05 magic value
if getWindowsVersion() > 6.05 {
deps = "Processor Information"
} else {
deps = "Processor"
}
registerCollector("cpu", newCPUCollector, deps)
}
type cpuCollectorBasic struct {
CStateSecondsTotal *prometheus.Desc
TimeTotal *prometheus.Desc

View File

@@ -13,10 +13,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("cpu_info", newCpuInfoCollector)
}
// If you are adding additional labels to the metric, make sure that they get added in here as well. See below for explanation.
const (
win32ProcessorQuery = "SELECT Architecture, DeviceId, Description, Family, L2CacheSize, L3CacheSize, Name FROM Win32_Processor"

View File

@@ -10,10 +10,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("cs", NewCSCollector)
}
// A CSCollector is a Prometheus collector for WMI metrics
type CSCollector struct {
PhysicalMemoryBytes *prometheus.Desc

View File

@@ -11,16 +11,6 @@ import (
var dfsrEnabledCollectors = kingpin.Flag("collectors.dfsr.sources-enabled", "Comma-seperated list of DFSR Perflib sources to use.").Default("connection,folder,volume").String()
func init() {
// Perflib sources are dynamic, depending on the enabled child collectors
var perflibDependencies []string
for _, source := range expandEnabledChildCollectors(*dfsrEnabledCollectors) {
perflibDependencies = append(perflibDependencies, dfsrGetPerfObjectName(source))
}
registerCollector("dfsr", NewDFSRCollector, perflibDependencies...)
}
// DFSRCollector contains the metric and state data of the DFSR collectors.
type DFSRCollector struct {
// Connection source

View File

@@ -7,10 +7,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("dhcp", NewDhcpCollector, "DHCP Server")
}
// A DhcpCollector is a Prometheus collector perflib DHCP metrics
type DhcpCollector struct {
PacketsReceivedTotal *prometheus.Desc

View File

@@ -12,10 +12,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("disk_drive", newDiskDriveInfoCollector)
}
const (
win32DiskQuery = "SELECT DeviceID, Model, Caption, Name, Partitions, Size, Status, Availability FROM WIN32_DiskDrive"
)

View File

@@ -11,10 +11,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("dns", NewDNSCollector)
}
// A DNSCollector is a Prometheus collector for WMI Win32_PerfRawData_DNS_DNS metrics
type DNSCollector struct {
ZoneTransferRequestsReceived *prometheus.Desc

View File

@@ -13,20 +13,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("exchange", newExchangeCollector,
"MSExchange ADAccess Processes",
"MSExchangeTransport Queues",
"MSExchange HttpProxy",
"MSExchange ActiveSync",
"MSExchange Availability Service",
"MSExchange OWA",
"MSExchangeAutodiscover",
"MSExchange WorkloadManagement Workloads",
"MSExchange RpcClientAccess",
)
}
type exchangeCollector struct {
LDAPReadTime *prometheus.Desc
LDAPSearchTime *prometheus.Desc

View File

@@ -6,10 +6,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("fsrmquota", newFSRMQuotaCollector)
}
type FSRMQuotaCollector struct {
QuotasCount *prometheus.Desc
Path *prometheus.Desc

View File

@@ -11,10 +11,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("hyperv", NewHyperVCollector)
}
// HyperVCollector is a Prometheus collector for hyper-v
type HyperVCollector struct {
// Win32_PerfRawData_VmmsVirtualMachineStats_HyperVVirtualMachineHealthSummary

View File

@@ -13,10 +13,6 @@ import (
"golang.org/x/sys/windows/registry"
)
func init() {
registerCollector("iis", NewIISCollector, "Web Service", "APP_POOL_WAS", "Web Service Cache", "W3SVC_W3WP")
}
var (
siteWhitelist = kingpin.Flag("collector.iis.site-whitelist", "Regexp of sites to whitelist. Site name must both match whitelist and not match blacklist to be included.").Default(".+").String()
siteBlacklist = kingpin.Flag("collector.iis.site-blacklist", "Regexp of sites to blacklist. Site name must both match whitelist and not match blacklist to be included.").String()

309
collector/init.go Normal file
View File

@@ -0,0 +1,309 @@
package collector
// collectorInit represents the required initialisation config for a collector.
type collectorInit struct {
// Name of collector to be initialised
name string
// Builder function for the collector
builder collectorBuilder
// Perflib counter names for the collector.
// These will be included in the Perflib scrape scope by the exporter.
perfCounterNames []string
}
func getCPUCollectorDeps() string {
// See below for 6.05 magic value
if getWindowsVersion() > 6.05 {
return "Processor Information"
}
return "Processor"
}
func getDFSRCollectorDeps() []string {
// Perflib sources are dynamic, depending on the enabled child collectors
var perflibDependencies []string
for _, source := range expandEnabledChildCollectors(*dfsrEnabledCollectors) {
perflibDependencies = append(perflibDependencies, dfsrGetPerfObjectName(source))
}
return perflibDependencies
}
var collectors = []collectorInit{
{
name: "ad",
builder: NewADCollector,
perfCounterNames: nil,
},
{
name: "adcs",
builder: adcsCollectorMethod,
perfCounterNames: []string{"Certification Authority"},
},
{
name: "adfs",
builder: newADFSCollector,
perfCounterNames: []string{"AD FS"},
},
{
name: "cache",
builder: newCacheCollector,
perfCounterNames: []string{"Cache"},
},
{
name: "container",
builder: NewContainerMetricsCollector,
perfCounterNames: nil,
},
{
name: "cpu",
builder: newCPUCollector,
perfCounterNames: []string{getCPUCollectorDeps()},
},
{
name: "cpu_info",
builder: newCpuInfoCollector,
perfCounterNames: nil,
},
{
name: "cs",
builder: NewCSCollector,
perfCounterNames: nil,
},
{
name: "dfsr",
builder: NewDFSRCollector,
perfCounterNames: getDFSRCollectorDeps(),
},
{
name: "dhcp",
builder: NewDhcpCollector,
perfCounterNames: nil,
},
{
name: "disk_drive",
builder: newDiskDriveInfoCollector,
perfCounterNames: nil,
},
{
name: "dns",
builder: NewDNSCollector,
perfCounterNames: nil,
},
{
name: "exchange",
builder: newExchangeCollector,
perfCounterNames: []string{
"MSExchange ADAccess Processes",
"MSExchangeTransport Queues",
"MSExchange HttpProxy",
"MSExchange ActiveSync",
"MSExchange Availability Service",
"MSExchange OWA",
"MSExchangeAutodiscover",
"MSExchange WorkloadManagement Workloads",
"MSExchange RpcClientAccess",
},
},
{
name: "fsrmquota",
builder: newFSRMQuotaCollector,
perfCounterNames: nil,
},
{
name: "hyperv",
builder: NewHyperVCollector,
perfCounterNames: nil,
},
{
name: "iis",
builder: NewIISCollector,
perfCounterNames: []string{"Web Service",
"APP_POOL_WAS",
"Web Service Cache",
"W3SVC_W3WP",
},
},
{
name: "logical_disk",
builder: NewLogicalDiskCollector,
perfCounterNames: []string{"LogicalDisk"},
},
{
name: "logon",
builder: NewLogonCollector,
perfCounterNames: nil,
},
{
name: "memory",
builder: NewMemoryCollector,
perfCounterNames: []string{"Memory"},
},
{
name: "mscluster_cluster",
builder: newMSCluster_ClusterCollector,
perfCounterNames: nil,
},
{
name: "mscluster_network",
builder: newMSCluster_NetworkCollector,
perfCounterNames: nil,
},
{
name: "mscluster_node",
builder: newMSCluster_NodeCollector,
perfCounterNames: nil,
},
{
name: "mscluster_resource",
builder: newMSCluster_ResourceCollector,
perfCounterNames: nil,
},
{
name: "mscluster_resourcegroup",
builder: newMSCluster_ResourceGroupCollector,
perfCounterNames: nil,
},
{
name: "msmq",
builder: NewMSMQCollector,
perfCounterNames: nil,
},
{
name: "mssql",
builder: NewMSSQLCollector,
perfCounterNames: nil,
},
{
name: "net",
builder: NewNetworkCollector,
perfCounterNames: []string{"Network Interface"},
},
{
name: "netframework_clrexceptions",
builder: NewNETFramework_NETCLRExceptionsCollector,
perfCounterNames: nil,
},
{
name: "netframework_clrinterop",
builder: NewNETFramework_NETCLRInteropCollector,
perfCounterNames: nil,
},
{
name: "netframework_clrjit",
builder: NewNETFramework_NETCLRJitCollector,
perfCounterNames: nil,
},
{
name: "netframework_clrloading",
builder: NewNETFramework_NETCLRLoadingCollector,
perfCounterNames: nil,
},
{
name: "netframework_clrlocksandthreads",
builder: NewNETFramework_NETCLRLocksAndThreadsCollector,
perfCounterNames: nil,
},
{
name: "netframework_clrmemory",
builder: NewNETFramework_NETCLRMemoryCollector,
perfCounterNames: nil,
},
{
name: "netframework_clrremoting",
builder: NewNETFramework_NETCLRRemotingCollector,
perfCounterNames: nil,
},
{
name: "netframework_clrsecurity",
builder: NewNETFramework_NETCLRSecurityCollector,
perfCounterNames: nil,
},
{
name: "os",
builder: NewOSCollector,
perfCounterNames: []string{"Paging File"},
},
{
name: "process",
builder: newProcessCollector,
perfCounterNames: []string{"Process"},
},
{
name: "remote_fx",
builder: NewRemoteFx,
perfCounterNames: []string{"RemoteFX Network"},
},
{
name: "scheduled_task",
builder: NewScheduledTask,
perfCounterNames: nil,
},
{
name: "service",
builder: NewserviceCollector,
perfCounterNames: nil,
},
{
name: "smtp",
builder: NewSMTPCollector,
perfCounterNames: []string{"SMTP Server"},
},
{
name: "system",
builder: NewSystemCollector,
perfCounterNames: []string{"System"},
},
{
name: "teradici_pcoip",
builder: newTeradiciPcoipCollector,
perfCounterNames: nil,
},
{
name: "tcp",
builder: NewTCPCollector,
perfCounterNames: []string{"TCPv4"},
},
{
name: "terminal_services",
builder: NewTerminalServicesCollector,
perfCounterNames: []string{
"Terminal Services",
"Terminal Services Session",
"Remote Desktop Connection Broker Counterset",
},
},
{
name: "textfile",
builder: NewTextFileCollector,
perfCounterNames: nil,
},
{
name: "thermalzone",
builder: NewThermalZoneCollector,
perfCounterNames: nil,
},
{
name: "time",
builder: newTimeCollector,
perfCounterNames: []string{"Windows Time Service"},
},
{
name: "vmware",
builder: NewVmwareCollector,
perfCounterNames: nil,
},
{
name: "vmware_blast",
builder: newVmwareBlastCollector,
perfCounterNames: nil,
},
}
// To be called by the exporter for collector initialisation
func RegisterCollectors() {
for _, v := range collectors {
registerCollector(v.name, v.builder, v.perfCounterNames...)
}
}

View File

@@ -12,10 +12,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("logical_disk", NewLogicalDiskCollector, "LogicalDisk")
}
var (
volumeWhitelist = kingpin.Flag(
"collector.logical_disk.volume-whitelist",

View File

@@ -11,10 +11,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("logon", NewLogonCollector)
}
// A LogonCollector is a Prometheus collector for WMI metrics
type LogonCollector struct {
LogonType *prometheus.Desc

View File

@@ -11,10 +11,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("memory", NewMemoryCollector, "Memory")
}
// A MemoryCollector is a Prometheus collector for perflib Memory metrics
type MemoryCollector struct {
AvailableBytes *prometheus.Desc

View File

@@ -5,10 +5,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("mscluster_cluster", newMSCluster_ClusterCollector)
}
// A MSCluster_ClusterCollector is a Prometheus collector for WMI MSCluster_Cluster metrics
type MSCluster_ClusterCollector struct {
AddEvictDelay *prometheus.Desc

View File

@@ -5,10 +5,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("mscluster_network", newMSCluster_NetworkCollector)
}
// A MSCluster_NetworkCollector is a Prometheus collector for WMI MSCluster_Network metrics
type MSCluster_NetworkCollector struct {
Characteristics *prometheus.Desc

View File

@@ -5,10 +5,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("mscluster_node", newMSCluster_NodeCollector)
}
// A MSCluster_NodeCollector is a Prometheus collector for WMI MSCluster_Node metrics
type MSCluster_NodeCollector struct {
BuildNumber *prometheus.Desc

View File

@@ -5,10 +5,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("mscluster_resource", newMSCluster_ResourceCollector)
}
// A MSCluster_ResourceCollector is a Prometheus collector for WMI MSCluster_Resource metrics
type MSCluster_ResourceCollector struct {
Characteristics *prometheus.Desc

View File

@@ -5,10 +5,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("mscluster_resourcegroup", newMSCluster_ResourceGroupCollector)
}
// A MSCluster_ResourceGroupCollector is a Prometheus collector for WMI MSCluster_ResourceGroup metrics
type MSCluster_ResourceGroupCollector struct {
AutoFailbackType *prometheus.Desc

View File

@@ -12,10 +12,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("msmq", NewMSMQCollector)
}
var (
msmqWhereClause = kingpin.Flag("collector.msmq.msmq-where", "WQL 'where' clause to use in WMI metrics query. Limits the response to the msmqs you specify and reduces the size of the response.").String()
)

View File

@@ -129,10 +129,6 @@ func mssqlGetPerfObjectName(sqlInstance string, collector string) string {
return (prefix + suffix)
}
func init() {
registerCollector("mssql", NewMSSQLCollector)
}
// A MSSQLCollector is a Prometheus collector for various WMI Win32_PerfRawData_MSSQLSERVER_* metrics
type MSSQLCollector struct {
// meta

View File

@@ -12,10 +12,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("net", NewNetworkCollector, "Network Interface")
}
var (
nicWhitelist = kingpin.Flag(
"collector.net.nic-whitelist",

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("netframework_clrexceptions", NewNETFramework_NETCLRExceptionsCollector)
}
// A NETFramework_NETCLRExceptionsCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRExceptions metrics
type NETFramework_NETCLRExceptionsCollector struct {
NumberofExcepsThrown *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("netframework_clrinterop", NewNETFramework_NETCLRInteropCollector)
}
// A NETFramework_NETCLRInteropCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRInterop metrics
type NETFramework_NETCLRInteropCollector struct {
NumberofCCWs *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("netframework_clrjit", NewNETFramework_NETCLRJitCollector)
}
// A NETFramework_NETCLRJitCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRJit metrics
type NETFramework_NETCLRJitCollector struct {
NumberofMethodsJitted *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("netframework_clrloading", NewNETFramework_NETCLRLoadingCollector)
}
// A NETFramework_NETCLRLoadingCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRLoading metrics
type NETFramework_NETCLRLoadingCollector struct {
BytesinLoaderHeap *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("netframework_clrlocksandthreads", NewNETFramework_NETCLRLocksAndThreadsCollector)
}
// A NETFramework_NETCLRLocksAndThreadsCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads metrics
type NETFramework_NETCLRLocksAndThreadsCollector struct {
CurrentQueueLength *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("netframework_clrmemory", NewNETFramework_NETCLRMemoryCollector)
}
// A NETFramework_NETCLRMemoryCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRMemory metrics
type NETFramework_NETCLRMemoryCollector struct {
AllocatedBytes *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("netframework_clrremoting", NewNETFramework_NETCLRRemotingCollector)
}
// A NETFramework_NETCLRRemotingCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRRemoting metrics
type NETFramework_NETCLRRemotingCollector struct {
Channels *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("netframework_clrsecurity", NewNETFramework_NETCLRSecurityCollector)
}
// A NETFramework_NETCLRSecurityCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRSecurity metrics
type NETFramework_NETCLRSecurityCollector struct {
NumberLinkTimeChecks *prometheus.Desc

View File

@@ -17,10 +17,6 @@ import (
"golang.org/x/sys/windows/registry"
)
func init() {
registerCollector("os", NewOSCollector, "Paging File")
}
// A OSCollector is a Prometheus collector for WMI metrics
type OSCollector struct {
OSInformation *prometheus.Desc

View File

@@ -15,10 +15,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("process", newProcessCollector, "Process")
}
var (
processWhitelist = kingpin.Flag(
"collector.process.whitelist",

View File

@@ -10,10 +10,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("remote_fx", NewRemoteFx, "RemoteFX Network", "RemoteFX Graphics")
}
// A RemoteFxNetworkCollector is a Prometheus collector for
// WMI Win32_PerfRawData_Counters_RemoteFXNetwork & Win32_PerfRawData_Counters_RemoteFXGraphics metrics
// https://wutils.com/wmi/root/cimv2/win32_perfrawdata_counters_remotefxnetwork/

View File

@@ -63,10 +63,6 @@ type ScheduledTask struct {
type ScheduledTasks []ScheduledTask
func init() {
registerCollector("scheduled_task", NewScheduledTask)
}
// NewScheduledTask ...
func NewScheduledTask() (Collector, error) {
const subsystem = "scheduled_task"

View File

@@ -16,10 +16,6 @@ import (
"golang.org/x/sys/windows/svc/mgr"
)
func init() {
registerCollector("service", NewserviceCollector)
}
var (
serviceWhereClause = kingpin.Flag(
"collector.service.services-where",

View File

@@ -11,10 +11,6 @@ import (
"regexp"
)
func init() {
registerCollector("smtp", NewSMTPCollector, "SMTP Server")
}
var (
serverWhitelist = kingpin.Flag("collector.smtp.server-whitelist", "Regexp of virtual servers to whitelist. Server name must both match whitelist and not match blacklist to be included.").Default(".+").String()
serverBlacklist = kingpin.Flag("collector.smtp.server-blacklist", "Regexp of virtual servers to blacklist. Server name must both match whitelist and not match blacklist to be included.").String()

View File

@@ -8,10 +8,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("system", NewSystemCollector, "System")
}
// A SystemCollector is a Prometheus collector for WMI metrics
type SystemCollector struct {
ContextSwitchesTotal *prometheus.Desc

View File

@@ -8,10 +8,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("tcp", NewTCPCollector, "TCPv4", "TCPv6")
}
// A TCPCollector is a Prometheus collector for WMI Win32_PerfRawData_Tcpip_TCPv{4,6} metrics
type TCPCollector struct {
ConnectionFailures *prometheus.Desc

View File

@@ -11,10 +11,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("teradici_pcoip", newTeradiciPcoipCollector)
}
// A teradiciPcoipCollector is a Prometheus collector for WMI metrics:
// win32_PerfRawData_TeradiciPerf_PCoIPSessionAudioStatistics
// win32_PerfRawData_TeradiciPerf_PCoIPSessionGeneralStatistics

View File

@@ -14,10 +14,6 @@ import (
const ConnectionBrokerFeatureID uint32 = 133
func init() {
registerCollector("terminal_services", NewTerminalServicesCollector, "Terminal Services", "Terminal Services Session", "Remote Desktop Connection Broker Counterset")
}
var (
connectionBrokerEnabled = isConnectionBrokerServer()
)

View File

@@ -55,10 +55,6 @@ type textFileCollector struct {
mtime *float64
}
func init() {
registerCollector("textfile", NewTextFileCollector)
}
// NewTextFileCollector returns a new Collector exposing metrics read from files
// in the given textfile directory.
func NewTextFileCollector() (Collector, error) {

View File

@@ -8,10 +8,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("thermalzone", NewThermalZoneCollector)
}
// A thermalZoneCollector is a Prometheus collector for WMI Win32_PerfRawData_Counters_ThermalZoneInformation metrics
type thermalZoneCollector struct {
PercentPassiveLimit *prometheus.Desc

View File

@@ -10,10 +10,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("time", newTimeCollector, "Windows Time Service")
}
// TimeCollector is a Prometheus collector for Perflib counter metrics
type TimeCollector struct {
ClockFrequencyAdjustmentPPBTotal *prometheus.Desc

View File

@@ -11,10 +11,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("vmware", NewVmwareCollector)
}
// A VmwareCollector is a Prometheus collector for WMI Win32_PerfRawData_vmGuestLib_VMem/Win32_PerfRawData_vmGuestLib_VCPU metrics
type VmwareCollector struct {
MemActive *prometheus.Desc

View File

@@ -9,10 +9,6 @@ import (
"github.com/yusufpapurcu/wmi"
)
func init() {
registerCollector("vmware_blast", newVmwareBlastCollector)
}
// A vmwareBlastCollector is a Prometheus collector for WMI metrics:
// win32_PerfRawData_Counters_VMwareBlastAudioCounters
// win32_PerfRawData_Counters_VMwareBlastCDRCounters

View File

@@ -333,6 +333,9 @@ func main() {
initWbem()
// Initialize collectors before loading
collector.RegisterCollectors()
collectors, err := loadCollectors(*enabledCollectors)
if err != nil {
log.Fatalf("Couldn't load collectors: %s", err)