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
with:
# renovate: github=golangci/golangci-lint
version: v2.1.6
version: v2.2.1
args: "--max-same-issues=0"

View File

@@ -19,11 +19,13 @@ linters:
- lll
- maintidx
- mnd
- noinlineerr
- paralleltest
- tagliatelle
- testpackage
- varnamelen
- wrapcheck
- wsl
settings:
forbidigo:
forbid:
@@ -62,6 +64,13 @@ linters:
disable:
- fieldalignment
- 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:
no-mixed-args: true
kv-only: false

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -57,14 +57,14 @@ var ConfigDefaults = Config{
// A Collector is a Prometheus Collector for WMI MSCluster_Cluster metrics.
type Collector struct {
config Config
miSession *mi.Session
collectorCluster
collectorNetwork
collectorNode
collectorResource
collectorResourceGroup
config Config
miSession *mi.Session
}
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 {
isCurrentState = 1.0
}
ch <- prometheus.MustNewConstMetric(
c.resourceOwnerNode,
prometheus.GaugeValue,

View File

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

View File

@@ -78,18 +78,6 @@ var ConfigDefaults = Config{
// A Collector is a Prometheus Collector for various WMI Win32_PerfRawData_MSSQLSERVER_* metrics.
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
collectorAvailabilityReplica
collectorBufferManager
@@ -103,6 +91,18 @@ type Collector struct {
collectorSQLStats
collectorTransactions
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 {
@@ -405,6 +405,7 @@ func (c *Collector) collect(
duration.Seconds(),
collector, sqlInstance.name,
)
ch <- prometheus.MustNewConstMetric(
c.mssqlScrapeSuccessDesc,
prometheus.GaugeValue,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -160,18 +160,21 @@ func (c *Collector) writeUDPCounters(ch chan<- prometheus.Metric, metrics []perf
metrics[0].DatagramsNoPortPerSec,
af,
)
ch <- prometheus.MustNewConstMetric(
c.datagramsReceivedErrorsTotal,
prometheus.CounterValue,
metrics[0].DatagramsReceivedErrors,
af,
)
ch <- prometheus.MustNewConstMetric(
c.datagramsReceivedTotal,
prometheus.GaugeValue,
metrics[0].DatagramsReceivedPerSec,
af,
)
ch <- prometheus.MustNewConstMetric(
c.datagramsSentTotal,
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
func ConvertInterfaceGUIDToLUID(guid ole.GUID) (uint64, error) {
var luid uint64
ret, _, _ := procConvertInterfaceGuidToLuid.Call(
uintptr(unsafe.Pointer(&guid)),
uintptr(unsafe.Pointer(&luid)),

View File

@@ -51,6 +51,7 @@ var (
// GetPerformanceInfo returns the dereferenced version of GetLPPerformanceInfo.
func GetPerformanceInfo() (PerformanceInformation, error) {
var lppi PerformanceInformation
size := (uint32)(unsafe.Sizeof(lppi))
lppi.cb = 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(
uintptr(unsafe.Pointer(&genuineState)),
)
if !errors.Is(err, windows.NTE_OP_OK) {
return 0, err
}

View File

@@ -127,6 +127,7 @@ var (
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-globalmemorystatusex
func GlobalMemoryStatusEx() (MemoryStatus, error) {
var mse memoryStatusEx
mse.dwLength = (uint32)(unsafe.Sizeof(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 {
r1, _, err := procWTSCloseServer.Call(uintptr(server))
if r1 != 1 && !errors.Is(err, windows.ERROR_SUCCESS) {
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
sessionSize := unsafe.Sizeof(sizeTest)
sessions := make([]WTSSession, 0, count)

View File

@@ -113,7 +113,6 @@ func ApplicationInitialize() (*Application, error) {
0,
uintptr(unsafe.Pointer(application)),
)
if !errors.Is(err, windows.NOERROR) {
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(&errorDetails)),
)
if !errors.Is(instanceResult, MI_RESULT_OK) {
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
}
var err error
if _, _, err = operation.GetInstance(); err != nil {
if _, _, err := operation.GetInstance(); err != nil {
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)
}

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
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 {
return windows.UTF16PtrToString(&buf[0])
}

View File

@@ -54,6 +54,7 @@ func NewCollector[T any](object string, _ []string) (*Collector, error) {
}
var values [0]T
valueType := reflect.TypeOf(values).Elem()
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() {
// Drain channel in case of premature return to not leak a goroutine.
//nolint:revive
for range bufCh {
}
}()