chore(deps): update dependency golangci/golangci-lint to v2.2.1 (#2110)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
renovate[bot]
2025-07-05 00:08:07 +02:00
committed by GitHub
parent 7a4e92a473
commit 9320e992cc
58 changed files with 516 additions and 46 deletions

View File

@@ -91,5 +91,5 @@ jobs:
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with: with:
# renovate: github=golangci/golangci-lint # renovate: github=golangci/golangci-lint
version: v2.1.6 version: v2.2.1
args: "--max-same-issues=0" args: "--max-same-issues=0"

View File

@@ -19,11 +19,13 @@ linters:
- lll - lll
- maintidx - maintidx
- mnd - mnd
- noinlineerr
- paralleltest - paralleltest
- tagliatelle - tagliatelle
- testpackage - testpackage
- varnamelen - varnamelen
- wrapcheck - wrapcheck
- wsl
settings: settings:
forbidigo: forbidigo:
forbid: forbid:
@@ -62,6 +64,13 @@ linters:
disable: disable:
- fieldalignment - fieldalignment
- shadow - shadow
revive:
rules:
- name: var-naming
arguments:
- [ ] # AllowList - do not remove as args for the rule are positional and won't work without lists first
- [ ] # DenyList
- - skip-package-name-checks: true
sloglint: sloglint:
no-mixed-args: true no-mixed-args: true
kv-only: false kv-only: false

View File

@@ -102,6 +102,7 @@ type windowsExporterService struct{}
// Execute is the entry point for the Windows service manager. // Execute is the entry point for the Windows service manager.
func (s *windowsExporterService) Execute(_ []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (bool, uint32) { func (s *windowsExporterService) Execute(_ []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (bool, uint32) {
changes <- svc.Status{State: svc.StartPending} changes <- svc.Status{State: svc.StartPending}
// Send a signal to the main function that the service is running.
changes <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop | svc.AcceptShutdown} changes <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop | svc.AcceptShutdown}
for { for {
@@ -179,6 +180,7 @@ func logToFile(msg string) {
// https://github.com/DataDog/datadog-agent/blob/46740e82ef40a04c4be545ed8c16a4b0d1f046cf/pkg/util/winutil/servicemain/servicemain.go#L128 // https://github.com/DataDog/datadog-agent/blob/46740e82ef40a04c4be545ed8c16a4b0d1f046cf/pkg/util/winutil/servicemain/servicemain.go#L128
func isWindowsService() (bool, error) { func isWindowsService() (bool, error) {
var currentProcess windows.PROCESS_BASIC_INFORMATION var currentProcess windows.PROCESS_BASIC_INFORMATION
infoSize := uint32(unsafe.Sizeof(currentProcess)) infoSize := uint32(unsafe.Sizeof(currentProcess))
err := windows.NtQueryInformationProcess(windows.CurrentProcess(), windows.ProcessBasicInformation, unsafe.Pointer(&currentProcess), infoSize, &infoSize) err := windows.NtQueryInformationProcess(windows.CurrentProcess(), windows.ProcessBasicInformation, unsafe.Pointer(&currentProcess), infoSize, &infoSize)

View File

@@ -189,7 +189,6 @@ func waitUntilListening(tb testing.TB, network, address string) error {
} }
var winErr windows.Errno var winErr windows.Errno
if errors.As(err, &winErr) { if errors.As(err, &winErr) {
return fmt.Errorf("listener not listening: %w (#%d)", winErr, uint32(winErr)) return fmt.Errorf("listener not listening: %w (#%d)", winErr, uint32(winErr))
} }

View File

@@ -532,30 +532,35 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].AbANRPerSec, c.perfDataObject[0].AbANRPerSec,
"ambiguous_name_resolution", "ambiguous_name_resolution",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.addressBookOperationsTotal, c.addressBookOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].AbBrowsesPerSec, c.perfDataObject[0].AbBrowsesPerSec,
"browse", "browse",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.addressBookOperationsTotal, c.addressBookOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].AbMatchesPerSec, c.perfDataObject[0].AbMatchesPerSec,
"find", "find",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.addressBookOperationsTotal, c.addressBookOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].AbPropertyReadsPerSec, c.perfDataObject[0].AbPropertyReadsPerSec,
"property_read", "property_read",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.addressBookOperationsTotal, c.addressBookOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].AbSearchesPerSec, c.perfDataObject[0].AbSearchesPerSec,
"search", "search",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.addressBookOperationsTotal, c.addressBookOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -580,22 +585,26 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].AtqEstimatedQueueDelay/1000, c.perfDataObject[0].AtqEstimatedQueueDelay/1000,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.atqOutstandingRequests, c.atqOutstandingRequests,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].AtqOutstandingQueuedRequests, c.perfDataObject[0].AtqOutstandingQueuedRequests,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.atqAverageRequestLatency, c.atqAverageRequestLatency,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].AtqRequestLatency, c.perfDataObject[0].AtqRequestLatency,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.atqCurrentThreads, c.atqCurrentThreads,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].AtqThreadsLDAP, c.perfDataObject[0].AtqThreadsLDAP,
"ldap", "ldap",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.atqCurrentThreads, c.atqCurrentThreads,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -609,12 +618,14 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].BaseSearchesPerSec, c.perfDataObject[0].BaseSearchesPerSec,
"base", "base",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.searchesTotal, c.searchesTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SubtreeSearchesPerSec, c.perfDataObject[0].SubtreeSearchesPerSec,
"subtree", "subtree",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.searchesTotal, c.searchesTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -628,18 +639,21 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].DatabaseAddsPerSec, c.perfDataObject[0].DatabaseAddsPerSec,
"add", "add",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.databaseOperationsTotal, c.databaseOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DatabaseDeletesPerSec, c.perfDataObject[0].DatabaseDeletesPerSec,
"delete", "delete",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.databaseOperationsTotal, c.databaseOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DatabaseModifiesPerSec, c.perfDataObject[0].DatabaseModifiesPerSec,
"modify", "modify",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.databaseOperationsTotal, c.databaseOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -653,48 +667,56 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].DigestBindsPerSec, c.perfDataObject[0].DigestBindsPerSec,
"digest", "digest",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bindsTotal, c.bindsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DsClientBindsPerSec, c.perfDataObject[0].DsClientBindsPerSec,
"ds_client", "ds_client",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bindsTotal, c.bindsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DsServerBindsPerSec, c.perfDataObject[0].DsServerBindsPerSec,
"ds_server", "ds_server",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bindsTotal, c.bindsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].ExternalBindsPerSec, c.perfDataObject[0].ExternalBindsPerSec,
"external", "external",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bindsTotal, c.bindsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].FastBindsPerSec, c.perfDataObject[0].FastBindsPerSec,
"fast", "fast",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bindsTotal, c.bindsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].NegotiatedBindsPerSec, c.perfDataObject[0].NegotiatedBindsPerSec,
"negotiate", "negotiate",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bindsTotal, c.bindsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].NTLMBindsPerSec, c.perfDataObject[0].NTLMBindsPerSec,
"ntlm", "ntlm",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bindsTotal, c.bindsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SimpleBindsPerSec, c.perfDataObject[0].SimpleBindsPerSec,
"simple", "simple",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bindsTotal, c.bindsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -708,6 +730,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
float64(uint64(c.perfDataObject[0].DRAHighestUSNCommittedHighPart)<<32)+c.perfDataObject[0].DRAHighestUSNCommittedLowPart, float64(uint64(c.perfDataObject[0].DRAHighestUSNCommittedHighPart)<<32)+c.perfDataObject[0].DRAHighestUSNCommittedLowPart,
"committed", "committed",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.replicationHighestUsn, c.replicationHighestUsn,
prometheus.CounterValue, prometheus.CounterValue,
@@ -746,6 +769,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].DRAInboundBytesNotCompressedWithinSitePerSec, c.perfDataObject[0].DRAInboundBytesNotCompressedWithinSitePerSec,
"inbound", "inbound",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.intraSiteReplicationDataBytesTotal, c.intraSiteReplicationDataBytesTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -770,6 +794,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DRAInboundObjectsAppliedPerSec, c.perfDataObject[0].DRAInboundObjectsAppliedPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.replicationInboundObjectsFilteredTotal, c.replicationInboundObjectsFilteredTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -781,6 +806,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DRAInboundPropertiesAppliedPerSec, c.perfDataObject[0].DRAInboundPropertiesAppliedPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.replicationInboundPropertiesFilteredTotal, c.replicationInboundPropertiesFilteredTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -792,6 +818,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].DRAPendingReplicationOperations, c.perfDataObject[0].DRAPendingReplicationOperations,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.replicationPendingSynchronizations, c.replicationPendingSynchronizations,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -803,11 +830,13 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DRASyncRequestsMade, c.perfDataObject[0].DRASyncRequestsMade,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.replicationSyncRequestsSuccessTotal, c.replicationSyncRequestsSuccessTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DRASyncRequestsSuccessful, c.perfDataObject[0].DRASyncRequestsSuccessful,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.replicationSyncRequestsSchemaMismatchFailureTotal, c.replicationSyncRequestsSchemaMismatchFailureTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -820,6 +849,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].DsClientNameTranslationsPerSec, c.perfDataObject[0].DsClientNameTranslationsPerSec,
"client", "client",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.nameTranslationsTotal, c.nameTranslationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -832,6 +862,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].DsMonitorListSize, c.perfDataObject[0].DsMonitorListSize,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.changeMonitorUpdatesPending, c.changeMonitorUpdatesPending,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -843,6 +874,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DsNameCacheHitRate, c.perfDataObject[0].DsNameCacheHitRate,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.nameCacheLookupsTotal, c.nameCacheLookupsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -856,6 +888,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"read", "read",
"replication_agent", "replication_agent",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -863,6 +896,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"read", "read",
"knowledge_consistency_checker", "knowledge_consistency_checker",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -870,6 +904,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"read", "read",
"local_security_authority", "local_security_authority",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -877,6 +912,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"read", "read",
"name_service_provider_interface", "name_service_provider_interface",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -884,6 +920,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"read", "read",
"directory_service_api", "directory_service_api",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -891,6 +928,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"read", "read",
"security_account_manager", "security_account_manager",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -898,6 +936,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"read", "read",
"other", "other",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -905,6 +944,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"search", "search",
"replication_agent", "replication_agent",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -912,6 +952,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"search", "search",
"knowledge_consistency_checker", "knowledge_consistency_checker",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -919,6 +960,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"search", "search",
"ldap", "ldap",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -926,6 +968,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"search", "search",
"local_security_authority", "local_security_authority",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -933,6 +976,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"search", "search",
"name_service_provider_interface", "name_service_provider_interface",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -940,6 +984,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"search", "search",
"directory_service_api", "directory_service_api",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -947,6 +992,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"search", "search",
"security_account_manager", "security_account_manager",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -954,6 +1000,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"search", "search",
"other", "other",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -961,6 +1008,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"write", "write",
"replication_agent", "replication_agent",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -968,6 +1016,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"write", "write",
"knowledge_consistency_checker", "knowledge_consistency_checker",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -975,6 +1024,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"write", "write",
"ldap", "ldap",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -982,6 +1032,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"write", "write",
"local_security_authority", "local_security_authority",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -989,6 +1040,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"write", "write",
"name_service_provider_interface", "name_service_provider_interface",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -996,6 +1048,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"write", "write",
"directory_service_api", "directory_service_api",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1003,6 +1056,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
"write", "write",
"security_account_manager", "security_account_manager",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.directoryOperationsTotal, c.directoryOperationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1022,16 +1076,19 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DsSecurityDescriptorSubOperationsPerSec, c.perfDataObject[0].DsSecurityDescriptorSubOperationsPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.securityDescriptorPropagationEventsQueued, c.securityDescriptorPropagationEventsQueued,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].DsSecurityDescriptorPropagationsEvents, c.perfDataObject[0].DsSecurityDescriptorPropagationsEvents,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.securityDescriptorPropagationAccessWaitTotalSeconds, c.securityDescriptorPropagationAccessWaitTotalSeconds,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].DsSecurityDescriptorPropagatorAverageExclusionTime, c.perfDataObject[0].DsSecurityDescriptorPropagatorAverageExclusionTime,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.securityDescriptorPropagationItemsQueuedTotal, c.securityDescriptorPropagationItemsQueuedTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1049,12 +1106,14 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].LdapClosedConnectionsPerSec, c.perfDataObject[0].LdapClosedConnectionsPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ldapOpenedConnectionsTotal, c.ldapOpenedConnectionsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].LdapNewConnectionsPerSec, c.perfDataObject[0].LdapNewConnectionsPerSec,
"ldap", "ldap",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ldapOpenedConnectionsTotal, c.ldapOpenedConnectionsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1085,11 +1144,13 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].LdapUDPOperationsPerSec, c.perfDataObject[0].LdapUDPOperationsPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ldapWritesTotal, c.ldapWritesTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].LdapWritesPerSec, c.perfDataObject[0].LdapWritesPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ldapClientSessions, c.ldapClientSessions,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -1107,6 +1168,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].PhantomsCleanedPerSec, c.perfDataObject[0].PhantomsCleanedPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.phantomObjectsVisitedTotal, c.phantomObjectsVisitedTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1119,18 +1181,21 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].SamGlobalGroupMembershipEvaluationsPerSec, c.perfDataObject[0].SamGlobalGroupMembershipEvaluationsPerSec,
"global", "global",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.samGroupMembershipEvaluationsTotal, c.samGroupMembershipEvaluationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SamDomainLocalGroupMembershipEvaluationsPerSec, c.perfDataObject[0].SamDomainLocalGroupMembershipEvaluationsPerSec,
"domain_local", "domain_local",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.samGroupMembershipEvaluationsTotal, c.samGroupMembershipEvaluationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SamUniversalGroupMembershipEvaluationsPerSec, c.perfDataObject[0].SamUniversalGroupMembershipEvaluationsPerSec,
"universal", "universal",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.samGroupMembershipGlobalCatalogEvaluationsTotal, c.samGroupMembershipGlobalCatalogEvaluationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1142,6 +1207,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SamNonTransitiveMembershipEvaluationsPerSec, c.perfDataObject[0].SamNonTransitiveMembershipEvaluationsPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.samGroupMembershipEvaluationsTransitiveTotal, c.samGroupMembershipEvaluationsTransitiveTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1154,6 +1220,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].SamAccountGroupEvaluationLatency, c.perfDataObject[0].SamAccountGroupEvaluationLatency,
"account_group", "account_group",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.samGroupEvaluationLatency, c.samGroupEvaluationLatency,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -1166,6 +1233,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SamSuccessfulComputerCreationsPerSecIncludesAllRequests, c.perfDataObject[0].SamSuccessfulComputerCreationsPerSecIncludesAllRequests,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.samComputerCreationSuccessfulRequestsTotal, c.samComputerCreationSuccessfulRequestsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1177,6 +1245,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SamUserCreationAttemptsPerSec, c.perfDataObject[0].SamUserCreationAttemptsPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.samUserCreationSuccessfulRequestsTotal, c.samUserCreationSuccessfulRequestsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1188,6 +1257,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SamDisplayInformationQueriesPerSec, c.perfDataObject[0].SamDisplayInformationQueriesPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.samEnumerationsTotal, c.samEnumerationsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -1211,6 +1281,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].TombstonesGarbageCollectedPerSec, c.perfDataObject[0].TombstonesGarbageCollectedPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.tombstonesObjectsVisitedTotal, c.tombstonesObjectsVisitedTotal,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -186,72 +186,84 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
data.RequestsPerSecond, data.RequestsPerSecond,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.requestProcessingTime, c.requestProcessingTime,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.RequestProcessingTime), utils.MilliSecToSec(data.RequestProcessingTime),
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.retrievalsPerSecond, c.retrievalsPerSecond,
prometheus.CounterValue, prometheus.CounterValue,
data.RetrievalsPerSecond, data.RetrievalsPerSecond,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.retrievalProcessingTime, c.retrievalProcessingTime,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.RetrievalProcessingTime), utils.MilliSecToSec(data.RetrievalProcessingTime),
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.failedRequestsPerSecond, c.failedRequestsPerSecond,
prometheus.CounterValue, prometheus.CounterValue,
data.FailedRequestsPerSecond, data.FailedRequestsPerSecond,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.issuedRequestsPerSecond, c.issuedRequestsPerSecond,
prometheus.CounterValue, prometheus.CounterValue,
data.IssuedRequestsPerSecond, data.IssuedRequestsPerSecond,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.pendingRequestsPerSecond, c.pendingRequestsPerSecond,
prometheus.CounterValue, prometheus.CounterValue,
data.PendingRequestsPerSecond, data.PendingRequestsPerSecond,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.requestCryptographicSigningTime, c.requestCryptographicSigningTime,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.RequestCryptographicSigningTime), utils.MilliSecToSec(data.RequestCryptographicSigningTime),
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.requestPolicyModuleProcessingTime, c.requestPolicyModuleProcessingTime,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.RequestPolicyModuleProcessingTime), utils.MilliSecToSec(data.RequestPolicyModuleProcessingTime),
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.challengeResponsesPerSecond, c.challengeResponsesPerSecond,
prometheus.CounterValue, prometheus.CounterValue,
data.ChallengeResponsesPerSecond, data.ChallengeResponsesPerSecond,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.challengeResponseProcessingTime, c.challengeResponseProcessingTime,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.ChallengeResponseProcessingTime), utils.MilliSecToSec(data.ChallengeResponseProcessingTime),
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.signedCertificateTimestampListsPerSecond, c.signedCertificateTimestampListsPerSecond,
prometheus.CounterValue, prometheus.CounterValue,
data.SignedCertificateTimestampListsPerSecond, data.SignedCertificateTimestampListsPerSecond,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.signedCertificateTimestampListProcessingTime, c.signedCertificateTimestampListProcessingTime,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -437,6 +437,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
1, 1,
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, "false", containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, "false",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.usageCommitBytes, c.usageCommitBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -444,6 +445,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.usageCommitPeakBytes, c.usageCommitPeakBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -451,6 +453,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.usagePrivateWorkingSetBytes, c.usagePrivateWorkingSetBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -458,6 +461,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.runtimeTotal, c.runtimeTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -465,6 +469,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.runtimeUser, c.runtimeUser,
prometheus.CounterValue, prometheus.CounterValue,
@@ -472,6 +477,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.runtimeKernel, c.runtimeKernel,
prometheus.CounterValue, prometheus.CounterValue,
@@ -479,6 +485,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.readCountNormalized, c.readCountNormalized,
prometheus.CounterValue, prometheus.CounterValue,
@@ -486,6 +493,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.readSizeBytes, c.readSizeBytes,
prometheus.CounterValue, prometheus.CounterValue,
@@ -493,6 +501,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.writeCountNormalized, c.writeCountNormalized,
prometheus.CounterValue, prometheus.CounterValue,
@@ -500,6 +509,7 @@ func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDe
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.writeSizeBytes, c.writeSizeBytes,
prometheus.CounterValue, prometheus.CounterValue,
@@ -558,6 +568,7 @@ func (c *Collector) collectNetworkMetrics(ch chan<- prometheus.Metric) error {
} }
var endpointStats iphlpapi.MIB_IF_ROW2 var endpointStats iphlpapi.MIB_IF_ROW2
endpointStats.InterfaceLuid = luid endpointStats.InterfaceLuid = luid
if err := iphlpapi.GetIfEntry2Ex(&endpointStats); err != nil { if err := iphlpapi.GetIfEntry2Ex(&endpointStats); err != nil {
@@ -597,24 +608,28 @@ func (c *Collector) collectNetworkMetrics(ch chan<- prometheus.Metric) error {
float64(endpointStats.OutOctets), float64(endpointStats.OutOctets),
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsReceived, c.packetsReceived,
prometheus.CounterValue, prometheus.CounterValue,
float64(endpointStats.InUcastPkts+endpointStats.InNUcastPkts), float64(endpointStats.InUcastPkts+endpointStats.InNUcastPkts),
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsSent, c.packetsSent,
prometheus.CounterValue, prometheus.CounterValue,
float64(endpointStats.OutUcastPkts+endpointStats.OutNUcastPkts), float64(endpointStats.OutUcastPkts+endpointStats.OutNUcastPkts),
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.droppedPacketsIncoming, c.droppedPacketsIncoming,
prometheus.CounterValue, prometheus.CounterValue,
float64(endpointStats.InDiscards+endpointStats.InErrors), float64(endpointStats.InDiscards+endpointStats.InErrors),
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.droppedPacketsOutgoing, c.droppedPacketsOutgoing,
prometheus.CounterValue, prometheus.CounterValue,
@@ -768,6 +783,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
1, 1,
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, "true", containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, "true",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.usageCommitBytes, c.usageCommitBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -775,6 +791,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.usageCommitPeakBytes, c.usageCommitPeakBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -782,6 +799,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.usagePrivateWorkingSetBytes, c.usagePrivateWorkingSetBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -789,6 +807,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.runtimeTotal, c.runtimeTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -796,6 +815,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.runtimeUser, c.runtimeUser,
prometheus.CounterValue, prometheus.CounterValue,
@@ -803,6 +823,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.runtimeKernel, c.runtimeKernel,
prometheus.CounterValue, prometheus.CounterValue,
@@ -810,6 +831,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.readCountNormalized, c.readCountNormalized,
prometheus.CounterValue, prometheus.CounterValue,
@@ -817,6 +839,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.readSizeBytes, c.readSizeBytes,
prometheus.CounterValue, prometheus.CounterValue,
@@ -824,6 +847,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.writeCountNormalized, c.writeCountNormalized,
prometheus.CounterValue, prometheus.CounterValue,
@@ -831,6 +855,7 @@ func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.writeSizeBytes, c.writeSizeBytes,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -234,12 +234,14 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
coreData.C1TimeSeconds, coreData.C1TimeSeconds,
core, "c1", core, "c1",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.cStateSecondsTotal, c.cStateSecondsTotal,
prometheus.CounterValue, prometheus.CounterValue,
coreData.C2TimeSeconds, coreData.C2TimeSeconds,
core, "c2", core, "c2",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.cStateSecondsTotal, c.cStateSecondsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -253,24 +255,28 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
coreData.IdleTimeSeconds, coreData.IdleTimeSeconds,
core, "idle", core, "idle",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.timeTotal, c.timeTotal,
prometheus.CounterValue, prometheus.CounterValue,
coreData.InterruptTimeSeconds, coreData.InterruptTimeSeconds,
core, "interrupt", core, "interrupt",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.timeTotal, c.timeTotal,
prometheus.CounterValue, prometheus.CounterValue,
coreData.DpcTimeSeconds, coreData.DpcTimeSeconds,
core, "dpc", core, "dpc",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.timeTotal, c.timeTotal,
prometheus.CounterValue, prometheus.CounterValue,
coreData.PrivilegedTimeSeconds, coreData.PrivilegedTimeSeconds,
core, "privileged", core, "privileged",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.timeTotal, c.timeTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -284,18 +290,21 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
coreData.InterruptsTotal, coreData.InterruptsTotal,
core, core,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.dpcsTotal, c.dpcsTotal,
prometheus.CounterValue, prometheus.CounterValue,
coreData.DpcQueuedPerSecond, coreData.DpcQueuedPerSecond,
core, core,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.clockInterruptsTotal, c.clockInterruptsTotal,
prometheus.CounterValue, prometheus.CounterValue,
coreData.ClockInterruptsTotal, coreData.ClockInterruptsTotal,
core, core,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.idleBreakEventsTotal, c.idleBreakEventsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -316,30 +325,35 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
coreData.ProcessorFrequencyMHz, coreData.ProcessorFrequencyMHz,
core, core,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.processorPerformance, c.processorPerformance,
prometheus.CounterValue, prometheus.CounterValue,
coreData.ProcessorPerformance, coreData.ProcessorPerformance,
core, core,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.processorMPerf, c.processorMPerf,
prometheus.CounterValue, prometheus.CounterValue,
counterProcessorMPerfValues.Value(), counterProcessorMPerfValues.Value(),
core, core,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.processorRTC, c.processorRTC,
prometheus.CounterValue, prometheus.CounterValue,
counterProcessorRTCValues.Value(), counterProcessorRTCValues.Value(),
core, core,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.processorUtility, c.processorUtility,
prometheus.CounterValue, prometheus.CounterValue,
coreData.ProcessorUtilityRate, coreData.ProcessorUtilityRate,
core, core,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.processorPrivilegedUtility, c.processorPrivilegedUtility,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -194,36 +194,42 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
strconv.Itoa(int(processor.Family)), strconv.Itoa(int(processor.Family)),
strings.TrimRight(processor.Name, " "), strings.TrimRight(processor.Name, " "),
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.cpuCoreCount, c.cpuCoreCount,
prometheus.GaugeValue, prometheus.GaugeValue,
float64(processor.NumberOfCores), float64(processor.NumberOfCores),
strings.TrimRight(processor.DeviceID, " "), strings.TrimRight(processor.DeviceID, " "),
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.cpuEnabledCoreCount, c.cpuEnabledCoreCount,
prometheus.GaugeValue, prometheus.GaugeValue,
float64(processor.NumberOfEnabledCore), float64(processor.NumberOfEnabledCore),
strings.TrimRight(processor.DeviceID, " "), strings.TrimRight(processor.DeviceID, " "),
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.cpuLogicalProcessorsCount, c.cpuLogicalProcessorsCount,
prometheus.GaugeValue, prometheus.GaugeValue,
float64(processor.NumberOfLogicalProcessors), float64(processor.NumberOfLogicalProcessors),
strings.TrimRight(processor.DeviceID, " "), strings.TrimRight(processor.DeviceID, " "),
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.cpuThreadCount, c.cpuThreadCount,
prometheus.GaugeValue, prometheus.GaugeValue,
float64(processor.ThreadCount), float64(processor.ThreadCount),
strings.TrimRight(processor.DeviceID, " "), strings.TrimRight(processor.DeviceID, " "),
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.cpuL2CacheSize, c.cpuL2CacheSize,
prometheus.GaugeValue, prometheus.GaugeValue,
float64(processor.L2CacheSize), float64(processor.L2CacheSize),
strings.TrimRight(processor.DeviceID, " "), strings.TrimRight(processor.DeviceID, " "),
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.cpuL3CacheSize, c.cpuL3CacheSize,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -245,6 +245,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
if availNum == int(disk.Availability) { if availNum == int(disk.Availability) {
isCurrentState = 1.0 isCurrentState = 1.0
} }
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.availability, c.availability,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -357,6 +357,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].AxfrRequestReceived, c.perfDataObject[0].AxfrRequestReceived,
"full", "full",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.zoneTransferRequestsReceived, c.zoneTransferRequestsReceived,
prometheus.CounterValue, prometheus.CounterValue,
@@ -370,12 +371,14 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].AxfrRequestSent, c.perfDataObject[0].AxfrRequestSent,
"full", "full",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.zoneTransferRequestsSent, c.zoneTransferRequestsSent,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].IxfrRequestSent, c.perfDataObject[0].IxfrRequestSent,
"incremental", "incremental",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.zoneTransferRequestsSent, c.zoneTransferRequestsSent,
prometheus.CounterValue, prometheus.CounterValue,
@@ -389,6 +392,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].AxfrResponseReceived, c.perfDataObject[0].AxfrResponseReceived,
"full", "full",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.zoneTransferResponsesReceived, c.zoneTransferResponsesReceived,
prometheus.CounterValue, prometheus.CounterValue,
@@ -403,6 +407,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
"full", "full",
"tcp", "tcp",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.zoneTransferSuccessReceived, c.zoneTransferSuccessReceived,
prometheus.CounterValue, prometheus.CounterValue,
@@ -410,6 +415,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
"incremental", "incremental",
"tcp", "tcp",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.zoneTransferSuccessReceived, c.zoneTransferSuccessReceived,
prometheus.CounterValue, prometheus.CounterValue,
@@ -424,6 +430,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].AxfrSuccessSent, c.perfDataObject[0].AxfrSuccessSent,
"full", "full",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.zoneTransferSuccessSent, c.zoneTransferSuccessSent,
prometheus.CounterValue, prometheus.CounterValue,
@@ -443,30 +450,35 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].CachingMemory, c.perfDataObject[0].CachingMemory,
"caching", "caching",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.memoryUsedBytes, c.memoryUsedBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].DatabaseNodeMemory, c.perfDataObject[0].DatabaseNodeMemory,
"database_node", "database_node",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.memoryUsedBytes, c.memoryUsedBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].NbStatMemory, c.perfDataObject[0].NbStatMemory,
"nbstat", "nbstat",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.memoryUsedBytes, c.memoryUsedBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].RecordFlowMemory, c.perfDataObject[0].RecordFlowMemory,
"record_flow", "record_flow",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.memoryUsedBytes, c.memoryUsedBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].TcpMessageMemory, c.perfDataObject[0].TcpMessageMemory,
"tcp_message", "tcp_message",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.memoryUsedBytes, c.memoryUsedBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -480,23 +492,27 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].DynamicUpdateNoOperation, c.perfDataObject[0].DynamicUpdateNoOperation,
"noop", "noop",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.dynamicUpdatesReceived, c.dynamicUpdatesReceived,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DynamicUpdateWrittenToDatabase, c.perfDataObject[0].DynamicUpdateWrittenToDatabase,
"written", "written",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.dynamicUpdatesQueued, c.dynamicUpdatesQueued,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].DynamicUpdateQueued, c.perfDataObject[0].DynamicUpdateQueued,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.dynamicUpdatesFailures, c.dynamicUpdatesFailures,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].DynamicUpdateRejected, c.perfDataObject[0].DynamicUpdateRejected,
"rejected", "rejected",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.dynamicUpdatesFailures, c.dynamicUpdatesFailures,
prometheus.CounterValue, prometheus.CounterValue,
@@ -509,6 +525,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].NotifyReceived, c.perfDataObject[0].NotifyReceived,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.notifySent, c.notifySent,
prometheus.CounterValue, prometheus.CounterValue,
@@ -520,11 +537,13 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].RecursiveQueries, c.perfDataObject[0].RecursiveQueries,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.recursiveQueryFailures, c.recursiveQueryFailures,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].RecursiveQueryFailure, c.perfDataObject[0].RecursiveQueryFailure,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.recursiveQuerySendTimeouts, c.recursiveQuerySendTimeouts,
prometheus.CounterValue, prometheus.CounterValue,
@@ -537,6 +556,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].TcpQueryReceived, c.perfDataObject[0].TcpQueryReceived,
"tcp", "tcp",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.queries, c.queries,
prometheus.CounterValue, prometheus.CounterValue,
@@ -550,6 +570,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].TcpResponseSent, c.perfDataObject[0].TcpResponseSent,
"tcp", "tcp",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.responses, c.responses,
prometheus.CounterValue, prometheus.CounterValue,
@@ -569,6 +590,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].WinsLookupReceived, c.perfDataObject[0].WinsLookupReceived,
"forward", "forward",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.winsQueries, c.winsQueries,
prometheus.CounterValue, prometheus.CounterValue,
@@ -582,6 +604,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].WinsResponseSent, c.perfDataObject[0].WinsResponseSent,
"forward", "forward",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.winsResponses, c.winsResponses,
prometheus.CounterValue, prometheus.CounterValue,
@@ -594,6 +617,7 @@ func (c *Collector) collectMetrics(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SecureUpdateFailure, c.perfDataObject[0].SecureUpdateFailure,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.secureUpdateReceived, c.secureUpdateReceived,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -66,11 +66,6 @@ var ConfigDefaults = Config{
} }
type Collector struct { type Collector struct {
config Config
collectorFns []func(ch chan<- prometheus.Metric) error
closeFns []func()
collectorADAccessProcesses collectorADAccessProcesses
collectorActiveSync collectorActiveSync
collectorAutoDiscover collectorAutoDiscover
@@ -81,6 +76,11 @@ type Collector struct {
collectorRpcClientAccess collectorRpcClientAccess
collectorTransportQueues collectorTransportQueues
collectorWorkloadManagementWorkloads collectorWorkloadManagementWorkloads
config Config
collectorFns []func(ch chan<- prometheus.Metric) error
closeFns []func()
} }
func New(config *Config) *Collector { func New(config *Config) *Collector {

View File

@@ -82,11 +82,13 @@ func (c *Collector) collectActiveSync(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
data.RequestsPerSec, data.RequestsPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.pingCommandsPending, c.pingCommandsPending,
prometheus.GaugeValue, prometheus.GaugeValue,
data.PingCommandsPending, data.PingCommandsPending,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.syncCommandsPerSec, c.syncCommandsPerSec,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -113,24 +113,28 @@ func (c *Collector) collectADAccessProcesses(ch chan<- prometheus.Metric) error
utils.MilliSecToSec(data.LdapReadTime), utils.MilliSecToSec(data.LdapReadTime),
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ldapSearchTime, c.ldapSearchTime,
prometheus.CounterValue, prometheus.CounterValue,
utils.MilliSecToSec(data.LdapSearchTime), utils.MilliSecToSec(data.LdapSearchTime),
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ldapWriteTime, c.ldapWriteTime,
prometheus.CounterValue, prometheus.CounterValue,
utils.MilliSecToSec(data.LdapWriteTime), utils.MilliSecToSec(data.LdapWriteTime),
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ldapTimeoutErrorsPerSec, c.ldapTimeoutErrorsPerSec,
prometheus.CounterValue, prometheus.CounterValue,
data.LdapTimeoutErrorsPerSec, data.LdapTimeoutErrorsPerSec,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.longRunningLDAPOperationsPerMin, c.longRunningLDAPOperationsPerMin,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -111,30 +111,35 @@ func (c *Collector) collectHTTPProxy(ch chan<- prometheus.Metric) error {
utils.MilliSecToSec(data.MailboxServerLocatorAverageLatency), utils.MilliSecToSec(data.MailboxServerLocatorAverageLatency),
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.averageAuthenticationLatency, c.averageAuthenticationLatency,
prometheus.GaugeValue, prometheus.GaugeValue,
data.AverageAuthenticationLatency, data.AverageAuthenticationLatency,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.averageCASProcessingLatency, c.averageCASProcessingLatency,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.AverageCASProcessingLatency), utils.MilliSecToSec(data.AverageCASProcessingLatency),
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.mailboxServerProxyFailureRate, c.mailboxServerProxyFailureRate,
prometheus.GaugeValue, prometheus.GaugeValue,
data.MailboxServerProxyFailureRate, data.MailboxServerProxyFailureRate,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.outstandingProxyRequests, c.outstandingProxyRequests,
prometheus.GaugeValue, prometheus.GaugeValue,
data.OutstandingProxyRequests, data.OutstandingProxyRequests,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.proxyRequestsPerSec, c.proxyRequestsPerSec,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -74,6 +74,7 @@ func (c *Collector) collectOWA(ch chan<- prometheus.Metric) error {
prometheus.GaugeValue, prometheus.GaugeValue,
data.CurrentUniqueUsers, data.CurrentUniqueUsers,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.owaRequestsPerSec, c.owaRequestsPerSec,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -107,26 +107,31 @@ func (c *Collector) collectRpcClientAccess(ch chan<- prometheus.Metric) error {
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.RpcAveragedLatency), utils.MilliSecToSec(data.RpcAveragedLatency),
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.rpcRequests, c.rpcRequests,
prometheus.GaugeValue, prometheus.GaugeValue,
data.RpcRequests, data.RpcRequests,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.activeUserCount, c.activeUserCount,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ActiveUserCount, data.ActiveUserCount,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.connectionCount, c.connectionCount,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ConnectionCount, data.ConnectionCount,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.rpcOperationsPerSec, c.rpcOperationsPerSec,
prometheus.CounterValue, prometheus.CounterValue,
data.RpcOperationsPerSec, data.RpcOperationsPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.userCount, c.userCount,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -215,108 +215,126 @@ func (c *Collector) collectTransportQueues(ch chan<- prometheus.Metric) error {
data.ExternalActiveRemoteDeliveryQueueLength, data.ExternalActiveRemoteDeliveryQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.internalActiveRemoteDeliveryQueueLength, c.internalActiveRemoteDeliveryQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.InternalActiveRemoteDeliveryQueueLength, data.InternalActiveRemoteDeliveryQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.activeMailboxDeliveryQueueLength, c.activeMailboxDeliveryQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ActiveMailboxDeliveryQueueLength, data.ActiveMailboxDeliveryQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.retryMailboxDeliveryQueueLength, c.retryMailboxDeliveryQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.RetryMailboxDeliveryQueueLength, data.RetryMailboxDeliveryQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.unreachableQueueLength, c.unreachableQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.UnreachableQueueLength, data.UnreachableQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.externalLargestDeliveryQueueLength, c.externalLargestDeliveryQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ExternalLargestDeliveryQueueLength, data.ExternalLargestDeliveryQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.internalLargestDeliveryQueueLength, c.internalLargestDeliveryQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.InternalLargestDeliveryQueueLength, data.InternalLargestDeliveryQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.poisonQueueLength, c.poisonQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.PoisonQueueLength, data.PoisonQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.messagesQueuedForDeliveryTotal, c.messagesQueuedForDeliveryTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.MessagesQueuedForDeliveryTotal, data.MessagesQueuedForDeliveryTotal,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.messagesSubmittedTotal, c.messagesSubmittedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.MessagesSubmittedTotal, data.MessagesSubmittedTotal,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.messagesDelayedTotal, c.messagesDelayedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.MessagesDelayedTotal, data.MessagesDelayedTotal,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.messagesCompletedDeliveryTotal, c.messagesCompletedDeliveryTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.MessagesCompletedDeliveryTotal, data.MessagesCompletedDeliveryTotal,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.aggregateShadowQueueLength, c.aggregateShadowQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.AggregateShadowQueueLength, data.AggregateShadowQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.submissionQueueLength, c.submissionQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.SubmissionQueueLength, data.SubmissionQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.delayQueueLength, c.delayQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.DelayQueueLength, data.DelayQueueLength,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.itemsCompletedDeliveryTotal, c.itemsCompletedDeliveryTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ItemsCompletedDeliveryTotal, data.ItemsCompletedDeliveryTotal,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.itemsQueuedForDeliveryExpiredTotal, c.itemsQueuedForDeliveryExpiredTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ItemsQueuedForDeliveryExpiredTotal, data.ItemsQueuedForDeliveryExpiredTotal,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.itemsQueuedForDeliveryTotal, c.itemsQueuedForDeliveryTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ItemsQueuedForDeliveryTotal, data.ItemsQueuedForDeliveryTotal,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.itemsResubmittedTotal, c.itemsResubmittedTotal,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -103,24 +103,28 @@ func (c *Collector) collectWorkloadManagementWorkloads(ch chan<- prometheus.Metr
data.ActiveTasks, data.ActiveTasks,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.completedTasks, c.completedTasks,
prometheus.CounterValue, prometheus.CounterValue,
data.CompletedTasks, data.CompletedTasks,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.queuedTasks, c.queuedTasks,
prometheus.CounterValue, prometheus.CounterValue,
data.QueuedTasks, data.QueuedTasks,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.yieldedTasks, c.yieldedTasks,
prometheus.CounterValue, prometheus.CounterValue,
data.YieldedTasks, data.YieldedTasks,
labelName, labelName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.isActive, c.isActive,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -190,6 +190,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
path, path,
template, template,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.size, c.size,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -197,6 +198,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
path, path,
template, template,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.usage, c.usage,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -204,12 +206,14 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
path, path,
template, template,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.description, c.description,
prometheus.GaugeValue, prometheus.GaugeValue,
1.0, 1.0,
path, template, Description, path, template, Description,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.disabled, c.disabled,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -217,6 +221,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
path, path,
template, template,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.matchesTemplate, c.matchesTemplate,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -224,6 +229,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
path, path,
template, template,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.softLimit, c.softLimit,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -335,12 +335,14 @@ func (c *Collector) collectGpuAdapterMemoryMetrics(ch chan<- prometheus.Metric)
dedicatedUsage, dedicatedUsage,
key.Phys, key.Phys,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.gpuAdapterMemorySharedUsage, c.gpuAdapterMemorySharedUsage,
prometheus.GaugeValue, prometheus.GaugeValue,
sharedUsageMap[key], sharedUsageMap[key],
key.Phys, key.Phys,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.gpuAdapterMemoryTotalCommitted, c.gpuAdapterMemoryTotalCommitted,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -437,24 +439,28 @@ func (c *Collector) collectGpuProcessMemoryMetrics(ch chan<- prometheus.Metric)
dedicatedUsage, dedicatedUsage,
key.Pid, key.Phys, key.Pid, key.Phys,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.gpuProcessMemoryLocalUsage, c.gpuProcessMemoryLocalUsage,
prometheus.GaugeValue, prometheus.GaugeValue,
processLocalUsageMap[key], processLocalUsageMap[key],
key.Pid, key.Phys, key.Pid, key.Phys,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.gpuProcessMemoryNonLocalUsage, c.gpuProcessMemoryNonLocalUsage,
prometheus.GaugeValue, prometheus.GaugeValue,
processNonLocalUsageMap[key], processNonLocalUsageMap[key],
key.Pid, key.Phys, key.Pid, key.Phys,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.gpuProcessMemorySharedUsage, c.gpuProcessMemorySharedUsage,
prometheus.GaugeValue, prometheus.GaugeValue,
processSharedUsageMap[key], processSharedUsageMap[key],
key.Pid, key.Phys, key.Pid, key.Phys,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.gpuProcessMemoryTotalCommitted, c.gpuProcessMemoryTotalCommitted,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -78,11 +78,6 @@ var ConfigDefaults = Config{
// Collector is a Prometheus Collector for hyper-v. // Collector is a Prometheus Collector for hyper-v.
type Collector struct { type Collector struct {
config Config
collectorFns []func(ch chan<- prometheus.Metric) error
closeFns []func()
collectorDataStore collectorDataStore
collectorDynamicMemoryBalancer collectorDynamicMemoryBalancer
collectorDynamicMemoryVM collectorDynamicMemoryVM
@@ -98,6 +93,11 @@ type Collector struct {
collectorVirtualSMB collectorVirtualSMB
collectorVirtualStorageDevice collectorVirtualStorageDevice
collectorVirtualSwitch collectorVirtualSwitch
config Config
collectorFns []func(ch chan<- prometheus.Metric) error
closeFns []func()
} }
func New(config *Config) *Collector { func New(config *Config) *Collector {

View File

@@ -310,26 +310,31 @@ func (c *Collector) collectHypervisorRootPartition(ch chan<- prometheus.Metric)
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartition2MDevicePages, c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartition2MDevicePages,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.hypervisorRootPartition2MGPAPages, c.hypervisorRootPartition2MGPAPages,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartition2MGPAPages, c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartition2MGPAPages,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.hypervisorRootPartition4KDevicePages, c.hypervisorRootPartition4KDevicePages,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartition4KDevicePages, c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartition4KDevicePages,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.hypervisorRootPartition4KGPAPages, c.hypervisorRootPartition4KGPAPages,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartition4KGPAPages, c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartition4KGPAPages,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.hypervisorRootPartitionVirtualTLBFlushEntries, c.hypervisorRootPartitionVirtualTLBFlushEntries,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartitionVirtualTLBFlushEntries, c.perfDataObjectHypervisorRootPartition[0].HypervisorRootPartitionVirtualTLBFlushEntries,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.hypervisorRootPartitionVirtualTLBPages, c.hypervisorRootPartitionVirtualTLBPages,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -195,294 +195,343 @@ func (c *Collector) collectVirtualNetworkAdapterDropReasons(ch chan<- prometheus
data.VirtualNetworkAdapterDropReasonsOutgoingNativeFwdingReq, data.VirtualNetworkAdapterDropReasonsOutgoingNativeFwdingReq,
data.Name, "NativeFwdingReq", "outgoing", data.Name, "NativeFwdingReq", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingNativeFwdingReq, data.VirtualNetworkAdapterDropReasonsIncomingNativeFwdingReq,
data.Name, "NativeFwdingReq", "incoming", data.Name, "NativeFwdingReq", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingMTUMismatch, data.VirtualNetworkAdapterDropReasonsOutgoingMTUMismatch,
data.Name, "MTUMismatch", "outgoing", data.Name, "MTUMismatch", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingMTUMismatch, data.VirtualNetworkAdapterDropReasonsIncomingMTUMismatch,
data.Name, "MTUMismatch", "incoming", data.Name, "MTUMismatch", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingInvalidConfig, data.VirtualNetworkAdapterDropReasonsOutgoingInvalidConfig,
data.Name, "InvalidConfig", "outgoing", data.Name, "InvalidConfig", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingInvalidConfig, data.VirtualNetworkAdapterDropReasonsIncomingInvalidConfig,
data.Name, "InvalidConfig", "incoming", data.Name, "InvalidConfig", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingRequiredExtensionMissing, data.VirtualNetworkAdapterDropReasonsOutgoingRequiredExtensionMissing,
data.Name, "RequiredExtensionMissing", "outgoing", data.Name, "RequiredExtensionMissing", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingRequiredExtensionMissing, data.VirtualNetworkAdapterDropReasonsIncomingRequiredExtensionMissing,
data.Name, "RequiredExtensionMissing", "incoming", data.Name, "RequiredExtensionMissing", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingVirtualSubnetId, data.VirtualNetworkAdapterDropReasonsOutgoingVirtualSubnetId,
data.Name, "VirtualSubnetId", "outgoing", data.Name, "VirtualSubnetId", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingVirtualSubnetId, data.VirtualNetworkAdapterDropReasonsIncomingVirtualSubnetId,
data.Name, "VirtualSubnetId", "incoming", data.Name, "VirtualSubnetId", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingBridgeReserved, data.VirtualNetworkAdapterDropReasonsOutgoingBridgeReserved,
data.Name, "BridgeReserved", "outgoing", data.Name, "BridgeReserved", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingBridgeReserved, data.VirtualNetworkAdapterDropReasonsIncomingBridgeReserved,
data.Name, "BridgeReserved", "incoming", data.Name, "BridgeReserved", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingRouterGuard, data.VirtualNetworkAdapterDropReasonsOutgoingRouterGuard,
data.Name, "RouterGuard", "outgoing", data.Name, "RouterGuard", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingRouterGuard, data.VirtualNetworkAdapterDropReasonsIncomingRouterGuard,
data.Name, "RouterGuard", "incoming", data.Name, "RouterGuard", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingDhcpGuard, data.VirtualNetworkAdapterDropReasonsOutgoingDhcpGuard,
data.Name, "DhcpGuard", "outgoing", data.Name, "DhcpGuard", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingDhcpGuard, data.VirtualNetworkAdapterDropReasonsIncomingDhcpGuard,
data.Name, "DhcpGuard", "incoming", data.Name, "DhcpGuard", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingMacSpoofing, data.VirtualNetworkAdapterDropReasonsOutgoingMacSpoofing,
data.Name, "MacSpoofing", "outgoing", data.Name, "MacSpoofing", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingMacSpoofing, data.VirtualNetworkAdapterDropReasonsIncomingMacSpoofing,
data.Name, "MacSpoofing", "incoming", data.Name, "MacSpoofing", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingIpsec, data.VirtualNetworkAdapterDropReasonsOutgoingIpsec,
data.Name, "Ipsec", "outgoing", data.Name, "Ipsec", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingIpsec, data.VirtualNetworkAdapterDropReasonsIncomingIpsec,
data.Name, "Ipsec", "incoming", data.Name, "Ipsec", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingQos, data.VirtualNetworkAdapterDropReasonsOutgoingQos,
data.Name, "Qos", "outgoing", data.Name, "Qos", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingQos, data.VirtualNetworkAdapterDropReasonsIncomingQos,
data.Name, "Qos", "incoming", data.Name, "Qos", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingFailedPvlanSetting, data.VirtualNetworkAdapterDropReasonsOutgoingFailedPvlanSetting,
data.Name, "FailedPvlanSetting", "outgoing", data.Name, "FailedPvlanSetting", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingFailedPvlanSetting, data.VirtualNetworkAdapterDropReasonsIncomingFailedPvlanSetting,
data.Name, "FailedPvlanSetting", "incoming", data.Name, "FailedPvlanSetting", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingFailedSecurityPolicy, data.VirtualNetworkAdapterDropReasonsOutgoingFailedSecurityPolicy,
data.Name, "FailedSecurityPolicy", "outgoing", data.Name, "FailedSecurityPolicy", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingFailedSecurityPolicy, data.VirtualNetworkAdapterDropReasonsIncomingFailedSecurityPolicy,
data.Name, "FailedSecurityPolicy", "incoming", data.Name, "FailedSecurityPolicy", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingUnauthorizedMAC, data.VirtualNetworkAdapterDropReasonsOutgoingUnauthorizedMAC,
data.Name, "UnauthorizedMAC", "outgoing", data.Name, "UnauthorizedMAC", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingUnauthorizedMAC, data.VirtualNetworkAdapterDropReasonsIncomingUnauthorizedMAC,
data.Name, "UnauthorizedMAC", "incoming", data.Name, "UnauthorizedMAC", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingUnauthorizedVLAN, data.VirtualNetworkAdapterDropReasonsOutgoingUnauthorizedVLAN,
data.Name, "UnauthorizedVLAN", "outgoing", data.Name, "UnauthorizedVLAN", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingUnauthorizedVLAN, data.VirtualNetworkAdapterDropReasonsIncomingUnauthorizedVLAN,
data.Name, "UnauthorizedVLAN", "incoming", data.Name, "UnauthorizedVLAN", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingFilteredVLAN, data.VirtualNetworkAdapterDropReasonsOutgoingFilteredVLAN,
data.Name, "FilteredVLAN", "outgoing", data.Name, "FilteredVLAN", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingFilteredVLAN, data.VirtualNetworkAdapterDropReasonsIncomingFilteredVLAN,
data.Name, "FilteredVLAN", "incoming", data.Name, "FilteredVLAN", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingFiltered, data.VirtualNetworkAdapterDropReasonsOutgoingFiltered,
data.Name, "Filtered", "outgoing", data.Name, "Filtered", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingFiltered, data.VirtualNetworkAdapterDropReasonsIncomingFiltered,
data.Name, "Filtered", "incoming", data.Name, "Filtered", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingBusy, data.VirtualNetworkAdapterDropReasonsOutgoingBusy,
data.Name, "Busy", "outgoing", data.Name, "Busy", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingBusy, data.VirtualNetworkAdapterDropReasonsIncomingBusy,
data.Name, "Busy", "incoming", data.Name, "Busy", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingNotAccepted, data.VirtualNetworkAdapterDropReasonsOutgoingNotAccepted,
data.Name, "NotAccepted", "outgoing", data.Name, "NotAccepted", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingNotAccepted, data.VirtualNetworkAdapterDropReasonsIncomingNotAccepted,
data.Name, "NotAccepted", "incoming", data.Name, "NotAccepted", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingDisconnected, data.VirtualNetworkAdapterDropReasonsOutgoingDisconnected,
data.Name, "Disconnected", "outgoing", data.Name, "Disconnected", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingDisconnected, data.VirtualNetworkAdapterDropReasonsIncomingDisconnected,
data.Name, "Disconnected", "incoming", data.Name, "Disconnected", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingNotReady, data.VirtualNetworkAdapterDropReasonsOutgoingNotReady,
data.Name, "NotReady", "outgoing", data.Name, "NotReady", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingNotReady, data.VirtualNetworkAdapterDropReasonsIncomingNotReady,
data.Name, "NotReady", "incoming", data.Name, "NotReady", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingResources, data.VirtualNetworkAdapterDropReasonsOutgoingResources,
data.Name, "Resources", "outgoing", data.Name, "Resources", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingResources, data.VirtualNetworkAdapterDropReasonsIncomingResources,
data.Name, "Resources", "incoming", data.Name, "Resources", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingInvalidPacket, data.VirtualNetworkAdapterDropReasonsOutgoingInvalidPacket,
data.Name, "InvalidPacket", "outgoing", data.Name, "InvalidPacket", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingInvalidPacket, data.VirtualNetworkAdapterDropReasonsIncomingInvalidPacket,
data.Name, "InvalidPacket", "incoming", data.Name, "InvalidPacket", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingInvalidData, data.VirtualNetworkAdapterDropReasonsOutgoingInvalidData,
data.Name, "InvalidData", "outgoing", data.Name, "InvalidData", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsIncomingInvalidData, data.VirtualNetworkAdapterDropReasonsIncomingInvalidData,
data.Name, "InvalidData", "incoming", data.Name, "InvalidData", "incoming",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualNetworkAdapterDropReasonsOutgoingUnknown, data.VirtualNetworkAdapterDropReasonsOutgoingUnknown,
data.Name, "Unknown", "outgoing", data.Name, "Unknown", "outgoing",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualNetworkAdapterDropReasons, c.virtualNetworkAdapterDropReasons,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -265,6 +265,7 @@ func (c *Collector) collectVirtualSwitch(ch chan<- prometheus.Metric) error {
data.VirtualSwitchDirectedPacketsReceived, data.VirtualSwitchDirectedPacketsReceived,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchDirectedPacketsSent, c.virtualSwitchDirectedPacketsSent,
prometheus.CounterValue, prometheus.CounterValue,
@@ -278,18 +279,21 @@ func (c *Collector) collectVirtualSwitch(ch chan<- prometheus.Metric) error {
data.VirtualSwitchDroppedPacketsIncoming, data.VirtualSwitchDroppedPacketsIncoming,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchDroppedPacketsOutgoing, c.virtualSwitchDroppedPacketsOutgoing,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualSwitchDroppedPacketsOutgoing, data.VirtualSwitchDroppedPacketsOutgoing,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchExtensionsDroppedPacketsIncoming, c.virtualSwitchExtensionsDroppedPacketsIncoming,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualSwitchExtensionsDroppedPacketsIncoming, data.VirtualSwitchExtensionsDroppedPacketsIncoming,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchExtensionsDroppedPacketsOutgoing, c.virtualSwitchExtensionsDroppedPacketsOutgoing,
prometheus.CounterValue, prometheus.CounterValue,
@@ -303,24 +307,28 @@ func (c *Collector) collectVirtualSwitch(ch chan<- prometheus.Metric) error {
data.VirtualSwitchLearnedMacAddresses, data.VirtualSwitchLearnedMacAddresses,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchMulticastPacketsReceived, c.virtualSwitchMulticastPacketsReceived,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualSwitchMulticastPacketsReceived, data.VirtualSwitchMulticastPacketsReceived,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchMulticastPacketsSent, c.virtualSwitchMulticastPacketsSent,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualSwitchMulticastPacketsSent, data.VirtualSwitchMulticastPacketsSent,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchNumberOfSendChannelMoves, c.virtualSwitchNumberOfSendChannelMoves,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualSwitchNumberOfSendChannelMoves, data.VirtualSwitchNumberOfSendChannelMoves,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchNumberOfVMQMoves, c.virtualSwitchNumberOfVMQMoves,
prometheus.CounterValue, prometheus.CounterValue,
@@ -348,12 +356,14 @@ func (c *Collector) collectVirtualSwitch(ch chan<- prometheus.Metric) error {
data.VirtualSwitchPacketsReceived, data.VirtualSwitchPacketsReceived,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchPacketsSent, c.virtualSwitchPacketsSent,
prometheus.CounterValue, prometheus.CounterValue,
data.VirtualSwitchPacketsSent, data.VirtualSwitchPacketsSent,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualSwitchPurgedMacAddresses, c.virtualSwitchPurgedMacAddresses,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -50,17 +50,18 @@ var ConfigDefaults = Config{
} }
type Collector struct { type Collector struct {
collectorWebService
collectorHttpServiceRequestQueues
collectorAppPoolWAS
collectorW3SVCW3WP
collectorWebServiceCache
config Config config Config
iisVersion simpleVersion iisVersion simpleVersion
logger *slog.Logger logger *slog.Logger
info *prometheus.Desc info *prometheus.Desc
collectorWebService
collectorHttpServiceRequestQueues
collectorAppPoolWAS
collectorW3SVCW3WP
collectorWebServiceCache
} }
func New(config *Config) *Collector { func New(config *Config) *Collector {

View File

@@ -201,66 +201,77 @@ func (c *Collector) collectAppPoolWAS(ch chan<- prometheus.Metric) error {
data.CurrentApplicationPoolUptime, data.CurrentApplicationPoolUptime,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.currentWorkerProcesses, c.currentWorkerProcesses,
prometheus.GaugeValue, prometheus.GaugeValue,
data.CurrentWorkerProcesses, data.CurrentWorkerProcesses,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.maximumWorkerProcesses, c.maximumWorkerProcesses,
prometheus.GaugeValue, prometheus.GaugeValue,
data.MaximumWorkerProcesses, data.MaximumWorkerProcesses,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.recentWorkerProcessFailures, c.recentWorkerProcessFailures,
prometheus.GaugeValue, prometheus.GaugeValue,
data.RecentWorkerProcessFailures, data.RecentWorkerProcessFailures,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.timeSinceLastWorkerProcessFailure, c.timeSinceLastWorkerProcessFailure,
prometheus.GaugeValue, prometheus.GaugeValue,
data.TimeSinceLastWorkerProcessFailure, data.TimeSinceLastWorkerProcessFailure,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalApplicationPoolRecycles, c.totalApplicationPoolRecycles,
prometheus.CounterValue, prometheus.CounterValue,
data.TotalApplicationPoolRecycles, data.TotalApplicationPoolRecycles,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalApplicationPoolUptime, c.totalApplicationPoolUptime,
prometheus.CounterValue, prometheus.CounterValue,
data.TotalApplicationPoolUptime, data.TotalApplicationPoolUptime,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalWorkerProcessesCreated, c.totalWorkerProcessesCreated,
prometheus.CounterValue, prometheus.CounterValue,
data.TotalWorkerProcessesCreated, data.TotalWorkerProcessesCreated,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalWorkerProcessFailures, c.totalWorkerProcessFailures,
prometheus.CounterValue, prometheus.CounterValue,
data.TotalWorkerProcessFailures, data.TotalWorkerProcessFailures,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalWorkerProcessPingFailures, c.totalWorkerProcessPingFailures,
prometheus.CounterValue, prometheus.CounterValue,
data.TotalWorkerProcessPingFailures, data.TotalWorkerProcessPingFailures,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalWorkerProcessShutdownFailures, c.totalWorkerProcessShutdownFailures,
prometheus.CounterValue, prometheus.CounterValue,
data.TotalWorkerProcessShutdownFailures, data.TotalWorkerProcessShutdownFailures,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalWorkerProcessStartupFailures, c.totalWorkerProcessStartupFailures,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -110,18 +110,21 @@ func (c *Collector) collectHttpServiceRequestQueues(ch chan<- prometheus.Metric)
data.HttpRequestQueuesCurrentQueueSize, data.HttpRequestQueuesCurrentQueueSize,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.httpRequestQueuesTotalRejectedRequest, c.httpRequestQueuesTotalRejectedRequest,
prometheus.GaugeValue, prometheus.GaugeValue,
data.HttpRequestQueuesTotalRejectedRequests, data.HttpRequestQueuesTotalRejectedRequests,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.httpRequestQueuesMaxQueueItemAge, c.httpRequestQueuesMaxQueueItemAge,
prometheus.GaugeValue, prometheus.GaugeValue,
data.HttpRequestQueuesMaxQueueItemAge, data.HttpRequestQueuesMaxQueueItemAge,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.httpRequestQueuesArrivalRate, c.httpRequestQueuesArrivalRate,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -441,6 +441,7 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
pid, pid,
"401", "401",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPRequestErrorsTotal, c.w3SVCW3WPRequestErrorsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -449,6 +450,7 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
pid, pid,
"403", "403",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPRequestErrorsTotal, c.w3SVCW3WPRequestErrorsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -457,6 +459,7 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
pid, pid,
"404", "404",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPRequestErrorsTotal, c.w3SVCW3WPRequestErrorsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -465,6 +468,7 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
pid, pid,
"500", "500",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPWebSocketRequestsActive, c.w3SVCW3WPWebSocketRequestsActive,
prometheus.CounterValue, prometheus.CounterValue,
@@ -472,6 +476,7 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPWebSocketConnectionAttempts, c.w3SVCW3WPWebSocketConnectionAttempts,
prometheus.CounterValue, prometheus.CounterValue,
@@ -479,6 +484,7 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPWebSocketConnectionsAccepted, c.w3SVCW3WPWebSocketConnectionsAccepted,
prometheus.CounterValue, prometheus.CounterValue,
@@ -486,6 +492,7 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPWebSocketConnectionsRejected, c.w3SVCW3WPWebSocketConnectionsRejected,
prometheus.CounterValue, prometheus.CounterValue,
@@ -529,6 +536,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
pid, pid,
"busy", "busy",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMaximumThreads, c.w3SVCW3WPMaximumThreads,
prometheus.CounterValue, prometheus.CounterValue,
@@ -536,6 +544,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPRequestsTotal, c.w3SVCW3WPRequestsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -543,6 +552,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPRequestsActive, c.w3SVCW3WPRequestsActive,
prometheus.CounterValue, prometheus.CounterValue,
@@ -550,6 +560,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPActiveFlushedEntries, c.w3SVCW3WPActiveFlushedEntries,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -557,6 +568,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPCurrentFileCacheMemoryUsage, c.w3SVCW3WPCurrentFileCacheMemoryUsage,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -564,6 +576,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMaximumFileCacheMemoryUsage, c.w3SVCW3WPMaximumFileCacheMemoryUsage,
prometheus.CounterValue, prometheus.CounterValue,
@@ -571,6 +584,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPFileCacheFlushesTotal, c.w3SVCW3WPFileCacheFlushesTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -578,6 +592,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPFileCacheQueriesTotal, c.w3SVCW3WPFileCacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -585,6 +600,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPFileCacheHitsTotal, c.w3SVCW3WPFileCacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -592,6 +608,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPFilesCached, c.w3SVCW3WPFilesCached,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -599,6 +616,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPFilesCachedTotal, c.w3SVCW3WPFilesCachedTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -606,6 +624,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPFilesFlushedTotal, c.w3SVCW3WPFilesFlushedTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -613,6 +632,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPURICacheFlushesTotal, c.w3SVCW3WPURICacheFlushesTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -620,6 +640,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPURICacheQueriesTotal, c.w3SVCW3WPURICacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -627,6 +648,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPURICacheHitsTotal, c.w3SVCW3WPURICacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -634,6 +656,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPURIsCached, c.w3SVCW3WPURIsCached,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -641,6 +664,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPURIsCachedTotal, c.w3SVCW3WPURIsCachedTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -648,6 +672,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPURIsFlushedTotal, c.w3SVCW3WPURIsFlushedTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -655,6 +680,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMetadataCached, c.w3SVCW3WPMetadataCached,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -662,6 +688,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMetadataCacheFlushes, c.w3SVCW3WPMetadataCacheFlushes,
prometheus.CounterValue, prometheus.CounterValue,
@@ -669,6 +696,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMetadataCacheQueriesTotal, c.w3SVCW3WPMetadataCacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -676,6 +704,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMetadataCacheHitsTotal, c.w3SVCW3WPMetadataCacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -683,6 +712,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMetadataCachedTotal, c.w3SVCW3WPMetadataCachedTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -690,6 +720,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMetadataFlushedTotal, c.w3SVCW3WPMetadataFlushedTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -697,6 +728,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPOutputCacheActiveFlushedItems, c.w3SVCW3WPOutputCacheActiveFlushedItems,
prometheus.CounterValue, prometheus.CounterValue,
@@ -704,6 +736,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPOutputCacheItems, c.w3SVCW3WPOutputCacheItems,
prometheus.CounterValue, prometheus.CounterValue,
@@ -711,6 +744,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPOutputCacheMemoryUsage, c.w3SVCW3WPOutputCacheMemoryUsage,
prometheus.CounterValue, prometheus.CounterValue,
@@ -718,6 +752,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPOutputCacheQueriesTotal, c.w3SVCW3WPOutputCacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -725,6 +760,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPOutputCacheHitsTotal, c.w3SVCW3WPOutputCacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -732,6 +768,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPOutputCacheFlushedItemsTotal, c.w3SVCW3WPOutputCacheFlushedItemsTotal,
prometheus.CounterValue, prometheus.CounterValue,
@@ -739,6 +776,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
name, name,
pid, pid,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPOutputCacheFlushesTotal, c.w3SVCW3WPOutputCacheFlushesTotal,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -262,126 +262,147 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.WebServiceCurrentAnonymousUsers, data.WebServiceCurrentAnonymousUsers,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceCurrentBlockedAsyncIORequests, c.webServiceCurrentBlockedAsyncIORequests,
prometheus.GaugeValue, prometheus.GaugeValue,
data.WebServiceCurrentBlockedAsyncIORequests, data.WebServiceCurrentBlockedAsyncIORequests,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceCurrentCGIRequests, c.webServiceCurrentCGIRequests,
prometheus.GaugeValue, prometheus.GaugeValue,
data.WebServiceCurrentCGIRequests, data.WebServiceCurrentCGIRequests,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceCurrentConnections, c.webServiceCurrentConnections,
prometheus.GaugeValue, prometheus.GaugeValue,
data.WebServiceCurrentConnections, data.WebServiceCurrentConnections,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceCurrentISAPIExtensionRequests, c.webServiceCurrentISAPIExtensionRequests,
prometheus.GaugeValue, prometheus.GaugeValue,
data.WebServiceCurrentISAPIExtensionRequests, data.WebServiceCurrentISAPIExtensionRequests,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceCurrentNonAnonymousUsers, c.webServiceCurrentNonAnonymousUsers,
prometheus.GaugeValue, prometheus.GaugeValue,
data.WebServiceCurrentNonAnonymousUsers, data.WebServiceCurrentNonAnonymousUsers,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceServiceUptime, c.webServiceServiceUptime,
prometheus.GaugeValue, prometheus.GaugeValue,
data.WebServiceServiceUptime, data.WebServiceServiceUptime,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalBytesReceived, c.webServiceTotalBytesReceived,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalBytesReceived, data.WebServiceTotalBytesReceived,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalBytesSent, c.webServiceTotalBytesSent,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalBytesSent, data.WebServiceTotalBytesSent,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalAnonymousUsers, c.webServiceTotalAnonymousUsers,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalAnonymousUsers, data.WebServiceTotalAnonymousUsers,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalBlockedAsyncIORequests, c.webServiceTotalBlockedAsyncIORequests,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalBlockedAsyncIORequests, data.WebServiceTotalBlockedAsyncIORequests,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalCGIRequests, c.webServiceTotalCGIRequests,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalCGIRequests, data.WebServiceTotalCGIRequests,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalConnectionAttemptsAllInstances, c.webServiceTotalConnectionAttemptsAllInstances,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalConnectionAttemptsAllInstances, data.WebServiceTotalConnectionAttemptsAllInstances,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalFilesReceived, c.webServiceTotalFilesReceived,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalFilesReceived, data.WebServiceTotalFilesReceived,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalFilesSent, c.webServiceTotalFilesSent,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalFilesSent, data.WebServiceTotalFilesSent,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalISAPIExtensionRequests, c.webServiceTotalISAPIExtensionRequests,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalISAPIExtensionRequests, data.WebServiceTotalISAPIExtensionRequests,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalLockedErrors, c.webServiceTotalLockedErrors,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalLockedErrors, data.WebServiceTotalLockedErrors,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalLogonAttempts, c.webServiceTotalLogonAttempts,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalLogonAttempts, data.WebServiceTotalLogonAttempts,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalNonAnonymousUsers, c.webServiceTotalNonAnonymousUsers,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalNonAnonymousUsers, data.WebServiceTotalNonAnonymousUsers,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalNotFoundErrors, c.webServiceTotalNotFoundErrors,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalNotFoundErrors, data.WebServiceTotalNotFoundErrors,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRejectedAsyncIORequests, c.webServiceTotalRejectedAsyncIORequests,
prometheus.CounterValue, prometheus.CounterValue,
data.WebServiceTotalRejectedAsyncIORequests, data.WebServiceTotalRejectedAsyncIORequests,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -389,6 +410,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"other", "other",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -396,6 +418,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"COPY", "COPY",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -403,6 +426,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"DELETE", "DELETE",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -410,6 +434,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"GET", "GET",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -417,6 +442,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"HEAD", "HEAD",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -424,6 +450,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"LOCK", "LOCK",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -431,6 +458,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"MKCOL", "MKCOL",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -438,6 +466,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"MOVE", "MOVE",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -445,6 +474,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"OPTIONS", "OPTIONS",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -452,6 +482,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"POST", "POST",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -459,6 +490,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"PROPFIND", "PROPFIND",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -466,6 +498,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"PROPPATCH", "PROPPATCH",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -473,6 +506,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"PUT", "PUT",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -480,6 +514,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"SEARCH", "SEARCH",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,
@@ -487,6 +522,7 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
data.Name, data.Name,
"TRACE", "TRACE",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.webServiceTotalRequests, c.webServiceTotalRequests,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -293,178 +293,211 @@ func (c *Collector) collectWebServiceCache(ch chan<- prometheus.Metric) error {
prometheus.GaugeValue, prometheus.GaugeValue,
data.ServiceCacheActiveFlushedEntries, data.ServiceCacheActiveFlushedEntries,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheCurrentFileCacheMemoryUsage, c.serviceCacheCurrentFileCacheMemoryUsage,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ServiceCacheCurrentFileCacheMemoryUsage, data.ServiceCacheCurrentFileCacheMemoryUsage,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheMaximumFileCacheMemoryUsage, c.serviceCacheMaximumFileCacheMemoryUsage,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheMaximumFileCacheMemoryUsage, data.ServiceCacheMaximumFileCacheMemoryUsage,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheFileCacheFlushesTotal, c.serviceCacheFileCacheFlushesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheFileCacheFlushesTotal, data.ServiceCacheFileCacheFlushesTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheFileCacheQueriesTotal, c.serviceCacheFileCacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheFileCacheHitsTotal+data.ServiceCacheFileCacheMissesTotal, data.ServiceCacheFileCacheHitsTotal+data.ServiceCacheFileCacheMissesTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheFileCacheHitsTotal, c.serviceCacheFileCacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheFileCacheHitsTotal, data.ServiceCacheFileCacheHitsTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheFilesCached, c.serviceCacheFilesCached,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ServiceCacheFilesCached, data.ServiceCacheFilesCached,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheFilesCachedTotal, c.serviceCacheFilesCachedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheFilesCachedTotal, data.ServiceCacheFilesCachedTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheFilesFlushedTotal, c.serviceCacheFilesFlushedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheFilesFlushedTotal, data.ServiceCacheFilesFlushedTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheFlushesTotal, c.serviceCacheURICacheFlushesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURICacheFlushesTotal, data.ServiceCacheURICacheFlushesTotal,
"user", "user",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheFlushesTotal, c.serviceCacheURICacheFlushesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURICacheFlushesTotalKernel, data.ServiceCacheURICacheFlushesTotalKernel,
"kernel", "kernel",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheQueriesTotal, c.serviceCacheURICacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURICacheHitsTotal+data.ServiceCacheURICacheMissesTotal, data.ServiceCacheURICacheHitsTotal+data.ServiceCacheURICacheMissesTotal,
"user", "user",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheQueriesTotal, c.serviceCacheURICacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURICacheHitsTotalKernel+data.ServiceCacheURICacheMissesTotalKernel, data.ServiceCacheURICacheHitsTotalKernel+data.ServiceCacheURICacheMissesTotalKernel,
"kernel", "kernel",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheHitsTotal, c.serviceCacheURICacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURICacheHitsTotal, data.ServiceCacheURICacheHitsTotal,
"user", "user",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheHitsTotal, c.serviceCacheURICacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURICacheHitsTotalKernel, data.ServiceCacheURICacheHitsTotalKernel,
"kernel", "kernel",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsCached, c.serviceCacheURIsCached,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ServiceCacheURIsCached, data.ServiceCacheURIsCached,
"user", "user",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsCached, c.serviceCacheURIsCached,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ServiceCacheURIsCachedKernel, data.ServiceCacheURIsCachedKernel,
"kernel", "kernel",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsCachedTotal, c.serviceCacheURIsCachedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURIsCachedTotal, data.ServiceCacheURIsCachedTotal,
"user", "user",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsCachedTotal, c.serviceCacheURIsCachedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURIsCachedTotalKernel, data.ServiceCacheURIsCachedTotalKernel,
"kernel", "kernel",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsFlushedTotal, c.serviceCacheURIsFlushedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURIsFlushedTotal, data.ServiceCacheURIsFlushedTotal,
"user", "user",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsFlushedTotal, c.serviceCacheURIsFlushedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheURIsFlushedTotalKernel, data.ServiceCacheURIsFlushedTotalKernel,
"kernel", "kernel",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCached, c.serviceCacheMetadataCached,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ServiceCacheMetadataCached, data.ServiceCacheMetadataCached,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCacheFlushes, c.serviceCacheMetadataCacheFlushes,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheMetadataCacheFlushes, data.ServiceCacheMetadataCacheFlushes,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCacheQueriesTotal, c.serviceCacheMetadataCacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheMetaDataCacheHits+data.ServiceCacheMetaDataCacheMisses, data.ServiceCacheMetaDataCacheHits+data.ServiceCacheMetaDataCacheMisses,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCacheHitsTotal, c.serviceCacheMetadataCacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
0, // data.ServiceCacheMetadataCacheHitsTotal, 0, // data.ServiceCacheMetadataCacheHitsTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCachedTotal, c.serviceCacheMetadataCachedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheMetadataCachedTotal, data.ServiceCacheMetadataCachedTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataFlushedTotal, c.serviceCacheMetadataFlushedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheMetadataFlushedTotal, data.ServiceCacheMetadataFlushedTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheActiveFlushedItems, c.serviceCacheOutputCacheActiveFlushedItems,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheOutputCacheActiveFlushedItems, data.ServiceCacheOutputCacheActiveFlushedItems,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheItems, c.serviceCacheOutputCacheItems,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheOutputCacheItems, data.ServiceCacheOutputCacheItems,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheMemoryUsage, c.serviceCacheOutputCacheMemoryUsage,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheOutputCacheMemoryUsage, data.ServiceCacheOutputCacheMemoryUsage,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheQueriesTotal, c.serviceCacheOutputCacheQueriesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheOutputCacheHitsTotal+data.ServiceCacheOutputCacheMissesTotal, data.ServiceCacheOutputCacheHitsTotal+data.ServiceCacheOutputCacheMissesTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheHitsTotal, c.serviceCacheOutputCacheHitsTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheOutputCacheHitsTotal, data.ServiceCacheOutputCacheHitsTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheFlushedItemsTotal, c.serviceCacheOutputCacheFlushedItemsTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.ServiceCacheOutputCacheFlushedItemsTotal, data.ServiceCacheOutputCacheFlushedItemsTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheFlushesTotal, c.serviceCacheOutputCacheFlushesTotal,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -514,6 +514,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
if slices.Contains(c.config.CollectorsEnabled, subCollectorBitlocker) { if slices.Contains(c.config.CollectorsEnabled, subCollectorBitlocker) {
c.bitlockerReqCh <- data.Name c.bitlockerReqCh <- data.Name
bitlockerStatus := <-c.bitlockerResCh bitlockerStatus := <-c.bitlockerResCh
if bitlockerStatus.err != nil { if bitlockerStatus.err != nil {

View File

@@ -57,14 +57,14 @@ var ConfigDefaults = Config{
// A Collector is a Prometheus Collector for WMI MSCluster_Cluster metrics. // A Collector is a Prometheus Collector for WMI MSCluster_Cluster metrics.
type Collector struct { type Collector struct {
config Config
miSession *mi.Session
collectorCluster collectorCluster
collectorNetwork collectorNetwork
collectorNode collectorNode
collectorResource collectorResource
collectorResourceGroup collectorResourceGroup
config Config
miSession *mi.Session
} }
func New(config *Config) *Collector { func New(config *Config) *Collector {

View File

@@ -265,6 +265,7 @@ func (c *Collector) collectResource(ch chan<- prometheus.Metric, nodeNames []str
if v.OwnerNode == nodeName { if v.OwnerNode == nodeName {
isCurrentState = 1.0 isCurrentState = 1.0
} }
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.resourceOwnerNode, c.resourceOwnerNode,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -260,6 +260,7 @@ func (c *Collector) collectResourceGroup(ch chan<- prometheus.Metric, nodeNames
if v.OwnerNode == nodeName { if v.OwnerNode == nodeName {
isCurrentState = 1.0 isCurrentState = 1.0
} }
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.resourceGroupOwnerNode, c.resourceGroupOwnerNode,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -78,18 +78,6 @@ var ConfigDefaults = Config{
// A Collector is a Prometheus Collector for various WMI Win32_PerfRawData_MSSQLSERVER_* metrics. // A Collector is a Prometheus Collector for various WMI Win32_PerfRawData_MSSQLSERVER_* metrics.
type Collector struct { type Collector struct {
config Config
logger *slog.Logger
mssqlInstances []mssqlInstance
collectorFns []func(ch chan<- prometheus.Metric) error
closeFns []func()
// meta
mssqlScrapeDurationDesc *prometheus.Desc
mssqlScrapeSuccessDesc *prometheus.Desc
collectorAccessMethods collectorAccessMethods
collectorAvailabilityReplica collectorAvailabilityReplica
collectorBufferManager collectorBufferManager
@@ -103,6 +91,18 @@ type Collector struct {
collectorSQLStats collectorSQLStats
collectorTransactions collectorTransactions
collectorWaitStats collectorWaitStats
config Config
logger *slog.Logger
mssqlInstances []mssqlInstance
collectorFns []func(ch chan<- prometheus.Metric) error
closeFns []func()
// meta
mssqlScrapeDurationDesc *prometheus.Desc
mssqlScrapeSuccessDesc *prometheus.Desc
} }
func New(config *Config) *Collector { func New(config *Config) *Collector {
@@ -405,6 +405,7 @@ func (c *Collector) collect(
duration.Seconds(), duration.Seconds(),
collector, sqlInstance.name, collector, sqlInstance.name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.mssqlScrapeSuccessDesc, c.mssqlScrapeSuccessDesc,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -331,72 +331,84 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
data.BytesReceivedPerSec, data.BytesReceivedPerSec,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bytesSentTotal, c.bytesSentTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.BytesSentPerSec, data.BytesSentPerSec,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.bytesTotal, c.bytesTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.BytesTotalPerSec, data.BytesTotalPerSec,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.outputQueueLength, c.outputQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
data.OutputQueueLength, data.OutputQueueLength,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsOutboundDiscarded, c.packetsOutboundDiscarded,
prometheus.CounterValue, prometheus.CounterValue,
data.PacketsOutboundDiscarded, data.PacketsOutboundDiscarded,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsOutboundErrors, c.packetsOutboundErrors,
prometheus.CounterValue, prometheus.CounterValue,
data.PacketsOutboundErrors, data.PacketsOutboundErrors,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsTotal, c.packetsTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.PacketsPerSec, data.PacketsPerSec,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsReceivedDiscarded, c.packetsReceivedDiscarded,
prometheus.CounterValue, prometheus.CounterValue,
data.PacketsReceivedDiscarded, data.PacketsReceivedDiscarded,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsReceivedErrors, c.packetsReceivedErrors,
prometheus.CounterValue, prometheus.CounterValue,
data.PacketsReceivedErrors, data.PacketsReceivedErrors,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsReceivedTotal, c.packetsReceivedTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.PacketsReceivedPerSec, data.PacketsReceivedPerSec,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsReceivedUnknown, c.packetsReceivedUnknown,
prometheus.CounterValue, prometheus.CounterValue,
data.PacketsReceivedUnknown, data.PacketsReceivedUnknown,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.packetsSentTotal, c.packetsSentTotal,
prometheus.CounterValue, prometheus.CounterValue,
data.PacketsSentPerSec, data.PacketsSentPerSec,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.currentBandwidth, c.currentBandwidth,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -280,60 +280,70 @@ func (c *Collector) collectRemoteFXNetworkCount(ch chan<- prometheus.Metric) err
utils.MilliSecToSec(data.BaseTCPRTT), utils.MilliSecToSec(data.BaseTCPRTT),
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.baseUDPRTT, c.baseUDPRTT,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.BaseUDPRTT), utils.MilliSecToSec(data.BaseUDPRTT),
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.currentTCPBandwidth, c.currentTCPBandwidth,
prometheus.GaugeValue, prometheus.GaugeValue,
(data.CurrentTCPBandwidth*1000)/8, (data.CurrentTCPBandwidth*1000)/8,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.currentTCPRTT, c.currentTCPRTT,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.CurrentTCPRTT), utils.MilliSecToSec(data.CurrentTCPRTT),
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.currentUDPBandwidth, c.currentUDPBandwidth,
prometheus.GaugeValue, prometheus.GaugeValue,
(data.CurrentUDPBandwidth*1000)/8, (data.CurrentUDPBandwidth*1000)/8,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.currentUDPRTT, c.currentUDPRTT,
prometheus.GaugeValue, prometheus.GaugeValue,
utils.MilliSecToSec(data.CurrentUDPRTT), utils.MilliSecToSec(data.CurrentUDPRTT),
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalReceivedBytes, c.totalReceivedBytes,
prometheus.CounterValue, prometheus.CounterValue,
data.TotalReceivedBytes, data.TotalReceivedBytes,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.totalSentBytes, c.totalSentBytes,
prometheus.CounterValue, prometheus.CounterValue,
data.TotalSentBytes, data.TotalSentBytes,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.udpPacketsReceivedPerSec, c.udpPacketsReceivedPerSec,
prometheus.CounterValue, prometheus.CounterValue,
data.UDPPacketsReceivedPersec, data.UDPPacketsReceivedPersec,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.udpPacketsSentPerSec, c.udpPacketsSentPerSec,
prometheus.CounterValue, prometheus.CounterValue,
data.UDPPacketsSentPersec, data.UDPPacketsSentPersec,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.fecRate, c.fecRate,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -378,12 +388,14 @@ func (c *Collector) collectRemoteFXGraphicsCounters(ch chan<- prometheus.Metric)
utils.MilliSecToSec(data.AverageEncodingTime), utils.MilliSecToSec(data.AverageEncodingTime),
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.frameQuality, c.frameQuality,
prometheus.GaugeValue, prometheus.GaugeValue,
data.FrameQuality, data.FrameQuality,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.framesSkippedPerSecondInsufficientResources, c.framesSkippedPerSecondInsufficientResources,
prometheus.CounterValue, prometheus.CounterValue,
@@ -391,6 +403,7 @@ func (c *Collector) collectRemoteFXGraphicsCounters(ch chan<- prometheus.Metric)
sessionName, sessionName,
"client", "client",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.framesSkippedPerSecondInsufficientResources, c.framesSkippedPerSecondInsufficientResources,
prometheus.CounterValue, prometheus.CounterValue,
@@ -398,6 +411,7 @@ func (c *Collector) collectRemoteFXGraphicsCounters(ch chan<- prometheus.Metric)
sessionName, sessionName,
"network", "network",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.framesSkippedPerSecondInsufficientResources, c.framesSkippedPerSecondInsufficientResources,
prometheus.CounterValue, prometheus.CounterValue,
@@ -405,24 +419,28 @@ func (c *Collector) collectRemoteFXGraphicsCounters(ch chan<- prometheus.Metric)
sessionName, sessionName,
"server", "server",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.graphicsCompressionRatio, c.graphicsCompressionRatio,
prometheus.GaugeValue, prometheus.GaugeValue,
data.GraphicsCompressionratio, data.GraphicsCompressionratio,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.inputFramesPerSecond, c.inputFramesPerSecond,
prometheus.CounterValue, prometheus.CounterValue,
data.InputFramesPerSecond, data.InputFramesPerSecond,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.outputFramesPerSecond, c.outputFramesPerSecond,
prometheus.CounterValue, prometheus.CounterValue,
data.OutputFramesPerSecond, data.OutputFramesPerSecond,
sessionName, sessionName,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.sourceFramesPerSecond, c.sourceFramesPerSecond,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -316,6 +316,7 @@ func (c *Collector) collectService(ch chan<- prometheus.Metric, serviceName stri
if startMode == c.apiStartModeValues[serviceConfig.StartType] { if startMode == c.apiStartModeValues[serviceConfig.StartType] {
isCurrentStartMode = 1.0 isCurrentStartMode = 1.0
} }
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.startMode, c.startMode,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -401,7 +402,6 @@ func (c *Collector) queryAllServices() ([]windows.ENUM_SERVICE_STATUS_PROCESS, e
nil, nil,
nil, nil,
) )
if err == nil { if err == nil {
break break
} }
@@ -443,7 +443,6 @@ func (c *Collector) getProcessStartTime(pid uint32) (uint64, error) {
) )
err = windows.GetProcessTimes(handle, &creation, &exit, &krn, &user) err = windows.GetProcessTimes(handle, &creation, &exit, &krn, &user)
if err := windows.CloseHandle(handle); err != nil { if err := windows.CloseHandle(handle); err != nil {
c.logger.LogAttrs(context.Background(), slog.LevelWarn, "failed to close process handle", c.logger.LogAttrs(context.Background(), slog.LevelWarn, "failed to close process handle",
slog.Any("err", err), slog.Any("err", err),

View File

@@ -168,26 +168,31 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].ContextSwitchesPerSec, c.perfDataObject[0].ContextSwitchesPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.exceptionDispatchesTotal, c.exceptionDispatchesTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].ExceptionDispatchesPerSec, c.perfDataObject[0].ExceptionDispatchesPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.processorQueueLength, c.processorQueueLength,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].ProcessorQueueLength, c.perfDataObject[0].ProcessorQueueLength,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.processes, c.processes,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].Processes, c.perfDataObject[0].Processes,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.systemCallsTotal, c.systemCallsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].SystemCallsPerSec, c.perfDataObject[0].SystemCallsPerSec,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.threads, c.threads,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -259,48 +259,56 @@ func (c *Collector) writeTCPCounters(ch chan<- prometheus.Metric, metrics []perf
metrics[0].ConnectionFailures, metrics[0].ConnectionFailures,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.connectionsActive, c.connectionsActive,
prometheus.CounterValue, prometheus.CounterValue,
metrics[0].ConnectionsActive, metrics[0].ConnectionsActive,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.connectionsEstablished, c.connectionsEstablished,
prometheus.GaugeValue, prometheus.GaugeValue,
metrics[0].ConnectionsEstablished, metrics[0].ConnectionsEstablished,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.connectionsPassive, c.connectionsPassive,
prometheus.CounterValue, prometheus.CounterValue,
metrics[0].ConnectionsPassive, metrics[0].ConnectionsPassive,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.connectionsReset, c.connectionsReset,
prometheus.CounterValue, prometheus.CounterValue,
metrics[0].ConnectionsReset, metrics[0].ConnectionsReset,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.segmentsTotal, c.segmentsTotal,
prometheus.CounterValue, prometheus.CounterValue,
metrics[0].SegmentsPerSec, metrics[0].SegmentsPerSec,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.segmentsReceivedTotal, c.segmentsReceivedTotal,
prometheus.CounterValue, prometheus.CounterValue,
metrics[0].SegmentsReceivedPerSec, metrics[0].SegmentsReceivedPerSec,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.segmentsRetransmittedTotal, c.segmentsRetransmittedTotal,
prometheus.CounterValue, prometheus.CounterValue,
metrics[0].SegmentsRetransmittedPerSec, metrics[0].SegmentsRetransmittedPerSec,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.segmentsSentTotal, c.segmentsSentTotal,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -308,24 +308,28 @@ func (c *Collector) collectTSSessionCounters(ch chan<- prometheus.Metric) error
data.HandleCount, data.HandleCount,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.pageFaultsPerSec, c.pageFaultsPerSec,
prometheus.CounterValue, prometheus.CounterValue,
data.PageFaultsPersec, data.PageFaultsPersec,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.pageFileBytes, c.pageFileBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
data.PageFileBytes, data.PageFileBytes,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.pageFileBytesPeak, c.pageFileBytesPeak,
prometheus.GaugeValue, prometheus.GaugeValue,
data.PageFileBytesPeak, data.PageFileBytesPeak,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.percentCPUTime, c.percentCPUTime,
prometheus.CounterValue, prometheus.CounterValue,
@@ -333,6 +337,7 @@ func (c *Collector) collectTSSessionCounters(ch chan<- prometheus.Metric) error
data.Name, data.Name,
"privileged", "privileged",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.percentCPUTime, c.percentCPUTime,
prometheus.CounterValue, prometheus.CounterValue,
@@ -340,6 +345,7 @@ func (c *Collector) collectTSSessionCounters(ch chan<- prometheus.Metric) error
data.Name, data.Name,
"processor", "processor",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.percentCPUTime, c.percentCPUTime,
prometheus.CounterValue, prometheus.CounterValue,
@@ -347,48 +353,56 @@ func (c *Collector) collectTSSessionCounters(ch chan<- prometheus.Metric) error
data.Name, data.Name,
"user", "user",
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.poolNonPagedBytes, c.poolNonPagedBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
data.PoolNonpagedBytes, data.PoolNonpagedBytes,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.poolPagedBytes, c.poolPagedBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
data.PoolPagedBytes, data.PoolPagedBytes,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.privateBytes, c.privateBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
data.PrivateBytes, data.PrivateBytes,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.threadCount, c.threadCount,
prometheus.GaugeValue, prometheus.GaugeValue,
data.ThreadCount, data.ThreadCount,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualBytes, c.virtualBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
data.VirtualBytes, data.VirtualBytes,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.virtualBytesPeak, c.virtualBytesPeak,
prometheus.GaugeValue, prometheus.GaugeValue,
data.VirtualBytesPeak, data.VirtualBytesPeak,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.workingSet, c.workingSet,
prometheus.GaugeValue, prometheus.GaugeValue,
data.WorkingSet, data.WorkingSet,
data.Name, data.Name,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.workingSetPeak, c.workingSetPeak,
prometheus.GaugeValue, prometheus.GaugeValue,
@@ -453,6 +467,7 @@ func (c *Collector) collectWTSSessions(ch chan<- prometheus.Metric) error {
if session.State == stateID { if session.State == stateID {
isState = 1.0 isState = 1.0
} }
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.sessionInfo, c.sessionInfo,
prometheus.GaugeValue, prometheus.GaugeValue,

View File

@@ -217,6 +217,7 @@ func (c *Collector) convertMetricFamily(logger *slog.Logger, metricFamily *dto.M
for _, q := range metric.GetSummary().GetQuantile() { for _, q := range metric.GetSummary().GetQuantile() {
quantiles[q.GetQuantile()] = q.GetValue() quantiles[q.GetQuantile()] = q.GetValue()
} }
ch <- prometheus.MustNewConstSummary( ch <- prometheus.MustNewConstSummary(
prometheus.NewDesc( prometheus.NewDesc(
metricFamily.GetName(), metricFamily.GetName(),
@@ -232,6 +233,7 @@ func (c *Collector) convertMetricFamily(logger *slog.Logger, metricFamily *dto.M
for _, b := range metric.GetHistogram().GetBucket() { for _, b := range metric.GetHistogram().GetBucket() {
buckets[b.GetUpperBound()] = b.GetCumulativeCount() buckets[b.GetUpperBound()] = b.GetCumulativeCount()
} }
ch <- prometheus.MustNewConstHistogram( ch <- prometheus.MustNewConstHistogram(
prometheus.NewDesc( prometheus.NewDesc(
metricFamily.GetName(), metricFamily.GetName(),
@@ -290,8 +292,8 @@ type carriageReturnFilteringReader struct {
// Read returns data from the underlying io.Reader, but with \r filtered out. // Read returns data from the underlying io.Reader, but with \r filtered out.
func (cr carriageReturnFilteringReader) Read(p []byte) (int, error) { func (cr carriageReturnFilteringReader) Read(p []byte) (int, error) {
buf := make([]byte, len(p)) buf := make([]byte, len(p))
n, err := cr.r.Read(buf)
n, err := cr.r.Read(buf)
if err != nil && err != io.EOF { if err != nil && err != io.EOF {
return n, err return n, err
} }
@@ -356,7 +358,6 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
return nil return nil
}) })
if err != nil && directory != "" { if err != nil && directory != "" {
errs = append(errs, fmt.Errorf("error reading textfile directory %q: %w", directory, err)) errs = append(errs, fmt.Errorf("error reading textfile directory %q: %w", directory, err))
} }

View File

@@ -119,6 +119,7 @@ func TestDuplicateMetricEntry(t *testing.T) {
} }
var duplicateFamily []*dto.MetricFamily var duplicateFamily []*dto.MetricFamily
duplicateFamily = append(duplicateFamily, &duplicate) duplicateFamily = append(duplicateFamily, &duplicate)
// Ensure detection for duplicate metrics // Ensure detection for duplicate metrics

View File

@@ -51,6 +51,7 @@ func TestMultipleDirectories(t *testing.T) {
got := "" got := ""
errCh := make(chan error, 1) errCh := make(chan error, 1)
go func() { go func() {
errCh <- textFileCollector.Collect(metrics) errCh <- textFileCollector.Collect(metrics)
@@ -88,6 +89,7 @@ func TestDuplicateFileName(t *testing.T) {
got := "" got := ""
errCh := make(chan error, 1) errCh := make(chan error, 1)
go func() { go func() {
errCh <- textFileCollector.Collect(metrics) errCh <- textFileCollector.Collect(metrics)

View File

@@ -329,21 +329,25 @@ func (c *Collector) collectNTP(ch chan<- prometheus.Metric) error {
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].ComputedTimeOffset/1000000, // microseconds -> seconds c.perfDataObject[0].ComputedTimeOffset/1000000, // microseconds -> seconds
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ntpClientTimeSourceCount, c.ntpClientTimeSourceCount,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].NTPClientTimeSourceCount, c.perfDataObject[0].NTPClientTimeSourceCount,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ntpRoundTripDelay, c.ntpRoundTripDelay,
prometheus.GaugeValue, prometheus.GaugeValue,
c.perfDataObject[0].NTPRoundTripDelay/1000000, // microseconds -> seconds c.perfDataObject[0].NTPRoundTripDelay/1000000, // microseconds -> seconds
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ntpServerIncomingRequestsTotal, c.ntpServerIncomingRequestsTotal,
prometheus.CounterValue, prometheus.CounterValue,
c.perfDataObject[0].NTPServerIncomingRequestsTotal, c.perfDataObject[0].NTPServerIncomingRequestsTotal,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.ntpServerOutgoingResponsesTotal, c.ntpServerOutgoingResponsesTotal,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -160,18 +160,21 @@ func (c *Collector) writeUDPCounters(ch chan<- prometheus.Metric, metrics []perf
metrics[0].DatagramsNoPortPerSec, metrics[0].DatagramsNoPortPerSec,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.datagramsReceivedErrorsTotal, c.datagramsReceivedErrorsTotal,
prometheus.CounterValue, prometheus.CounterValue,
metrics[0].DatagramsReceivedErrors, metrics[0].DatagramsReceivedErrors,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.datagramsReceivedTotal, c.datagramsReceivedTotal,
prometheus.GaugeValue, prometheus.GaugeValue,
metrics[0].DatagramsReceivedPerSec, metrics[0].DatagramsReceivedPerSec,
af, af,
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.datagramsSentTotal, c.datagramsSentTotal,
prometheus.CounterValue, prometheus.CounterValue,

View File

@@ -154,6 +154,7 @@ func GetIfEntry2Ex(row *MIB_IF_ROW2) error {
// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-convertinterfaceguidtoluid // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-convertinterfaceguidtoluid
func ConvertInterfaceGUIDToLUID(guid ole.GUID) (uint64, error) { func ConvertInterfaceGUIDToLUID(guid ole.GUID) (uint64, error) {
var luid uint64 var luid uint64
ret, _, _ := procConvertInterfaceGuidToLuid.Call( ret, _, _ := procConvertInterfaceGuidToLuid.Call(
uintptr(unsafe.Pointer(&guid)), uintptr(unsafe.Pointer(&guid)),
uintptr(unsafe.Pointer(&luid)), uintptr(unsafe.Pointer(&luid)),

View File

@@ -51,6 +51,7 @@ var (
// GetPerformanceInfo returns the dereferenced version of GetLPPerformanceInfo. // GetPerformanceInfo returns the dereferenced version of GetLPPerformanceInfo.
func GetPerformanceInfo() (PerformanceInformation, error) { func GetPerformanceInfo() (PerformanceInformation, error) {
var lppi PerformanceInformation var lppi PerformanceInformation
size := (uint32)(unsafe.Sizeof(lppi)) size := (uint32)(unsafe.Sizeof(lppi))
lppi.cb = size lppi.cb = size
r1, _, err := procGetPerformanceInfo.Call(uintptr(unsafe.Pointer(&lppi)), uintptr(size)) r1, _, err := procGetPerformanceInfo.Call(uintptr(unsafe.Pointer(&lppi)), uintptr(size))

View File

@@ -50,7 +50,6 @@ func SLIsWindowsGenuineLocal() (SL_GENUINE_STATE, error) {
_, _, err := procSLIsWindowsGenuineLocal.Call( _, _, err := procSLIsWindowsGenuineLocal.Call(
uintptr(unsafe.Pointer(&genuineState)), uintptr(unsafe.Pointer(&genuineState)),
) )
if !errors.Is(err, windows.NTE_OP_OK) { if !errors.Is(err, windows.NTE_OP_OK) {
return 0, err return 0, err
} }

View File

@@ -127,6 +127,7 @@ var (
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-globalmemorystatusex // https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-globalmemorystatusex
func GlobalMemoryStatusEx() (MemoryStatus, error) { func GlobalMemoryStatusEx() (MemoryStatus, error) {
var mse memoryStatusEx var mse memoryStatusEx
mse.dwLength = (uint32)(unsafe.Sizeof(mse)) mse.dwLength = (uint32)(unsafe.Sizeof(mse))
r1, _, err := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&mse))) r1, _, err := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&mse)))

View File

@@ -147,7 +147,6 @@ func WTSOpenServer(server string) (windows.Handle, error) {
func WTSCloseServer(server windows.Handle) error { func WTSCloseServer(server windows.Handle) error {
r1, _, err := procWTSCloseServer.Call(uintptr(server)) r1, _, err := procWTSCloseServer.Call(uintptr(server))
if r1 != 1 && !errors.Is(err, windows.ERROR_SUCCESS) { if r1 != 1 && !errors.Is(err, windows.ERROR_SUCCESS) {
return fmt.Errorf("failed to close server: %w", err) return fmt.Errorf("failed to close server: %w", err)
} }
@@ -196,6 +195,7 @@ func WTSEnumerateSessionsEx(server windows.Handle, logger *slog.Logger) ([]WTSSe
} }
var sizeTest wtsSessionInfo1 var sizeTest wtsSessionInfo1
sessionSize := unsafe.Sizeof(sizeTest) sessionSize := unsafe.Sizeof(sizeTest)
sessions := make([]WTSSession, 0, count) sessions := make([]WTSSession, 0, count)

View File

@@ -113,7 +113,6 @@ func ApplicationInitialize() (*Application, error) {
0, 0,
uintptr(unsafe.Pointer(application)), uintptr(unsafe.Pointer(application)),
) )
if !errors.Is(err, windows.NOERROR) { if !errors.Is(err, windows.NOERROR) {
return nil, fmt.Errorf("syscall returned: %w", err) return nil, fmt.Errorf("syscall returned: %w", err)
} }

View File

@@ -154,7 +154,6 @@ func (o *Operation) GetInstance() (*Instance, bool, error) {
uintptr(unsafe.Pointer(&errorMessageUTF16)), uintptr(unsafe.Pointer(&errorMessageUTF16)),
uintptr(unsafe.Pointer(&errorDetails)), uintptr(unsafe.Pointer(&errorDetails)),
) )
if !errors.Is(instanceResult, MI_RESULT_OK) { if !errors.Is(instanceResult, MI_RESULT_OK) {
return nil, false, fmt.Errorf("instance result: %w (%s)", instanceResult, windows.UTF16PtrToString(errorMessageUTF16)) return nil, false, fmt.Errorf("instance result: %w (%s)", instanceResult, windows.UTF16PtrToString(errorMessageUTF16))
} }

View File

@@ -109,13 +109,11 @@ func (s *Session) TestConnection() error {
return result return result
} }
var err error if _, _, err := operation.GetInstance(); err != nil {
if _, _, err = operation.GetInstance(); err != nil {
return fmt.Errorf("failed to get instance: %w", err) return fmt.Errorf("failed to get instance: %w", err)
} }
if err = operation.Close(); err != nil { if err := operation.Close(); err != nil {
return fmt.Errorf("failed to close operation: %w", err) return fmt.Errorf("failed to close operation: %w", err)
} }

View File

@@ -549,8 +549,8 @@ func FormatError(msgID uint32) string {
var flags uint32 = windows.FORMAT_MESSAGE_FROM_HMODULE | windows.FORMAT_MESSAGE_ARGUMENT_ARRAY | windows.FORMAT_MESSAGE_IGNORE_INSERTS var flags uint32 = windows.FORMAT_MESSAGE_FROM_HMODULE | windows.FORMAT_MESSAGE_ARGUMENT_ARRAY | windows.FORMAT_MESSAGE_IGNORE_INSERTS
buf := make([]uint16, 300) buf := make([]uint16, 300)
_, err := windows.FormatMessage(flags, libPdhDll.Handle(), msgID, 0, buf, nil)
_, err := windows.FormatMessage(flags, libPdhDll.Handle(), msgID, 0, buf, nil)
if err == nil { if err == nil {
return windows.UTF16PtrToString(&buf[0]) return windows.UTF16PtrToString(&buf[0])
} }

View File

@@ -54,6 +54,7 @@ func NewCollector[T any](object string, _ []string) (*Collector, error) {
} }
var values [0]T var values [0]T
valueType := reflect.TypeOf(values).Elem() valueType := reflect.TypeOf(values).Elem()
if f, ok := valueType.FieldByName("Name"); ok { if f, ok := valueType.FieldByName("Name"); ok {

View File

@@ -200,7 +200,6 @@ func (c *Collection) collectCollector(ch chan<- prometheus.Metric, logger *slog.
go func() { go func() {
// Drain channel in case of premature return to not leak a goroutine. // Drain channel in case of premature return to not leak a goroutine.
//nolint:revive
for range bufCh { for range bufCh {
} }
}() }()