mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
mi: replace all WMI calls with MI calls (#1700)
This commit is contained in:
@@ -9,9 +9,9 @@ import (
|
||||
"slices"
|
||||
|
||||
"github.com/alecthomas/kingpin/v2"
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/yusufpapurcu/wmi"
|
||||
)
|
||||
|
||||
const Name = "netframework"
|
||||
@@ -47,7 +47,7 @@ const (
|
||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRExceptions metrics.
|
||||
type Collector struct {
|
||||
config Config
|
||||
wmiClient *wmi.Client
|
||||
miSession *mi.Session
|
||||
|
||||
// clrexceptions
|
||||
numberOfExceptionsThrown *prometheus.Desc
|
||||
@@ -143,12 +143,12 @@ func (c *Collector) Close(_ *slog.Logger) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
||||
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
||||
return errors.New("wmiClient or SWbemServicesClient is nil")
|
||||
func (c *Collector) Build(_ *slog.Logger, miSession *mi.Session) error {
|
||||
if miSession == nil {
|
||||
return errors.New("miSession is nil")
|
||||
}
|
||||
|
||||
c.wmiClient = wmiClient
|
||||
c.miSession = miSession
|
||||
|
||||
if slices.Contains(c.config.CollectorsEnabled, collectorClrExceptions) {
|
||||
c.buildClrExceptions()
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
package netframework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -35,19 +39,19 @@ func (c *Collector) buildClrExceptions() {
|
||||
}
|
||||
|
||||
type Win32_PerfRawData_NETFramework_NETCLRExceptions struct {
|
||||
Name string
|
||||
Name string `mi:"Name"`
|
||||
|
||||
NumberofExcepsThrown uint32
|
||||
NumberofExcepsThrownPersec uint32
|
||||
NumberofFiltersPersec uint32
|
||||
NumberofFinallysPersec uint32
|
||||
ThrowToCatchDepthPersec uint32
|
||||
NumberofExcepsThrown uint32 `mi:"NumberofExcepsThrown"`
|
||||
NumberofExcepsThrownPersec uint32 `mi:"NumberofExcepsThrownPersec"`
|
||||
NumberofFiltersPersec uint32 `mi:"NumberofFiltersPersec"`
|
||||
NumberofFinallysPersec uint32 `mi:"NumberofFinallysPersec"`
|
||||
ThrowToCatchDepthPersec uint32 `mi:"ThrowToCatchDepthPersec"`
|
||||
}
|
||||
|
||||
func (c *Collector) collectClrExceptions(ch chan<- prometheus.Metric) error {
|
||||
var dst []Win32_PerfRawData_NETFramework_NETCLRExceptions
|
||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRExceptions", &dst); err != nil {
|
||||
return err
|
||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, utils.Must(mi.NewQuery("SELECT * Win32_PerfRawData_NETFramework_NETCLRExceptions"))); err != nil {
|
||||
return fmt.Errorf("WMI query failed: %w", err)
|
||||
}
|
||||
|
||||
for _, process := range dst {
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
package netframework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -29,19 +33,19 @@ func (c *Collector) buildClrInterop() {
|
||||
}
|
||||
|
||||
type Win32_PerfRawData_NETFramework_NETCLRInterop struct {
|
||||
Name string
|
||||
Name string `mi:"Name"`
|
||||
|
||||
NumberofCCWs uint32
|
||||
Numberofmarshalling uint32
|
||||
NumberofStubs uint32
|
||||
NumberofTLBexportsPersec uint32
|
||||
NumberofTLBimportsPersec uint32
|
||||
NumberofCCWs uint32 `mi:"NumberofCCWs"`
|
||||
Numberofmarshalling uint32 `mi:"Numberofmarshalling"`
|
||||
NumberofStubs uint32 `mi:"NumberofStubs"`
|
||||
NumberofTLBexportsPersec uint32 `mi:"NumberofTLBexportsPersec"`
|
||||
NumberofTLBimportsPersec uint32 `mi:"NumberofTLBimportsPersec"`
|
||||
}
|
||||
|
||||
func (c *Collector) collectClrInterop(ch chan<- prometheus.Metric) error {
|
||||
var dst []Win32_PerfRawData_NETFramework_NETCLRInterop
|
||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRInterop", &dst); err != nil {
|
||||
return err
|
||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, utils.Must(mi.NewQuery("SELECT * Win32_PerfRawData_NETFramework_NETCLRInterop"))); err != nil {
|
||||
return fmt.Errorf("WMI query failed: %w", err)
|
||||
}
|
||||
|
||||
for _, process := range dst {
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
package netframework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -35,21 +39,21 @@ func (c *Collector) buildClrJIT() {
|
||||
}
|
||||
|
||||
type Win32_PerfRawData_NETFramework_NETCLRJit struct {
|
||||
Name string
|
||||
Name string `mi:"Name"`
|
||||
|
||||
Frequency_PerfTime uint32
|
||||
ILBytesJittedPersec uint32
|
||||
NumberofILBytesJitted uint32
|
||||
NumberofMethodsJitted uint32
|
||||
PercentTimeinJit uint32
|
||||
StandardJitFailures uint32
|
||||
TotalNumberofILBytesJitted uint32
|
||||
Frequency_PerfTime uint32 `mi:"Frequency_PerfTime"`
|
||||
ILBytesJittedPersec uint32 `mi:"ILBytesJittedPersec"`
|
||||
NumberofILBytesJitted uint32 `mi:"NumberofILBytesJitted"`
|
||||
NumberofMethodsJitted uint32 `mi:"NumberofMethodsJitted"`
|
||||
PercentTimeinJit uint32 `mi:"PercentTimeinJit"`
|
||||
StandardJitFailures uint32 `mi:"StandardJitFailures"`
|
||||
TotalNumberofILBytesJitted uint32 `mi:"TotalNumberofILBytesJitted"`
|
||||
}
|
||||
|
||||
func (c *Collector) collectClrJIT(ch chan<- prometheus.Metric) error {
|
||||
var dst []Win32_PerfRawData_NETFramework_NETCLRJit
|
||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRJit", &dst); err != nil {
|
||||
return err
|
||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, utils.Must(mi.NewQuery("SELECT * Win32_PerfRawData_NETFramework_NETCLRJit"))); err != nil {
|
||||
return fmt.Errorf("WMI query failed: %w", err)
|
||||
}
|
||||
|
||||
for _, process := range dst {
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
package netframework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -65,30 +69,30 @@ func (c *Collector) buildClrLoading() {
|
||||
}
|
||||
|
||||
type Win32_PerfRawData_NETFramework_NETCLRLoading struct {
|
||||
Name string
|
||||
Name string `mi:"Name"`
|
||||
|
||||
AssemblySearchLength uint32
|
||||
BytesinLoaderHeap uint64
|
||||
Currentappdomains uint32
|
||||
CurrentAssemblies uint32
|
||||
CurrentClassesLoaded uint32
|
||||
PercentTimeLoading uint64
|
||||
Rateofappdomains uint32
|
||||
Rateofappdomainsunloaded uint32
|
||||
RateofAssemblies uint32
|
||||
RateofClassesLoaded uint32
|
||||
RateofLoadFailures uint32
|
||||
TotalAppdomains uint32
|
||||
Totalappdomainsunloaded uint32
|
||||
TotalAssemblies uint32
|
||||
TotalClassesLoaded uint32
|
||||
TotalNumberofLoadFailures uint32
|
||||
AssemblySearchLength uint32 `mi:"AssemblySearchLength"`
|
||||
BytesinLoaderHeap uint64 `mi:"BytesinLoaderHeap"`
|
||||
Currentappdomains uint32 `mi:"Currentappdomains"`
|
||||
CurrentAssemblies uint32 `mi:"CurrentAssemblies"`
|
||||
CurrentClassesLoaded uint32 `mi:"CurrentClassesLoaded"`
|
||||
PercentTimeLoading uint64 `mi:"PercentTimeLoading"`
|
||||
Rateofappdomains uint32 `mi:"Rateofappdomains"`
|
||||
Rateofappdomainsunloaded uint32 `mi:"Rateofappdomainsunloaded"`
|
||||
RateofAssemblies uint32 `mi:"RateofAssemblies"`
|
||||
RateofClassesLoaded uint32 `mi:"RateofClassesLoaded"`
|
||||
RateofLoadFailures uint32 `mi:"RateofLoadFailures"`
|
||||
TotalAppdomains uint32 `mi:"TotalAppdomains"`
|
||||
Totalappdomainsunloaded uint32 `mi:"Totalappdomainsunloaded"`
|
||||
TotalAssemblies uint32 `mi:"TotalAssemblies"`
|
||||
TotalClassesLoaded uint32 `mi:"TotalClassesLoaded"`
|
||||
TotalNumberofLoadFailures uint32 `mi:"TotalNumberofLoadFailures"`
|
||||
}
|
||||
|
||||
func (c *Collector) collectClrLoading(ch chan<- prometheus.Metric) error {
|
||||
var dst []Win32_PerfRawData_NETFramework_NETCLRLoading
|
||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRLoading", &dst); err != nil {
|
||||
return err
|
||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, utils.Must(mi.NewQuery("SELECT * Win32_PerfRawData_NETFramework_NETCLRLoading"))); err != nil {
|
||||
return fmt.Errorf("WMI query failed: %w", err)
|
||||
}
|
||||
|
||||
for _, process := range dst {
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
package netframework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -53,24 +57,24 @@ func (c *Collector) buildClrLocksAndThreads() {
|
||||
}
|
||||
|
||||
type Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads struct {
|
||||
Name string
|
||||
Name string `mi:"Name"`
|
||||
|
||||
ContentionRatePersec uint32
|
||||
CurrentQueueLength uint32
|
||||
NumberofcurrentlogicalThreads uint32
|
||||
NumberofcurrentphysicalThreads uint32
|
||||
Numberofcurrentrecognizedthreads uint32
|
||||
Numberoftotalrecognizedthreads uint32
|
||||
QueueLengthPeak uint32
|
||||
QueueLengthPersec uint32
|
||||
RateOfRecognizedThreadsPersec uint32
|
||||
TotalNumberofContentions uint32
|
||||
ContentionRatePersec uint32 `mi:"ContentionRatePersec"`
|
||||
CurrentQueueLength uint32 `mi:"CurrentQueueLength"`
|
||||
NumberofcurrentlogicalThreads uint32 `mi:"NumberofcurrentlogicalThreads"`
|
||||
NumberofcurrentphysicalThreads uint32 `mi:"NumberofcurrentphysicalThreads"`
|
||||
Numberofcurrentrecognizedthreads uint32 `mi:"Numberofcurrentrecognizedthreads"`
|
||||
Numberoftotalrecognizedthreads uint32 `mi:"Numberoftotalrecognizedthreads"`
|
||||
QueueLengthPeak uint32 `mi:"QueueLengthPeak"`
|
||||
QueueLengthPersec uint32 `mi:"QueueLengthPersec"`
|
||||
RateOfRecognizedThreadsPersec uint32 `mi:"RateOfRecognizedThreadsPersec"`
|
||||
TotalNumberofContentions uint32 `mi:"TotalNumberofContentions"`
|
||||
}
|
||||
|
||||
func (c *Collector) collectClrLocksAndThreads(ch chan<- prometheus.Metric) error {
|
||||
var dst []Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads
|
||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads", &dst); err != nil {
|
||||
return err
|
||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, utils.Must(mi.NewQuery("SELECT * Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads"))); err != nil {
|
||||
return fmt.Errorf("WMI query failed: %w", err)
|
||||
}
|
||||
|
||||
for _, process := range dst {
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
package netframework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -83,43 +87,43 @@ func (c *Collector) buildClrMemory() {
|
||||
}
|
||||
|
||||
type Win32_PerfRawData_NETFramework_NETCLRMemory struct {
|
||||
Name string
|
||||
Name string `mi:"Name"`
|
||||
|
||||
AllocatedBytesPersec uint64
|
||||
FinalizationSurvivors uint64
|
||||
Frequency_PerfTime uint64
|
||||
Gen0heapsize uint64
|
||||
Gen0PromotedBytesPerSec uint64
|
||||
Gen1heapsize uint64
|
||||
Gen1PromotedBytesPerSec uint64
|
||||
Gen2heapsize uint64
|
||||
LargeObjectHeapsize uint64
|
||||
NumberBytesinallHeaps uint64
|
||||
NumberGCHandles uint64
|
||||
NumberGen0Collections uint64
|
||||
NumberGen1Collections uint64
|
||||
NumberGen2Collections uint64
|
||||
NumberInducedGC uint64
|
||||
NumberofPinnedObjects uint64
|
||||
NumberofSinkBlocksinuse uint64
|
||||
NumberTotalcommittedBytes uint64
|
||||
NumberTotalreservedBytes uint64
|
||||
AllocatedBytesPersec uint64 `mi:"AllocatedBytesPersec"`
|
||||
FinalizationSurvivors uint64 `mi:"FinalizationSurvivors"`
|
||||
Frequency_PerfTime uint64 `mi:"Frequency_PerfTime"`
|
||||
Gen0heapsize uint64 `mi:"Gen0heapsize"`
|
||||
Gen0PromotedBytesPerSec uint64 `mi:"Gen0PromotedBytesPersec"`
|
||||
Gen1heapsize uint64 `mi:"Gen1heapsize"`
|
||||
Gen1PromotedBytesPerSec uint64 `mi:"Gen1PromotedBytesPersec"`
|
||||
Gen2heapsize uint64 `mi:"Gen2heapsize"`
|
||||
LargeObjectHeapsize uint64 `mi:"LargeObjectHeapsize"`
|
||||
NumberBytesinallHeaps uint64 `mi:"NumberBytesinallHeaps"`
|
||||
NumberGCHandles uint64 `mi:"NumberGCHandles"`
|
||||
NumberGen0Collections uint64 `mi:"NumberGen0Collections"`
|
||||
NumberGen1Collections uint64 `mi:"NumberGen1Collections"`
|
||||
NumberGen2Collections uint64 `mi:"NumberGen2Collections"`
|
||||
NumberInducedGC uint64 `mi:"NumberInducedGC"`
|
||||
NumberofPinnedObjects uint64 `mi:"NumberofPinnedObjects"`
|
||||
NumberofSinkBlocksinuse uint64 `mi:"NumberofSinkBlocksinuse"`
|
||||
NumberTotalcommittedBytes uint64 `mi:"NumberTotalcommittedBytes"`
|
||||
NumberTotalreservedBytes uint64 `mi:"NumberTotalreservedBytes"`
|
||||
// PercentTimeinGC has countertype=PERF_RAW_FRACTION.
|
||||
// Formula: (100 * CounterValue) / BaseValue
|
||||
// By docs https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/scripting-articles/ms974615(v=msdn.10)#perf_raw_fraction
|
||||
PercentTimeinGC uint32
|
||||
PercentTimeinGC uint32 `mi:"PercentTimeinGC"`
|
||||
// BaseValue is just a "magic" number used to make the calculation come out right.
|
||||
PercentTimeinGC_base uint32
|
||||
ProcessID uint64
|
||||
PromotedFinalizationMemoryfromGen0 uint64
|
||||
PromotedMemoryfromGen0 uint64
|
||||
PromotedMemoryfromGen1 uint64
|
||||
PercentTimeinGC_base uint32 `mi:"PercentTimeinGC_base"`
|
||||
ProcessID uint64 `mi:"ProcessID"`
|
||||
PromotedFinalizationMemoryfromGen0 uint64 `mi:"PromotedFinalizationMemoryfromGen0"`
|
||||
PromotedMemoryfromGen0 uint64 `mi:"PromotedMemoryfromGen0"`
|
||||
PromotedMemoryfromGen1 uint64 `mi:"PromotedMemoryfromGen1"`
|
||||
}
|
||||
|
||||
func (c *Collector) collectClrMemory(ch chan<- prometheus.Metric) error {
|
||||
var dst []Win32_PerfRawData_NETFramework_NETCLRMemory
|
||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRMemory", &dst); err != nil {
|
||||
return err
|
||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, utils.Must(mi.NewQuery("SELECT * Win32_PerfRawData_NETFramework_NETCLRMemory"))); err != nil {
|
||||
return fmt.Errorf("WMI query failed: %w", err)
|
||||
}
|
||||
|
||||
for _, process := range dst {
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
package netframework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -47,21 +51,21 @@ func (c *Collector) buildClrRemoting() {
|
||||
}
|
||||
|
||||
type Win32_PerfRawData_NETFramework_NETCLRRemoting struct {
|
||||
Name string
|
||||
Name string `mi:"Name"`
|
||||
|
||||
Channels uint32
|
||||
ContextBoundClassesLoaded uint32
|
||||
ContextBoundObjectsAllocPersec uint32
|
||||
ContextProxies uint32
|
||||
Contexts uint32
|
||||
RemoteCallsPersec uint32
|
||||
TotalRemoteCalls uint32
|
||||
Channels uint32 `mi:"Channels"`
|
||||
ContextBoundClassesLoaded uint32 `mi:"ContextBoundClassesLoaded"`
|
||||
ContextBoundObjectsAllocPersec uint32 `mi:"ContextBoundObjectsAllocPersec"`
|
||||
ContextProxies uint32 `mi:"ContextProxies"`
|
||||
Contexts uint32 `mi:"Contexts"`
|
||||
RemoteCallsPersec uint32 `mi:"RemoteCallsPersec"`
|
||||
TotalRemoteCalls uint32 `mi:"TotalRemoteCalls"`
|
||||
}
|
||||
|
||||
func (c *Collector) collectClrRemoting(ch chan<- prometheus.Metric) error {
|
||||
var dst []Win32_PerfRawData_NETFramework_NETCLRRemoting
|
||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRRemoting", &dst); err != nil {
|
||||
return err
|
||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, utils.Must(mi.NewQuery("SELECT * Win32_PerfRawData_NETFramework_NETCLRRemoting"))); err != nil {
|
||||
return fmt.Errorf("WMI query failed: %w", err)
|
||||
}
|
||||
|
||||
for _, process := range dst {
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
package netframework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -35,20 +39,20 @@ func (c *Collector) buildClrSecurity() {
|
||||
}
|
||||
|
||||
type Win32_PerfRawData_NETFramework_NETCLRSecurity struct {
|
||||
Name string
|
||||
Name string `mi:"Name"`
|
||||
|
||||
Frequency_PerfTime uint32
|
||||
NumberLinkTimeChecks uint32
|
||||
PercentTimeinRTchecks uint32
|
||||
PercentTimeSigAuthenticating uint64
|
||||
StackWalkDepth uint32
|
||||
TotalRuntimeChecks uint32
|
||||
Frequency_PerfTime uint32 `mi:"Frequency_PerfTime"`
|
||||
NumberLinkTimeChecks uint32 `mi:"NumberLinkTimeChecks"`
|
||||
PercentTimeinRTchecks uint32 `mi:"PercentTimeinRTchecks"`
|
||||
PercentTimeSigAuthenticating uint64 `mi:"PercentTimeSigAuthenticating"`
|
||||
StackWalkDepth uint32 `mi:"StackWalkDepth"`
|
||||
TotalRuntimeChecks uint32 `mi:"TotalRuntimeChecks"`
|
||||
}
|
||||
|
||||
func (c *Collector) collectClrSecurity(ch chan<- prometheus.Metric) error {
|
||||
var dst []Win32_PerfRawData_NETFramework_NETCLRSecurity
|
||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRSecurity", &dst); err != nil {
|
||||
return err
|
||||
if err := c.miSession.Query(&dst, mi.NamespaceRootCIMv2, utils.Must(mi.NewQuery("SELECT * Win32_PerfRawData_NETFramework_NETCLRSecurity"))); err != nil {
|
||||
return fmt.Errorf("WMI query failed: %w", err)
|
||||
}
|
||||
|
||||
for _, process := range dst {
|
||||
|
||||
Reference in New Issue
Block a user