*: cleanup collector API 3 (#1556)

This commit is contained in:
Jan-Otto Kröpke
2024-08-10 20:02:07 +02:00
committed by GitHub
parent b2548e02bd
commit 27a3553dac
27 changed files with 1545 additions and 1538 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -21,10 +21,10 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
NumberOfExceptionsThrown *prometheus.Desc
NumberOfFilters *prometheus.Desc
NumberOfFinally *prometheus.Desc
ThrowToCatchDepth *prometheus.Desc
numberOfExceptionsThrown *prometheus.Desc
numberOfFilters *prometheus.Desc
numberOfFinally *prometheus.Desc
throwToCatchDepth *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -55,25 +55,25 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.NumberOfExceptionsThrown = prometheus.NewDesc(
c.numberOfExceptionsThrown = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "exceptions_thrown_total"),
"Displays the total number of exceptions thrown since the application started. This includes both .NET exceptions and unmanaged exceptions that are converted into .NET exceptions.",
[]string{"process"},
nil,
)
c.NumberOfFilters = prometheus.NewDesc(
c.numberOfFilters = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "exceptions_filters_total"),
"Displays the total number of .NET exception filters executed. An exception filter evaluates regardless of whether an exception is handled.",
[]string{"process"},
nil,
)
c.NumberOfFinally = prometheus.NewDesc(
c.numberOfFinally = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "exceptions_finallys_total"),
"Displays the total number of finally blocks executed. Only the finally blocks executed for an exception are counted; finally blocks on normal code paths are not counted by this counter.",
[]string{"process"},
nil,
)
c.ThrowToCatchDepth = prometheus.NewDesc(
c.throwToCatchDepth = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "throw_to_catch_depth_total"),
"Displays the total number of stack frames traversed, from the frame that threw the exception to the frame that handled the exception.",
[]string{"process"},
@@ -115,28 +115,28 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.NumberOfExceptionsThrown,
c.numberOfExceptionsThrown,
prometheus.CounterValue,
float64(process.NumberofExcepsThrown),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberOfFilters,
c.numberOfFilters,
prometheus.CounterValue,
float64(process.NumberofFiltersPersec),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberOfFinally,
c.numberOfFinally,
prometheus.CounterValue,
float64(process.NumberofFinallysPersec),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ThrowToCatchDepth,
c.throwToCatchDepth,
prometheus.CounterValue,
float64(process.ThrowToCatchDepthPersec),
process.Name,

View File

@@ -21,9 +21,9 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
NumberofCCWs *prometheus.Desc
Numberofmarshalling *prometheus.Desc
NumberofStubs *prometheus.Desc
numberOfCCWs *prometheus.Desc
numberOfMarshalling *prometheus.Desc
numberOfStubs *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -54,19 +54,19 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.NumberofCCWs = prometheus.NewDesc(
c.numberOfCCWs = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "com_callable_wrappers_total"),
"Displays the current number of COM callable wrappers (CCWs). A CCW is a proxy for a managed object being referenced from an unmanaged COM client.",
[]string{"process"},
nil,
)
c.Numberofmarshalling = prometheus.NewDesc(
c.numberOfMarshalling = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "interop_marshalling_total"),
"Displays the total number of times arguments and return values have been marshaled from managed to unmanaged code, and vice versa, since the application started.",
[]string{"process"},
nil,
)
c.NumberofStubs = prometheus.NewDesc(
c.numberOfStubs = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "interop_stubs_created_total"),
"Displays the current number of stubs created by the common language runtime. Stubs are responsible for marshaling arguments and return values from managed to unmanaged code, and vice versa, during a COM interop call or a platform invoke call.",
[]string{"process"},
@@ -108,21 +108,21 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.NumberofCCWs,
c.numberOfCCWs,
prometheus.CounterValue,
float64(process.NumberofCCWs),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Numberofmarshalling,
c.numberOfMarshalling,
prometheus.CounterValue,
float64(process.Numberofmarshalling),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofStubs,
c.numberOfStubs,
prometheus.CounterValue,
float64(process.NumberofStubs),
process.Name,

View File

@@ -21,10 +21,10 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
NumberofMethodsJitted *prometheus.Desc
TimeinJit *prometheus.Desc
StandardJitFailures *prometheus.Desc
TotalNumberofILBytesJitted *prometheus.Desc
numberOfMethodsJitted *prometheus.Desc
timeInJit *prometheus.Desc
standardJitFailures *prometheus.Desc
totalNumberOfILBytesJitted *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -55,25 +55,25 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.NumberofMethodsJitted = prometheus.NewDesc(
c.numberOfMethodsJitted = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "jit_methods_total"),
"Displays the total number of methods JIT-compiled since the application started. This counter does not include pre-JIT-compiled methods.",
[]string{"process"},
nil,
)
c.TimeinJit = prometheus.NewDesc(
c.timeInJit = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "jit_time_percent"),
"Displays the percentage of time spent in JIT compilation. This counter is updated at the end of every JIT compilation phase. A JIT compilation phase occurs when a method and its dependencies are compiled.",
[]string{"process"},
nil,
)
c.StandardJitFailures = prometheus.NewDesc(
c.standardJitFailures = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "jit_standard_failures_total"),
"Displays the peak number of methods the JIT compiler has failed to compile since the application started. This failure can occur if the MSIL cannot be verified or if there is an internal error in the JIT compiler.",
[]string{"process"},
nil,
)
c.TotalNumberofILBytesJitted = prometheus.NewDesc(
c.totalNumberOfILBytesJitted = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "jit_il_bytes_total"),
"Displays the total number of Microsoft intermediate language (MSIL) bytes compiled by the just-in-time (JIT) compiler since the application started",
[]string{"process"},
@@ -117,28 +117,28 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.NumberofMethodsJitted,
c.numberOfMethodsJitted,
prometheus.CounterValue,
float64(process.NumberofMethodsJitted),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TimeinJit,
c.timeInJit,
prometheus.GaugeValue,
float64(process.PercentTimeinJit)/float64(process.Frequency_PerfTime),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.StandardJitFailures,
c.standardJitFailures,
prometheus.GaugeValue,
float64(process.StandardJitFailures),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalNumberofILBytesJitted,
c.totalNumberOfILBytesJitted,
prometheus.CounterValue,
float64(process.TotalNumberofILBytesJitted),
process.Name,

View File

@@ -21,15 +21,15 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
BytesinLoaderHeap *prometheus.Desc
Currentappdomains *prometheus.Desc
CurrentAssemblies *prometheus.Desc
CurrentClassesLoaded *prometheus.Desc
TotalAppdomains *prometheus.Desc
Totalappdomainsunloaded *prometheus.Desc
TotalAssemblies *prometheus.Desc
TotalClassesLoaded *prometheus.Desc
TotalNumberofLoadFailures *prometheus.Desc
bytesInLoaderHeap *prometheus.Desc
currentAppDomains *prometheus.Desc
currentAssemblies *prometheus.Desc
currentClassesLoaded *prometheus.Desc
totalAppDomains *prometheus.Desc
totalAppDomainsUnloaded *prometheus.Desc
totalAssemblies *prometheus.Desc
totalClassesLoaded *prometheus.Desc
totalNumberOfLoadFailures *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -60,55 +60,55 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.BytesinLoaderHeap = prometheus.NewDesc(
c.bytesInLoaderHeap = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "loader_heap_size_bytes"),
"Displays the current size, in bytes, of the memory committed by the class loader across all application domains. Committed memory is the physical space reserved in the disk paging file.",
[]string{"process"},
nil,
)
c.Currentappdomains = prometheus.NewDesc(
c.currentAppDomains = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "appdomains_loaded_current"),
"Displays the current number of application domains loaded in this application.",
[]string{"process"},
nil,
)
c.CurrentAssemblies = prometheus.NewDesc(
c.currentAssemblies = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "assemblies_loaded_current"),
"Displays the current number of assemblies loaded across all application domains in the currently running application. If the assembly is loaded as domain-neutral from multiple application domains, this counter is incremented only once.",
[]string{"process"},
nil,
)
c.CurrentClassesLoaded = prometheus.NewDesc(
c.currentClassesLoaded = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "classes_loaded_current"),
"Displays the current number of classes loaded in all assemblies.",
[]string{"process"},
nil,
)
c.TotalAppdomains = prometheus.NewDesc(
c.totalAppDomains = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "appdomains_loaded_total"),
"Displays the peak number of application domains loaded since the application started.",
[]string{"process"},
nil,
)
c.Totalappdomainsunloaded = prometheus.NewDesc(
c.totalAppDomainsUnloaded = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "appdomains_unloaded_total"),
"Displays the total number of application domains unloaded since the application started. If an application domain is loaded and unloaded multiple times, this counter increments each time the application domain is unloaded.",
[]string{"process"},
nil,
)
c.TotalAssemblies = prometheus.NewDesc(
c.totalAssemblies = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "assemblies_loaded_total"),
"Displays the total number of assemblies loaded since the application started. If the assembly is loaded as domain-neutral from multiple application domains, this counter is incremented only once.",
[]string{"process"},
nil,
)
c.TotalClassesLoaded = prometheus.NewDesc(
c.totalClassesLoaded = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "classes_loaded_total"),
"Displays the cumulative number of classes loaded in all assemblies since the application started.",
[]string{"process"},
nil,
)
c.TotalNumberofLoadFailures = prometheus.NewDesc(
c.totalNumberOfLoadFailures = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "class_load_failures_total"),
"Displays the peak number of classes that have failed to load since the application started.",
[]string{"process"},
@@ -161,63 +161,63 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.BytesinLoaderHeap,
c.bytesInLoaderHeap,
prometheus.GaugeValue,
float64(process.BytesinLoaderHeap),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Currentappdomains,
c.currentAppDomains,
prometheus.GaugeValue,
float64(process.Currentappdomains),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.CurrentAssemblies,
c.currentAssemblies,
prometheus.GaugeValue,
float64(process.CurrentAssemblies),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.CurrentClassesLoaded,
c.currentClassesLoaded,
prometheus.GaugeValue,
float64(process.CurrentClassesLoaded),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalAppdomains,
c.totalAppDomains,
prometheus.CounterValue,
float64(process.TotalAppdomains),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Totalappdomainsunloaded,
c.totalAppDomainsUnloaded,
prometheus.CounterValue,
float64(process.Totalappdomainsunloaded),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalAssemblies,
c.totalAssemblies,
prometheus.CounterValue,
float64(process.TotalAssemblies),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalClassesLoaded,
c.totalClassesLoaded,
prometheus.CounterValue,
float64(process.TotalClassesLoaded),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalNumberofLoadFailures,
c.totalNumberOfLoadFailures,
prometheus.CounterValue,
float64(process.TotalNumberofLoadFailures),
process.Name,

View File

@@ -21,13 +21,13 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
CurrentQueueLength *prometheus.Desc
NumberofcurrentlogicalThreads *prometheus.Desc
NumberofcurrentphysicalThreads *prometheus.Desc
Numberofcurrentrecognizedthreads *prometheus.Desc
Numberoftotalrecognizedthreads *prometheus.Desc
QueueLengthPeak *prometheus.Desc
TotalNumberofContentions *prometheus.Desc
currentQueueLength *prometheus.Desc
numberOfCurrentLogicalThreads *prometheus.Desc
numberOfCurrentPhysicalThreads *prometheus.Desc
numberOfCurrentRecognizedThreads *prometheus.Desc
numberOfTotalRecognizedThreads *prometheus.Desc
queueLengthPeak *prometheus.Desc
totalNumberOfContentions *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -58,43 +58,43 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.CurrentQueueLength = prometheus.NewDesc(
c.currentQueueLength = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_queue_length"),
"Displays the total number of threads that are currently waiting to acquire a managed lock in the application.",
[]string{"process"},
nil,
)
c.NumberofcurrentlogicalThreads = prometheus.NewDesc(
c.numberOfCurrentLogicalThreads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_logical_threads"),
"Displays the number of current managed thread objects in the application. This counter maintains the count of both running and stopped threads. ",
[]string{"process"},
nil,
)
c.NumberofcurrentphysicalThreads = prometheus.NewDesc(
c.numberOfCurrentPhysicalThreads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "physical_threads_current"),
"Displays the number of native operating system threads created and owned by the common language runtime to act as underlying threads for managed thread objects. This counter's value does not include the threads used by the runtime in its internal operations; it is a subset of the threads in the operating system process.",
[]string{"process"},
nil,
)
c.Numberofcurrentrecognizedthreads = prometheus.NewDesc(
c.numberOfCurrentRecognizedThreads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "recognized_threads_current"),
"Displays the number of threads that are currently recognized by the runtime. These threads are associated with a corresponding managed thread object. The runtime does not create these threads, but they have run inside the runtime at least once.",
[]string{"process"},
nil,
)
c.Numberoftotalrecognizedthreads = prometheus.NewDesc(
c.numberOfTotalRecognizedThreads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "recognized_threads_total"),
"Displays the total number of threads that have been recognized by the runtime since the application started. These threads are associated with a corresponding managed thread object. The runtime does not create these threads, but they have run inside the runtime at least once.",
[]string{"process"},
nil,
)
c.QueueLengthPeak = prometheus.NewDesc(
c.queueLengthPeak = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "queue_length_total"),
"Displays the total number of threads that waited to acquire a managed lock since the application started.",
[]string{"process"},
nil,
)
c.TotalNumberofContentions = prometheus.NewDesc(
c.totalNumberOfContentions = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "contentions_total"),
"Displays the total number of times that threads in the runtime have attempted to acquire a managed lock unsuccessfully.",
[]string{"process"},
@@ -141,49 +141,49 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.CurrentQueueLength,
c.currentQueueLength,
prometheus.GaugeValue,
float64(process.CurrentQueueLength),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofcurrentlogicalThreads,
c.numberOfCurrentLogicalThreads,
prometheus.GaugeValue,
float64(process.NumberofcurrentlogicalThreads),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofcurrentphysicalThreads,
c.numberOfCurrentPhysicalThreads,
prometheus.GaugeValue,
float64(process.NumberofcurrentphysicalThreads),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Numberofcurrentrecognizedthreads,
c.numberOfCurrentRecognizedThreads,
prometheus.GaugeValue,
float64(process.Numberofcurrentrecognizedthreads),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Numberoftotalrecognizedthreads,
c.numberOfTotalRecognizedThreads,
prometheus.CounterValue,
float64(process.Numberoftotalrecognizedthreads),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.QueueLengthPeak,
c.queueLengthPeak,
prometheus.CounterValue,
float64(process.QueueLengthPeak),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalNumberofContentions,
c.totalNumberOfContentions,
prometheus.CounterValue,
float64(process.TotalNumberofContentions),
process.Name,

View File

@@ -21,21 +21,18 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
AllocatedBytes *prometheus.Desc
FinalizationSurvivors *prometheus.Desc
HeapSize *prometheus.Desc
PromotedBytes *prometheus.Desc
NumberGCHandles *prometheus.Desc
NumberCollections *prometheus.Desc
NumberInducedGC *prometheus.Desc
NumberofPinnedObjects *prometheus.Desc
NumberofSinkBlocksinuse *prometheus.Desc
NumberTotalCommittedBytes *prometheus.Desc
NumberTotalreservedBytes *prometheus.Desc
TimeinGC *prometheus.Desc
PromotedFinalizationMemoryfromGen0 *prometheus.Desc
PromotedMemoryfromGen0 *prometheus.Desc
PromotedMemoryfromGen1 *prometheus.Desc
allocatedBytes *prometheus.Desc
finalizationSurvivors *prometheus.Desc
heapSize *prometheus.Desc
promotedBytes *prometheus.Desc
numberGCHandles *prometheus.Desc
numberCollections *prometheus.Desc
numberInducedGC *prometheus.Desc
numberOfPinnedObjects *prometheus.Desc
numberOfSinkBlocksInUse *prometheus.Desc
numberTotalCommittedBytes *prometheus.Desc
numberTotalReservedBytes *prometheus.Desc
timeInGC *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -66,73 +63,73 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.AllocatedBytes = prometheus.NewDesc(
c.allocatedBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "allocated_bytes_total"),
"Displays the total number of bytes allocated on the garbage collection heap.",
[]string{"process"},
nil,
)
c.FinalizationSurvivors = prometheus.NewDesc(
c.finalizationSurvivors = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "finalization_survivors"),
"Displays the number of garbage-collected objects that survive a collection because they are waiting to be finalized.",
[]string{"process"},
nil,
)
c.HeapSize = prometheus.NewDesc(
c.heapSize = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "heap_size_bytes"),
"Displays the maximum bytes that can be allocated; it does not indicate the current number of bytes allocated.",
[]string{"process", "area"},
nil,
)
c.PromotedBytes = prometheus.NewDesc(
c.promotedBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "promoted_bytes"),
"Displays the bytes that were promoted from the generation to the next one during the last GC. Memory is promoted when it survives a garbage collection.",
[]string{"process", "area"},
nil,
)
c.NumberGCHandles = prometheus.NewDesc(
c.numberGCHandles = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "number_gc_handles"),
"Displays the current number of garbage collection handles in use. Garbage collection handles are handles to resources external to the common language runtime and the managed environment.",
[]string{"process"},
nil,
)
c.NumberCollections = prometheus.NewDesc(
c.numberCollections = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "collections_total"),
"Displays the number of times the generation objects are garbage collected since the application started.",
[]string{"process", "area"},
nil,
)
c.NumberInducedGC = prometheus.NewDesc(
c.numberInducedGC = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "induced_gc_total"),
"Displays the peak number of times garbage collection was performed because of an explicit call to GC.Collect.",
[]string{"process"},
nil,
)
c.NumberofPinnedObjects = prometheus.NewDesc(
c.numberOfPinnedObjects = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "number_pinned_objects"),
"Displays the number of pinned objects encountered in the last garbage collection.",
[]string{"process"},
nil,
)
c.NumberofSinkBlocksinuse = prometheus.NewDesc(
c.numberOfSinkBlocksInUse = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "number_sink_blocksinuse"),
"Displays the current number of synchronization blocks in use. Synchronization blocks are per-object data structures allocated for storing synchronization information. They hold weak references to managed objects and must be scanned by the garbage collector.",
[]string{"process"},
nil,
)
c.NumberTotalCommittedBytes = prometheus.NewDesc(
c.numberTotalCommittedBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "committed_bytes"),
"Displays the amount of virtual memory, in bytes, currently committed by the garbage collector. Committed memory is the physical memory for which space has been reserved in the disk paging file.",
[]string{"process"},
nil,
)
c.NumberTotalreservedBytes = prometheus.NewDesc(
c.numberTotalReservedBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "reserved_bytes"),
"Displays the amount of virtual memory, in bytes, currently reserved by the garbage collector. Reserved memory is the virtual memory space reserved for the application when no disk or main memory pages have been used.",
[]string{"process"},
nil,
)
c.TimeinGC = prometheus.NewDesc(
c.timeInGC = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "gc_time_percent"),
"Displays the percentage of time that was spent performing a garbage collection in the last sample.",
[]string{"process"},
@@ -198,21 +195,21 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.AllocatedBytes,
c.allocatedBytes,
prometheus.CounterValue,
float64(process.AllocatedBytesPersec),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FinalizationSurvivors,
c.finalizationSurvivors,
prometheus.GaugeValue,
float64(process.FinalizationSurvivors),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.HeapSize,
c.heapSize,
prometheus.GaugeValue,
float64(process.Gen0heapsize),
process.Name,
@@ -220,7 +217,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.PromotedBytes,
c.promotedBytes,
prometheus.GaugeValue,
float64(process.Gen0PromotedBytesPerSec),
process.Name,
@@ -228,7 +225,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.HeapSize,
c.heapSize,
prometheus.GaugeValue,
float64(process.Gen1heapsize),
process.Name,
@@ -236,7 +233,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.PromotedBytes,
c.promotedBytes,
prometheus.GaugeValue,
float64(process.Gen1PromotedBytesPerSec),
process.Name,
@@ -244,7 +241,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.HeapSize,
c.heapSize,
prometheus.GaugeValue,
float64(process.Gen2heapsize),
process.Name,
@@ -252,7 +249,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.HeapSize,
c.heapSize,
prometheus.GaugeValue,
float64(process.LargeObjectHeapsize),
process.Name,
@@ -260,14 +257,14 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.NumberGCHandles,
c.numberGCHandles,
prometheus.GaugeValue,
float64(process.NumberGCHandles),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberCollections,
c.numberCollections,
prometheus.CounterValue,
float64(process.NumberGen0Collections),
process.Name,
@@ -275,7 +272,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.NumberCollections,
c.numberCollections,
prometheus.CounterValue,
float64(process.NumberGen1Collections),
process.Name,
@@ -283,7 +280,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.NumberCollections,
c.numberCollections,
prometheus.CounterValue,
float64(process.NumberGen2Collections),
process.Name,
@@ -291,42 +288,42 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.NumberInducedGC,
c.numberInducedGC,
prometheus.CounterValue,
float64(process.NumberInducedGC),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofPinnedObjects,
c.numberOfPinnedObjects,
prometheus.GaugeValue,
float64(process.NumberofPinnedObjects),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofSinkBlocksinuse,
c.numberOfSinkBlocksInUse,
prometheus.GaugeValue,
float64(process.NumberofSinkBlocksinuse),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberTotalCommittedBytes,
c.numberTotalCommittedBytes,
prometheus.GaugeValue,
float64(process.NumberTotalcommittedBytes),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberTotalreservedBytes,
c.numberTotalReservedBytes,
prometheus.GaugeValue,
float64(process.NumberTotalreservedBytes),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TimeinGC,
c.timeInGC,
prometheus.GaugeValue,
float64(100*process.PercentTimeinGC)/float64(process.PercentTimeinGC_base),
process.Name,

View File

@@ -21,12 +21,12 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
Channels *prometheus.Desc
ContextBoundClassesLoaded *prometheus.Desc
ContextBoundObjects *prometheus.Desc
ContextProxies *prometheus.Desc
Contexts *prometheus.Desc
TotalRemoteCalls *prometheus.Desc
channels *prometheus.Desc
contextBoundClassesLoaded *prometheus.Desc
contextBoundObjects *prometheus.Desc
contextProxies *prometheus.Desc
contexts *prometheus.Desc
totalRemoteCalls *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -57,37 +57,37 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.Channels = prometheus.NewDesc(
c.channels = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "channels_total"),
"Displays the total number of remoting channels registered across all application domains since application started.",
[]string{"process"},
nil,
)
c.ContextBoundClassesLoaded = prometheus.NewDesc(
c.contextBoundClassesLoaded = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "context_bound_classes_loaded"),
"Displays the current number of context-bound classes that are loaded.",
[]string{"process"},
nil,
)
c.ContextBoundObjects = prometheus.NewDesc(
c.contextBoundObjects = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "context_bound_objects_total"),
"Displays the total number of context-bound objects allocated.",
[]string{"process"},
nil,
)
c.ContextProxies = prometheus.NewDesc(
c.contextProxies = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "context_proxies_total"),
"Displays the total number of remoting proxy objects in this process since it started.",
[]string{"process"},
nil,
)
c.Contexts = prometheus.NewDesc(
c.contexts = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "contexts"),
"Displays the current number of remoting contexts in the application.",
[]string{"process"},
nil,
)
c.TotalRemoteCalls = prometheus.NewDesc(
c.totalRemoteCalls = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "remote_calls_total"),
"Displays the total number of remote procedure calls invoked since the application started.",
[]string{"process"},
@@ -131,42 +131,42 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.Channels,
c.channels,
prometheus.CounterValue,
float64(process.Channels),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ContextBoundClassesLoaded,
c.contextBoundClassesLoaded,
prometheus.GaugeValue,
float64(process.ContextBoundClassesLoaded),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ContextBoundObjects,
c.contextBoundObjects,
prometheus.CounterValue,
float64(process.ContextBoundObjectsAllocPersec),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ContextProxies,
c.contextProxies,
prometheus.CounterValue,
float64(process.ContextProxies),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Contexts,
c.contexts,
prometheus.GaugeValue,
float64(process.Contexts),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalRemoteCalls,
c.totalRemoteCalls,
prometheus.CounterValue,
float64(process.TotalRemoteCalls),
process.Name,

View File

@@ -21,10 +21,10 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
NumberLinkTimeChecks *prometheus.Desc
TimeinRTchecks *prometheus.Desc
StackWalkDepth *prometheus.Desc
TotalRuntimeChecks *prometheus.Desc
numberLinkTimeChecks *prometheus.Desc
timeInRTChecks *prometheus.Desc
stackWalkDepth *prometheus.Desc
totalRuntimeChecks *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -55,25 +55,25 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.NumberLinkTimeChecks = prometheus.NewDesc(
c.numberLinkTimeChecks = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "link_time_checks_total"),
"Displays the total number of link-time code access security checks since the application started.",
[]string{"process"},
nil,
)
c.TimeinRTchecks = prometheus.NewDesc(
c.timeInRTChecks = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rt_checks_time_percent"),
"Displays the percentage of time spent performing runtime code access security checks in the last sample.",
[]string{"process"},
nil,
)
c.StackWalkDepth = prometheus.NewDesc(
c.stackWalkDepth = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "stack_walk_depth"),
"Displays the depth of the stack during that last runtime code access security check.",
[]string{"process"},
nil,
)
c.TotalRuntimeChecks = prometheus.NewDesc(
c.totalRuntimeChecks = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "runtime_checks_total"),
"Displays the total number of runtime code access security checks performed since the application started.",
[]string{"process"},
@@ -116,28 +116,28 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.NumberLinkTimeChecks,
c.numberLinkTimeChecks,
prometheus.CounterValue,
float64(process.NumberLinkTimeChecks),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TimeinRTchecks,
c.timeInRTChecks,
prometheus.GaugeValue,
float64(process.PercentTimeinRTchecks)/float64(process.Frequency_PerfTime),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.StackWalkDepth,
c.stackWalkDepth,
prometheus.GaugeValue,
float64(process.StackWalkDepth),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalRuntimeChecks,
c.totalRuntimeChecks,
prometheus.CounterValue,
float64(process.TotalRuntimeChecks),
process.Name,

View File

@@ -21,32 +21,32 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
AccessAccepts *prometheus.Desc
AccessChallenges *prometheus.Desc
AccessRejects *prometheus.Desc
AccessRequests *prometheus.Desc
AccessBadAuthenticators *prometheus.Desc
AccessDroppedPackets *prometheus.Desc
AccessInvalidRequests *prometheus.Desc
AccessMalformedPackets *prometheus.Desc
AccessPacketsReceived *prometheus.Desc
AccessPacketsSent *prometheus.Desc
AccessServerResetTime *prometheus.Desc
AccessServerUpTime *prometheus.Desc
AccessUnknownType *prometheus.Desc
accessAccepts *prometheus.Desc
accessChallenges *prometheus.Desc
accessRejects *prometheus.Desc
accessRequests *prometheus.Desc
accessBadAuthenticators *prometheus.Desc
accessDroppedPackets *prometheus.Desc
accessInvalidRequests *prometheus.Desc
accessMalformedPackets *prometheus.Desc
accessPacketsReceived *prometheus.Desc
accessPacketsSent *prometheus.Desc
accessServerResetTime *prometheus.Desc
accessServerUpTime *prometheus.Desc
accessUnknownType *prometheus.Desc
AccountingRequests *prometheus.Desc
AccountingResponses *prometheus.Desc
AccountingBadAuthenticators *prometheus.Desc
AccountingDroppedPackets *prometheus.Desc
AccountingInvalidRequests *prometheus.Desc
AccountingMalformedPackets *prometheus.Desc
AccountingNoRecord *prometheus.Desc
AccountingPacketsReceived *prometheus.Desc
AccountingPacketsSent *prometheus.Desc
AccountingServerResetTime *prometheus.Desc
AccountingServerUpTime *prometheus.Desc
AccountingUnknownType *prometheus.Desc
accountingRequests *prometheus.Desc
accountingResponses *prometheus.Desc
accountingBadAuthenticators *prometheus.Desc
accountingDroppedPackets *prometheus.Desc
accountingInvalidRequests *prometheus.Desc
accountingMalformedPackets *prometheus.Desc
accountingNoRecord *prometheus.Desc
accountingPacketsReceived *prometheus.Desc
accountingPacketsSent *prometheus.Desc
accountingServerResetTime *prometheus.Desc
accountingServerUpTime *prometheus.Desc
accountingUnknownType *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -77,152 +77,152 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.AccessAccepts = prometheus.NewDesc(
c.accessAccepts = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_accepts"),
"(AccessAccepts)",
nil,
nil,
)
c.AccessChallenges = prometheus.NewDesc(
c.accessChallenges = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_challenges"),
"(AccessChallenges)",
nil,
nil,
)
c.AccessRejects = prometheus.NewDesc(
c.accessRejects = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_rejects"),
"(AccessRejects)",
nil,
nil,
)
c.AccessRequests = prometheus.NewDesc(
c.accessRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_requests"),
"(AccessRequests)",
nil,
nil,
)
c.AccessBadAuthenticators = prometheus.NewDesc(
c.accessBadAuthenticators = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_bad_authenticators"),
"(BadAuthenticators)",
nil,
nil,
)
c.AccessDroppedPackets = prometheus.NewDesc(
c.accessDroppedPackets = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_dropped_packets"),
"(DroppedPackets)",
nil,
nil,
)
c.AccessInvalidRequests = prometheus.NewDesc(
c.accessInvalidRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_invalid_requests"),
"(InvalidRequests)",
nil,
nil,
)
c.AccessMalformedPackets = prometheus.NewDesc(
c.accessMalformedPackets = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_malformed_packets"),
"(MalformedPackets)",
nil,
nil,
)
c.AccessPacketsReceived = prometheus.NewDesc(
c.accessPacketsReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_packets_received"),
"(PacketsReceived)",
nil,
nil,
)
c.AccessPacketsSent = prometheus.NewDesc(
c.accessPacketsSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_packets_sent"),
"(PacketsSent)",
nil,
nil,
)
c.AccessServerResetTime = prometheus.NewDesc(
c.accessServerResetTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_server_reset_time"),
"(ServerResetTime)",
nil,
nil,
)
c.AccessServerUpTime = prometheus.NewDesc(
c.accessServerUpTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_server_up_time"),
"(ServerUpTime)",
nil,
nil,
)
c.AccessUnknownType = prometheus.NewDesc(
c.accessUnknownType = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "access_unknown_type"),
"(UnknownType)",
nil,
nil,
)
c.AccountingRequests = prometheus.NewDesc(
c.accountingRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_requests"),
"(AccountingRequests)",
nil,
nil,
)
c.AccountingResponses = prometheus.NewDesc(
c.accountingResponses = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_responses"),
"(AccountingResponses)",
nil,
nil,
)
c.AccountingBadAuthenticators = prometheus.NewDesc(
c.accountingBadAuthenticators = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_bad_authenticators"),
"(BadAuthenticators)",
nil,
nil,
)
c.AccountingDroppedPackets = prometheus.NewDesc(
c.accountingDroppedPackets = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_dropped_packets"),
"(DroppedPackets)",
nil,
nil,
)
c.AccountingInvalidRequests = prometheus.NewDesc(
c.accountingInvalidRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_invalid_requests"),
"(InvalidRequests)",
nil,
nil,
)
c.AccountingMalformedPackets = prometheus.NewDesc(
c.accountingMalformedPackets = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_malformed_packets"),
"(MalformedPackets)",
nil,
nil,
)
c.AccountingNoRecord = prometheus.NewDesc(
c.accountingNoRecord = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_no_record"),
"(NoRecord)",
nil,
nil,
)
c.AccountingPacketsReceived = prometheus.NewDesc(
c.accountingPacketsReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_packets_received"),
"(PacketsReceived)",
nil,
nil,
)
c.AccountingPacketsSent = prometheus.NewDesc(
c.accountingPacketsSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_packets_sent"),
"(PacketsSent)",
nil,
nil,
)
c.AccountingServerResetTime = prometheus.NewDesc(
c.accountingServerResetTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_server_reset_time"),
"(ServerResetTime)",
nil,
nil,
)
c.AccountingServerUpTime = prometheus.NewDesc(
c.accountingServerUpTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_server_up_time"),
"(ServerUpTime)",
nil,
nil,
)
c.AccountingUnknownType = prometheus.NewDesc(
c.accountingUnknownType = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accounting_unknown_type"),
"(UnknownType)",
nil,
@@ -292,79 +292,79 @@ func (c *Collector) CollectAccept(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.AccessAccepts,
c.accessAccepts,
prometheus.CounterValue,
float64(dst[0].AccessAccepts),
)
ch <- prometheus.MustNewConstMetric(
c.AccessChallenges,
c.accessChallenges,
prometheus.CounterValue,
float64(dst[0].AccessChallenges),
)
ch <- prometheus.MustNewConstMetric(
c.AccessRejects,
c.accessRejects,
prometheus.CounterValue,
float64(dst[0].AccessRejects),
)
ch <- prometheus.MustNewConstMetric(
c.AccessRequests,
c.accessRequests,
prometheus.CounterValue,
float64(dst[0].AccessRequests),
)
ch <- prometheus.MustNewConstMetric(
c.AccessBadAuthenticators,
c.accessBadAuthenticators,
prometheus.CounterValue,
float64(dst[0].AccessBadAuthenticators),
)
ch <- prometheus.MustNewConstMetric(
c.AccessDroppedPackets,
c.accessDroppedPackets,
prometheus.CounterValue,
float64(dst[0].AccessDroppedPackets),
)
ch <- prometheus.MustNewConstMetric(
c.AccessInvalidRequests,
c.accessInvalidRequests,
prometheus.CounterValue,
float64(dst[0].AccessInvalidRequests),
)
ch <- prometheus.MustNewConstMetric(
c.AccessMalformedPackets,
c.accessMalformedPackets,
prometheus.CounterValue,
float64(dst[0].AccessMalformedPackets),
)
ch <- prometheus.MustNewConstMetric(
c.AccessPacketsReceived,
c.accessPacketsReceived,
prometheus.CounterValue,
float64(dst[0].AccessPacketsReceived),
)
ch <- prometheus.MustNewConstMetric(
c.AccessPacketsSent,
c.accessPacketsSent,
prometheus.CounterValue,
float64(dst[0].AccessPacketsSent),
)
ch <- prometheus.MustNewConstMetric(
c.AccessServerResetTime,
c.accessServerResetTime,
prometheus.CounterValue,
float64(dst[0].AccessServerResetTime),
)
ch <- prometheus.MustNewConstMetric(
c.AccessServerUpTime,
c.accessServerUpTime,
prometheus.CounterValue,
float64(dst[0].AccessServerUpTime),
)
ch <- prometheus.MustNewConstMetric(
c.AccessUnknownType,
c.accessUnknownType,
prometheus.CounterValue,
float64(dst[0].AccessUnknownType),
)
@@ -380,73 +380,73 @@ func (c *Collector) CollectAccounting(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.AccountingRequests,
c.accountingRequests,
prometheus.CounterValue,
float64(dst[0].AccountingRequests),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingResponses,
c.accountingResponses,
prometheus.CounterValue,
float64(dst[0].AccountingResponses),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingBadAuthenticators,
c.accountingBadAuthenticators,
prometheus.CounterValue,
float64(dst[0].AccountingBadAuthenticators),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingDroppedPackets,
c.accountingDroppedPackets,
prometheus.CounterValue,
float64(dst[0].AccountingDroppedPackets),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingInvalidRequests,
c.accountingInvalidRequests,
prometheus.CounterValue,
float64(dst[0].AccountingInvalidRequests),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingMalformedPackets,
c.accountingMalformedPackets,
prometheus.CounterValue,
float64(dst[0].AccountingMalformedPackets),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingNoRecord,
c.accountingNoRecord,
prometheus.CounterValue,
float64(dst[0].AccountingNoRecord),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingPacketsReceived,
c.accountingPacketsReceived,
prometheus.CounterValue,
float64(dst[0].AccountingPacketsReceived),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingPacketsSent,
c.accountingPacketsSent,
prometheus.CounterValue,
float64(dst[0].AccountingPacketsSent),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingServerResetTime,
c.accountingServerResetTime,
prometheus.CounterValue,
float64(dst[0].AccountingServerResetTime),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingServerUpTime,
c.accountingServerUpTime,
prometheus.CounterValue,
float64(dst[0].AccountingServerUpTime),
)
ch <- prometheus.MustNewConstMetric(
c.AccountingUnknownType,
c.accountingUnknownType,
prometheus.CounterValue,
float64(dst[0].AccountingUnknownType),
)

View File

@@ -34,19 +34,19 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
OSInformation *prometheus.Desc
PhysicalMemoryFreeBytes *prometheus.Desc
PagingFreeBytes *prometheus.Desc
VirtualMemoryFreeBytes *prometheus.Desc
ProcessesLimit *prometheus.Desc
ProcessMemoryLimitBytes *prometheus.Desc
Processes *prometheus.Desc
Users *prometheus.Desc
PagingLimitBytes *prometheus.Desc
VirtualMemoryBytes *prometheus.Desc
VisibleMemoryBytes *prometheus.Desc
Time *prometheus.Desc
Timezone *prometheus.Desc
osInformation *prometheus.Desc
pagingFreeBytes *prometheus.Desc
pagingLimitBytes *prometheus.Desc
physicalMemoryFreeBytes *prometheus.Desc
processMemoryLimitBytes *prometheus.Desc
processes *prometheus.Desc
processesLimit *prometheus.Desc
time *prometheus.Desc
timezone *prometheus.Desc
users *prometheus.Desc
virtualMemoryBytes *prometheus.Desc
virtualMemoryFreeBytes *prometheus.Desc
visibleMemoryBytes *prometheus.Desc
}
type pagingFileCounter struct {
@@ -83,79 +83,79 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.OSInformation = prometheus.NewDesc(
c.osInformation = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "info"),
"OperatingSystem.Caption, OperatingSystem.Version",
[]string{"product", "version", "major_version", "minor_version", "build_number", "revision"},
nil,
)
c.PagingLimitBytes = prometheus.NewDesc(
c.pagingLimitBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "paging_limit_bytes"),
"OperatingSystem.SizeStoredInPagingFiles",
nil,
nil,
)
c.PagingFreeBytes = prometheus.NewDesc(
c.pagingFreeBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "paging_free_bytes"),
"OperatingSystem.FreeSpaceInPagingFiles",
nil,
nil,
)
c.PhysicalMemoryFreeBytes = prometheus.NewDesc(
c.physicalMemoryFreeBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "physical_memory_free_bytes"),
"OperatingSystem.FreePhysicalMemory",
nil,
nil,
)
c.Time = prometheus.NewDesc(
c.time = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "time"),
"OperatingSystem.LocalDateTime",
nil,
nil,
)
c.Timezone = prometheus.NewDesc(
c.timezone = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "timezone"),
"OperatingSystem.LocalDateTime",
[]string{"timezone"},
nil,
)
c.Processes = prometheus.NewDesc(
c.processes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "processes"),
"OperatingSystem.NumberOfProcesses",
nil,
nil,
)
c.ProcessesLimit = prometheus.NewDesc(
c.processesLimit = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "processes_limit"),
"OperatingSystem.MaxNumberOfProcesses",
nil,
nil,
)
c.ProcessMemoryLimitBytes = prometheus.NewDesc(
c.processMemoryLimitBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "process_memory_limit_bytes"),
"OperatingSystem.MaxProcessMemorySize",
nil,
nil,
)
c.Users = prometheus.NewDesc(
c.users = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "users"),
"OperatingSystem.NumberOfUsers",
nil,
nil,
)
c.VirtualMemoryBytes = prometheus.NewDesc(
c.virtualMemoryBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "virtual_memory_bytes"),
"OperatingSystem.TotalVirtualMemorySize",
nil,
nil,
)
c.VisibleMemoryBytes = prometheus.NewDesc(
c.visibleMemoryBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "visible_memory_bytes"),
"OperatingSystem.TotalVisibleMemorySize",
nil,
nil,
)
c.VirtualMemoryFreeBytes = prometheus.NewDesc(
c.virtualMemoryFreeBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "virtual_memory_free_bytes"),
"OperatingSystem.FreeVirtualMemory",
nil,
@@ -282,7 +282,7 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
pfb := fsipf - (pfbRaw * float64(gpi.PageSize))
ch <- prometheus.MustNewConstMetric(
c.OSInformation,
c.osInformation,
prometheus.GaugeValue,
1.0,
"Microsoft "+pn, // Caption
@@ -294,19 +294,19 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
)
ch <- prometheus.MustNewConstMetric(
c.PhysicalMemoryFreeBytes,
c.physicalMemoryFreeBytes,
prometheus.GaugeValue,
float64(gmse.AvailPhys),
)
ch <- prometheus.MustNewConstMetric(
c.Time,
c.time,
prometheus.GaugeValue,
float64(currentTime.Unix()),
)
ch <- prometheus.MustNewConstMetric(
c.Timezone,
c.timezone,
prometheus.GaugeValue,
1.0,
timezoneName,
@@ -314,13 +314,13 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
if pagingErr == nil {
ch <- prometheus.MustNewConstMetric(
c.PagingFreeBytes,
c.pagingFreeBytes,
prometheus.GaugeValue,
pfb,
)
ch <- prometheus.MustNewConstMetric(
c.PagingLimitBytes,
c.pagingLimitBytes,
prometheus.GaugeValue,
fsipf,
)
@@ -328,7 +328,7 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
_ = level.Debug(c.logger).Log("msg", "Could not find HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management key. windows_os_paging_free_bytes and windows_os_paging_limit_bytes will be omitted.")
}
ch <- prometheus.MustNewConstMetric(
c.VirtualMemoryFreeBytes,
c.virtualMemoryFreeBytes,
prometheus.GaugeValue,
float64(gmse.AvailPageFile),
)
@@ -337,37 +337,37 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
// https://techcommunity.microsoft.com/t5/windows-blog-archive/pushing-the-limits-of-windows-processes-and-threads/ba-p/723824
// https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-operatingsystem
ch <- prometheus.MustNewConstMetric(
c.ProcessesLimit,
c.processesLimit,
prometheus.GaugeValue,
float64(4294967295),
)
ch <- prometheus.MustNewConstMetric(
c.ProcessMemoryLimitBytes,
c.processMemoryLimitBytes,
prometheus.GaugeValue,
float64(gmse.TotalVirtual),
)
ch <- prometheus.MustNewConstMetric(
c.Processes,
c.processes,
prometheus.GaugeValue,
float64(gpi.ProcessCount),
)
ch <- prometheus.MustNewConstMetric(
c.Users,
c.users,
prometheus.GaugeValue,
float64(nwgi.LoggedOnUsers),
)
ch <- prometheus.MustNewConstMetric(
c.VirtualMemoryBytes,
c.virtualMemoryBytes,
prometheus.GaugeValue,
float64(gmse.TotalPageFile),
)
ch <- prometheus.MustNewConstMetric(
c.VisibleMemoryBytes,
c.visibleMemoryBytes,
prometheus.GaugeValue,
float64(gmse.TotalPhys),
)

View File

@@ -37,21 +37,21 @@ type Collector struct {
diskIncludeSet bool
diskExcludeSet bool
RequestsQueued *prometheus.Desc
ReadBytesTotal *prometheus.Desc
ReadsTotal *prometheus.Desc
WriteBytesTotal *prometheus.Desc
WritesTotal *prometheus.Desc
ReadTime *prometheus.Desc
WriteTime *prometheus.Desc
IdleTime *prometheus.Desc
SplitIOs *prometheus.Desc
ReadLatency *prometheus.Desc
WriteLatency *prometheus.Desc
ReadWriteLatency *prometheus.Desc
diskIncludePattern *regexp.Regexp
diskExcludePattern *regexp.Regexp
idleTime *prometheus.Desc
readBytesTotal *prometheus.Desc
readLatency *prometheus.Desc
readTime *prometheus.Desc
readWriteLatency *prometheus.Desc
readsTotal *prometheus.Desc
requestsQueued *prometheus.Desc
splitIOs *prometheus.Desc
writeBytesTotal *prometheus.Desc
writeLatency *prometheus.Desc
writeTime *prometheus.Desc
writesTotal *prometheus.Desc
}
func New(logger log.Logger, config *Config) *Collector {
@@ -107,84 +107,84 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.RequestsQueued = prometheus.NewDesc(
c.requestsQueued = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "requests_queued"),
"The number of requests queued to the disk (PhysicalDisk.CurrentDiskQueueLength)",
[]string{"disk"},
nil,
)
c.ReadBytesTotal = prometheus.NewDesc(
c.readBytesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "read_bytes_total"),
"The number of bytes transferred from the disk during read operations (PhysicalDisk.DiskReadBytesPerSec)",
[]string{"disk"},
nil,
)
c.ReadsTotal = prometheus.NewDesc(
c.readsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "reads_total"),
"The number of read operations on the disk (PhysicalDisk.DiskReadsPerSec)",
[]string{"disk"},
nil,
)
c.WriteBytesTotal = prometheus.NewDesc(
c.writeBytesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "write_bytes_total"),
"The number of bytes transferred to the disk during write operations (PhysicalDisk.DiskWriteBytesPerSec)",
[]string{"disk"},
nil,
)
c.WritesTotal = prometheus.NewDesc(
c.writesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "writes_total"),
"The number of write operations on the disk (PhysicalDisk.DiskWritesPerSec)",
[]string{"disk"},
nil,
)
c.ReadTime = prometheus.NewDesc(
c.readTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "read_seconds_total"),
"Seconds that the disk was busy servicing read requests (PhysicalDisk.PercentDiskReadTime)",
[]string{"disk"},
nil,
)
c.WriteTime = prometheus.NewDesc(
c.writeTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "write_seconds_total"),
"Seconds that the disk was busy servicing write requests (PhysicalDisk.PercentDiskWriteTime)",
[]string{"disk"},
nil,
)
c.IdleTime = prometheus.NewDesc(
c.idleTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "idle_seconds_total"),
"Seconds that the disk was idle (PhysicalDisk.PercentIdleTime)",
[]string{"disk"},
nil,
)
c.SplitIOs = prometheus.NewDesc(
c.splitIOs = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "split_ios_total"),
"The number of I/Os to the disk were split into multiple I/Os (PhysicalDisk.SplitIOPerSec)",
[]string{"disk"},
nil,
)
c.ReadLatency = prometheus.NewDesc(
c.readLatency = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "read_latency_seconds_total"),
"Shows the average time, in seconds, of a read operation from the disk (PhysicalDisk.AvgDiskSecPerRead)",
[]string{"disk"},
nil,
)
c.WriteLatency = prometheus.NewDesc(
c.writeLatency = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "write_latency_seconds_total"),
"Shows the average time, in seconds, of a write operation to the disk (PhysicalDisk.AvgDiskSecPerWrite)",
[]string{"disk"},
nil,
)
c.ReadWriteLatency = prometheus.NewDesc(
c.readWriteLatency = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "read_write_latency_seconds_total"),
"Shows the time, in seconds, of the average disk transfer (PhysicalDisk.AvgDiskSecPerTransfer)",
[]string{"disk"},
@@ -252,84 +252,84 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
disk_number, _, _ := strings.Cut(disk.Name, " ")
ch <- prometheus.MustNewConstMetric(
c.RequestsQueued,
c.requestsQueued,
prometheus.GaugeValue,
disk.CurrentDiskQueueLength,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.ReadBytesTotal,
c.readBytesTotal,
prometheus.CounterValue,
disk.DiskReadBytesPerSec,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.ReadsTotal,
c.readsTotal,
prometheus.CounterValue,
disk.DiskReadsPerSec,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.WriteBytesTotal,
c.writeBytesTotal,
prometheus.CounterValue,
disk.DiskWriteBytesPerSec,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.WritesTotal,
c.writesTotal,
prometheus.CounterValue,
disk.DiskWritesPerSec,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.ReadTime,
c.readTime,
prometheus.CounterValue,
disk.PercentDiskReadTime,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.WriteTime,
c.writeTime,
prometheus.CounterValue,
disk.PercentDiskWriteTime,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.IdleTime,
c.idleTime,
prometheus.CounterValue,
disk.PercentIdleTime,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.SplitIOs,
c.splitIOs,
prometheus.CounterValue,
disk.SplitIOPerSec,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.ReadLatency,
c.readLatency,
prometheus.CounterValue,
disk.AvgDiskSecPerRead*perflib.TicksToSecondScaleFactor,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.WriteLatency,
c.writeLatency,
prometheus.CounterValue,
disk.AvgDiskSecPerWrite*perflib.TicksToSecondScaleFactor,
disk_number,
)
ch <- prometheus.MustNewConstMetric(
c.ReadWriteLatency,
c.readWriteLatency,
prometheus.CounterValue,
disk.AvgDiskSecPerTransfer*perflib.TicksToSecondScaleFactor,
disk_number,

View File

@@ -0,0 +1,12 @@
package physical_disk_test
import (
"testing"
"github.com/prometheus-community/windows_exporter/pkg/collector/physical_disk"
"github.com/prometheus-community/windows_exporter/pkg/testutils"
)
func BenchmarkCollector(b *testing.B) {
testutils.FuncBenchmarkCollector(b, physical_disk.Name, physical_disk.NewWithFlags)
}

View File

@@ -40,32 +40,32 @@ var ConfigDefaults = Config{
type Collector struct {
logger log.Logger
processInclude *string
processExclude *string
enableWorkerProcess *bool
enableReportOwner *bool
StartTime *prometheus.Desc
CPUTimeTotal *prometheus.Desc
HandleCount *prometheus.Desc
IOBytesTotal *prometheus.Desc
IOOperationsTotal *prometheus.Desc
PageFaultsTotal *prometheus.Desc
PageFileBytes *prometheus.Desc
PoolBytes *prometheus.Desc
PriorityBase *prometheus.Desc
PrivateBytes *prometheus.Desc
ThreadCount *prometheus.Desc
VirtualBytes *prometheus.Desc
WorkingSetPrivate *prometheus.Desc
WorkingSetPeak *prometheus.Desc
WorkingSet *prometheus.Desc
processInclude *string
processExclude *string
processIncludePattern *regexp.Regexp
processExcludePattern *regexp.Regexp
lookupCache map[string]string
cpuTimeTotal *prometheus.Desc
handleCount *prometheus.Desc
ioBytesTotal *prometheus.Desc
ioOperationsTotal *prometheus.Desc
pageFaultsTotal *prometheus.Desc
pageFileBytes *prometheus.Desc
poolBytes *prometheus.Desc
priorityBase *prometheus.Desc
privateBytes *prometheus.Desc
startTime *prometheus.Desc
threadCount *prometheus.Desc
virtualBytes *prometheus.Desc
workingSet *prometheus.Desc
workingSetPeak *prometheus.Desc
workingSetPrivate *prometheus.Desc
}
func New(logger log.Logger, config *Config) *Collector {
@@ -134,91 +134,91 @@ func (c *Collector) Build() error {
commonLabels = []string{"owner"}
}
c.StartTime = prometheus.NewDesc(
c.startTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "start_time"),
"Time of process start.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.CPUTimeTotal = prometheus.NewDesc(
c.cpuTimeTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cpu_time_total"),
"Returns elapsed time that all of the threads of this process used the processor to execute instructions by mode (privileged, user).",
append(commonLabels, "process", "process_id", "creating_process_id", "mode"),
nil,
)
c.HandleCount = prometheus.NewDesc(
c.handleCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "handles"),
"Total number of handles the process has open. This number is the sum of the handles currently open by each thread in the process.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.IOBytesTotal = prometheus.NewDesc(
c.ioBytesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "io_bytes_total"),
"Bytes issued to I/O operations in different modes (read, write, other).",
append(commonLabels, "process", "process_id", "creating_process_id", "mode"),
nil,
)
c.IOOperationsTotal = prometheus.NewDesc(
c.ioOperationsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "io_operations_total"),
"I/O operations issued in different modes (read, write, other).",
append(commonLabels, "process", "process_id", "creating_process_id", "mode"),
nil,
)
c.PageFaultsTotal = prometheus.NewDesc(
c.pageFaultsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "page_faults_total"),
"Page faults by the threads executing in this process.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.PageFileBytes = prometheus.NewDesc(
c.pageFileBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "page_file_bytes"),
"Current number of bytes this process has used in the paging file(s).",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.PoolBytes = prometheus.NewDesc(
c.poolBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "pool_bytes"),
"Pool Bytes is the last observed number of bytes in the paged or nonpaged pool.",
append(commonLabels, "process", "process_id", "creating_process_id", "pool"),
nil,
)
c.PriorityBase = prometheus.NewDesc(
c.priorityBase = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "priority_base"),
"Current base priority of this process. Threads within a process can raise and lower their own base priority relative to the process base priority of the process.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.PrivateBytes = prometheus.NewDesc(
c.privateBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "private_bytes"),
"Current number of bytes this process has allocated that cannot be shared with other processes.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.ThreadCount = prometheus.NewDesc(
c.threadCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "threads"),
"Number of threads currently active in this process.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.VirtualBytes = prometheus.NewDesc(
c.virtualBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "virtual_bytes"),
"Current size, in bytes, of the virtual address space that the process is using.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.WorkingSetPrivate = prometheus.NewDesc(
c.workingSetPrivate = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "working_set_private_bytes"),
"Size of the working set, in bytes, that is use for this process only and not shared nor shareable by other processes.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.WorkingSetPeak = prometheus.NewDesc(
c.workingSetPeak = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "working_set_peak_bytes"),
"Maximum size, in bytes, of the Working Set of this process at any point in time. The Working Set is the set of memory pages touched recently by the threads in the process.",
append(commonLabels, "process", "process_id", "creating_process_id"),
nil,
)
c.WorkingSet = prometheus.NewDesc(
c.workingSet = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "working_set_bytes"),
"Maximum number of bytes in the working set of this process at any point in time. The working set is the set of memory pages touched recently by the threads in the process.",
append(commonLabels, "process", "process_id", "creating_process_id"),
@@ -330,147 +330,147 @@ func (c *Collector) Collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
labels = append(labels, processName, pid, cpid)
ch <- prometheus.MustNewConstMetric(
c.StartTime,
c.startTime,
prometheus.GaugeValue,
process.ElapsedTime,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.HandleCount,
c.handleCount,
prometheus.GaugeValue,
process.HandleCount,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.CPUTimeTotal,
c.cpuTimeTotal,
prometheus.CounterValue,
process.PercentPrivilegedTime,
append(labels, "privileged")...,
)
ch <- prometheus.MustNewConstMetric(
c.CPUTimeTotal,
c.cpuTimeTotal,
prometheus.CounterValue,
process.PercentUserTime,
append(labels, "user")...,
)
ch <- prometheus.MustNewConstMetric(
c.IOBytesTotal,
c.ioBytesTotal,
prometheus.CounterValue,
process.IOOtherBytesPerSec,
append(labels, "other")...,
)
ch <- prometheus.MustNewConstMetric(
c.IOOperationsTotal,
c.ioOperationsTotal,
prometheus.CounterValue,
process.IOOtherOperationsPerSec,
append(labels, "other")...,
)
ch <- prometheus.MustNewConstMetric(
c.IOBytesTotal,
c.ioBytesTotal,
prometheus.CounterValue,
process.IOReadBytesPerSec,
append(labels, "read")...,
)
ch <- prometheus.MustNewConstMetric(
c.IOOperationsTotal,
c.ioOperationsTotal,
prometheus.CounterValue,
process.IOReadOperationsPerSec,
append(labels, "read")...,
)
ch <- prometheus.MustNewConstMetric(
c.IOBytesTotal,
c.ioBytesTotal,
prometheus.CounterValue,
process.IOWriteBytesPerSec,
append(labels, "write")...,
)
ch <- prometheus.MustNewConstMetric(
c.IOOperationsTotal,
c.ioOperationsTotal,
prometheus.CounterValue,
process.IOWriteOperationsPerSec,
append(labels, "write")...,
)
ch <- prometheus.MustNewConstMetric(
c.PageFaultsTotal,
c.pageFaultsTotal,
prometheus.CounterValue,
process.PageFaultsPerSec,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.PageFileBytes,
c.pageFileBytes,
prometheus.GaugeValue,
process.PageFileBytes,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.PoolBytes,
c.poolBytes,
prometheus.GaugeValue,
process.PoolNonpagedBytes,
append(labels, "nonpaged")...,
)
ch <- prometheus.MustNewConstMetric(
c.PoolBytes,
c.poolBytes,
prometheus.GaugeValue,
process.PoolPagedBytes,
append(labels, "paged")...,
)
ch <- prometheus.MustNewConstMetric(
c.PriorityBase,
c.priorityBase,
prometheus.GaugeValue,
process.PriorityBase,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.PrivateBytes,
c.privateBytes,
prometheus.GaugeValue,
process.PrivateBytes,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.ThreadCount,
c.threadCount,
prometheus.GaugeValue,
process.ThreadCount,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.VirtualBytes,
c.virtualBytes,
prometheus.GaugeValue,
process.VirtualBytes,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.WorkingSetPrivate,
c.workingSetPrivate,
prometheus.GaugeValue,
process.WorkingSetPrivate,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.WorkingSetPeak,
c.workingSetPeak,
prometheus.GaugeValue,
process.WorkingSetPeak,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.WorkingSet,
c.workingSet,
prometheus.GaugeValue,
process.WorkingSet,
labels...,

View File

@@ -29,28 +29,28 @@ type Collector struct {
logger log.Logger
// net
BaseTCPRTT *prometheus.Desc
BaseUDPRTT *prometheus.Desc
CurrentTCPBandwidth *prometheus.Desc
CurrentTCPRTT *prometheus.Desc
CurrentUDPBandwidth *prometheus.Desc
CurrentUDPRTT *prometheus.Desc
TotalReceivedBytes *prometheus.Desc
TotalSentBytes *prometheus.Desc
UDPPacketsReceivedPersec *prometheus.Desc
UDPPacketsSentPersec *prometheus.Desc
FECRate *prometheus.Desc
LossRate *prometheus.Desc
RetransmissionRate *prometheus.Desc
baseTCPRTT *prometheus.Desc
baseUDPRTT *prometheus.Desc
currentTCPBandwidth *prometheus.Desc
currentTCPRTT *prometheus.Desc
currentUDPBandwidth *prometheus.Desc
currentUDPRTT *prometheus.Desc
fecRate *prometheus.Desc
lossRate *prometheus.Desc
retransmissionRate *prometheus.Desc
totalReceivedBytes *prometheus.Desc
totalSentBytes *prometheus.Desc
udpPacketsReceivedPerSec *prometheus.Desc
udpPacketsSentPerSec *prometheus.Desc
// gfx
AverageEncodingTime *prometheus.Desc
FrameQuality *prometheus.Desc
FramesSkippedPerSecondInsufficientResources *prometheus.Desc
GraphicsCompressionratio *prometheus.Desc
InputFramesPerSecond *prometheus.Desc
OutputFramesPerSecond *prometheus.Desc
SourceFramesPerSecond *prometheus.Desc
averageEncodingTime *prometheus.Desc
frameQuality *prometheus.Desc
framesSkippedPerSecondInsufficientResources *prometheus.Desc
graphicsCompressionRatio *prometheus.Desc
inputFramesPerSecond *prometheus.Desc
outputFramesPerSecond *prometheus.Desc
sourceFramesPerSecond *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -82,79 +82,79 @@ func (c *Collector) Close() error {
func (c *Collector) Build() error {
// net
c.BaseTCPRTT = prometheus.NewDesc(
c.baseTCPRTT = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_base_tcp_rtt_seconds"),
"Base TCP round-trip time (RTT) detected in seconds",
[]string{"session_name"},
nil,
)
c.BaseUDPRTT = prometheus.NewDesc(
c.baseUDPRTT = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_base_udp_rtt_seconds"),
"Base UDP round-trip time (RTT) detected in seconds.",
[]string{"session_name"},
nil,
)
c.CurrentTCPBandwidth = prometheus.NewDesc(
c.currentTCPBandwidth = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_current_tcp_bandwidth"),
"TCP Bandwidth detected in bytes per second.",
[]string{"session_name"},
nil,
)
c.CurrentTCPRTT = prometheus.NewDesc(
c.currentTCPRTT = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_current_tcp_rtt_seconds"),
"Average TCP round-trip time (RTT) detected in seconds.",
[]string{"session_name"},
nil,
)
c.CurrentUDPBandwidth = prometheus.NewDesc(
c.currentUDPBandwidth = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_current_udp_bandwidth"),
"UDP Bandwidth detected in bytes per second.",
[]string{"session_name"},
nil,
)
c.CurrentUDPRTT = prometheus.NewDesc(
c.currentUDPRTT = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_current_udp_rtt_seconds"),
"Average UDP round-trip time (RTT) detected in seconds.",
[]string{"session_name"},
nil,
)
c.TotalReceivedBytes = prometheus.NewDesc(
c.totalReceivedBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_received_bytes_total"),
"(TotalReceivedBytes)",
[]string{"session_name"},
nil,
)
c.TotalSentBytes = prometheus.NewDesc(
c.totalSentBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_sent_bytes_total"),
"(TotalSentBytes)",
[]string{"session_name"},
nil,
)
c.UDPPacketsReceivedPersec = prometheus.NewDesc(
c.udpPacketsReceivedPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_udp_packets_received_total"),
"Rate in packets per second at which packets are received over UDP.",
[]string{"session_name"},
nil,
)
c.UDPPacketsSentPersec = prometheus.NewDesc(
c.udpPacketsSentPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_udp_packets_sent_total"),
"Rate in packets per second at which packets are sent over UDP.",
[]string{"session_name"},
nil,
)
c.FECRate = prometheus.NewDesc(
c.fecRate = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_fec_rate"),
"Forward Error Correction (FEC) percentage",
[]string{"session_name"},
nil,
)
c.LossRate = prometheus.NewDesc(
c.lossRate = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_loss_rate"),
"Loss percentage",
[]string{"session_name"},
nil,
)
c.RetransmissionRate = prometheus.NewDesc(
c.retransmissionRate = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "net_retransmission_rate"),
"Percentage of packets that have been retransmitted",
[]string{"session_name"},
@@ -162,43 +162,43 @@ func (c *Collector) Build() error {
)
// gfx
c.AverageEncodingTime = prometheus.NewDesc(
c.averageEncodingTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "gfx_average_encoding_time_seconds"),
"Average frame encoding time in seconds",
[]string{"session_name"},
nil,
)
c.FrameQuality = prometheus.NewDesc(
c.frameQuality = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "gfx_frame_quality"),
"Quality of the output frame expressed as a percentage of the quality of the source frame.",
[]string{"session_name"},
nil,
)
c.FramesSkippedPerSecondInsufficientResources = prometheus.NewDesc(
c.framesSkippedPerSecondInsufficientResources = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "gfx_frames_skipped_insufficient_resource_total"),
"Number of frames skipped per second due to insufficient client resources.",
[]string{"session_name", "resource"},
nil,
)
c.GraphicsCompressionratio = prometheus.NewDesc(
c.graphicsCompressionRatio = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "gfx_graphics_compression_ratio"),
"Ratio of the number of bytes encoded to the number of bytes input.",
[]string{"session_name"},
nil,
)
c.InputFramesPerSecond = prometheus.NewDesc(
c.inputFramesPerSecond = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "gfx_input_frames_total"),
"Number of sources frames provided as input to RemoteFX graphics per second.",
[]string{"session_name"},
nil,
)
c.OutputFramesPerSecond = prometheus.NewDesc(
c.outputFramesPerSecond = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "gfx_output_frames_total"),
"Number of frames sent to the client per second.",
[]string{"session_name"},
nil,
)
c.SourceFramesPerSecond = prometheus.NewDesc(
c.sourceFramesPerSecond = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "gfx_source_frames_total"),
"Number of frames composed by the source (DWM) per second.",
[]string{"session_name"},
@@ -252,81 +252,81 @@ func (c *Collector) collectRemoteFXNetworkCount(ctx *types.ScrapeContext, ch cha
continue
}
ch <- prometheus.MustNewConstMetric(
c.BaseTCPRTT,
c.baseTCPRTT,
prometheus.GaugeValue,
utils.MilliSecToSec(d.BaseTCPRTT),
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.BaseUDPRTT,
c.baseUDPRTT,
prometheus.GaugeValue,
utils.MilliSecToSec(d.BaseUDPRTT),
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.CurrentTCPBandwidth,
c.currentTCPBandwidth,
prometheus.GaugeValue,
(d.CurrentTCPBandwidth*1000)/8,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.CurrentTCPRTT,
c.currentTCPRTT,
prometheus.GaugeValue,
utils.MilliSecToSec(d.CurrentTCPRTT),
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.CurrentUDPBandwidth,
c.currentUDPBandwidth,
prometheus.GaugeValue,
(d.CurrentUDPBandwidth*1000)/8,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.CurrentUDPRTT,
c.currentUDPRTT,
prometheus.GaugeValue,
utils.MilliSecToSec(d.CurrentUDPRTT),
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.TotalReceivedBytes,
c.totalReceivedBytes,
prometheus.CounterValue,
d.TotalReceivedBytes,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.TotalSentBytes,
c.totalSentBytes,
prometheus.CounterValue,
d.TotalSentBytes,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.UDPPacketsReceivedPersec,
c.udpPacketsReceivedPerSec,
prometheus.CounterValue,
d.UDPPacketsReceivedPersec,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.UDPPacketsSentPersec,
c.udpPacketsSentPerSec,
prometheus.CounterValue,
d.UDPPacketsSentPersec,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.FECRate,
c.fecRate,
prometheus.GaugeValue,
d.FECRate,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.LossRate,
c.lossRate,
prometheus.GaugeValue,
d.LossRate,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.RetransmissionRate,
c.retransmissionRate,
prometheus.GaugeValue,
d.RetransmissionRate,
normalizeSessionName(d.Name),
@@ -362,58 +362,58 @@ func (c *Collector) collectRemoteFXGraphicsCounters(ctx *types.ScrapeContext, ch
continue
}
ch <- prometheus.MustNewConstMetric(
c.AverageEncodingTime,
c.averageEncodingTime,
prometheus.GaugeValue,
utils.MilliSecToSec(d.AverageEncodingTime),
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.FrameQuality,
c.frameQuality,
prometheus.GaugeValue,
d.FrameQuality,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.FramesSkippedPerSecondInsufficientResources,
c.framesSkippedPerSecondInsufficientResources,
prometheus.CounterValue,
d.FramesSkippedPerSecondInsufficientClientResources,
normalizeSessionName(d.Name),
"client",
)
ch <- prometheus.MustNewConstMetric(
c.FramesSkippedPerSecondInsufficientResources,
c.framesSkippedPerSecondInsufficientResources,
prometheus.CounterValue,
d.FramesSkippedPerSecondInsufficientNetworkResources,
normalizeSessionName(d.Name),
"network",
)
ch <- prometheus.MustNewConstMetric(
c.FramesSkippedPerSecondInsufficientResources,
c.framesSkippedPerSecondInsufficientResources,
prometheus.CounterValue,
d.FramesSkippedPerSecondInsufficientServerResources,
normalizeSessionName(d.Name),
"server",
)
ch <- prometheus.MustNewConstMetric(
c.GraphicsCompressionratio,
c.graphicsCompressionRatio,
prometheus.GaugeValue,
d.GraphicsCompressionratio,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.InputFramesPerSecond,
c.inputFramesPerSecond,
prometheus.CounterValue,
d.InputFramesPerSecond,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.OutputFramesPerSecond,
c.outputFramesPerSecond,
prometheus.CounterValue,
d.OutputFramesPerSecond,
normalizeSessionName(d.Name),
)
ch <- prometheus.MustNewConstMetric(
c.SourceFramesPerSecond,
c.sourceFramesPerSecond,
prometheus.CounterValue,
d.SourceFramesPerSecond,
normalizeSessionName(d.Name),

View File

@@ -41,9 +41,9 @@ type Collector struct {
taskExclude *string
taskInclude *string
LastResult *prometheus.Desc
MissedRuns *prometheus.Desc
State *prometheus.Desc
lastResult *prometheus.Desc
missedRuns *prometheus.Desc
state *prometheus.Desc
taskIncludePattern *regexp.Regexp
taskExcludePattern *regexp.Regexp
@@ -122,21 +122,21 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.LastResult = prometheus.NewDesc(
c.lastResult = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "last_result"),
"The result that was returned the last time the registered task was run",
[]string{"task"},
nil,
)
c.MissedRuns = prometheus.NewDesc(
c.missedRuns = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "missed_runs"),
"The number of times the registered task missed a scheduled run",
[]string{"task"},
nil,
)
c.State = prometheus.NewDesc(
c.state = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "state"),
"The current state of a scheduled task",
[]string{"task", "state"},
@@ -187,14 +187,14 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.LastResult,
c.lastResult,
prometheus.GaugeValue,
lastResult,
task.Path,
)
ch <- prometheus.MustNewConstMetric(
c.MissedRuns,
c.missedRuns,
prometheus.GaugeValue,
task.MissedRunsCount,
task.Path,
@@ -208,7 +208,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.State,
c.state,
prometheus.GaugeValue,
stateValue,
task.Path,

View File

@@ -31,34 +31,33 @@ var ConfigDefaults = Config{
type Collector struct {
logger log.Logger
smbclientListAllCollectors *bool
smbclientCollectorsEnabled *string
ReadRequestQueueSecsTotal *prometheus.Desc
ReadBytesTotal *prometheus.Desc
ReadsTotal *prometheus.Desc
ReadBytesTransmittedViaSMBDirectTotal *prometheus.Desc
ReadRequestsTransmittedViaSMBDirectTotal *prometheus.Desc
TurboIOReadsTotal *prometheus.Desc
ReadSecsTotal *prometheus.Desc
WriteRequestQueueSecsTotal *prometheus.Desc
WriteBytesTotal *prometheus.Desc
WritesTotal *prometheus.Desc
WriteBytesTransmittedViaSMBDirectTotal *prometheus.Desc
WriteRequestsTransmittedViaSMBDirectTotal *prometheus.Desc
TurboIOWritesTotal *prometheus.Desc
WriteSecsTotal *prometheus.Desc
RequestQueueSecsTotal *prometheus.Desc
RequestSecs *prometheus.Desc
CreditStallsTotal *prometheus.Desc
CurrentDataQueued *prometheus.Desc
DataBytesTotal *prometheus.Desc
DataRequestsTotal *prometheus.Desc
MetadataRequestsTotal *prometheus.Desc
enabledCollectors []string
smbClientListAllCollectors *bool
smbClientCollectorsEnabled *string
readBytesTotal *prometheus.Desc
readBytesTransmittedViaSMBDirectTotal *prometheus.Desc
readRequestQueueSecsTotal *prometheus.Desc
readRequestsTransmittedViaSMBDirectTotal *prometheus.Desc
readSecsTotal *prometheus.Desc
readsTotal *prometheus.Desc
turboIOReadsTotal *prometheus.Desc
TurboIOWritesTotal *prometheus.Desc
writeBytesTotal *prometheus.Desc
writeBytesTransmittedViaSMBDirectTotal *prometheus.Desc
writeRequestQueueSecsTotal *prometheus.Desc
writeRequestsTransmittedViaSMBDirectTotal *prometheus.Desc
writeSecsTotal *prometheus.Desc
writesTotal *prometheus.Desc
creditStallsTotal *prometheus.Desc
currentDataQueued *prometheus.Desc
dataBytesTotal *prometheus.Desc
dataRequestsTotal *prometheus.Desc
metadataRequestsTotal *prometheus.Desc
requestQueueSecsTotal *prometheus.Desc
requestSecs *prometheus.Desc
}
// All available collector functions
@@ -73,8 +72,8 @@ func New(logger log.Logger, config *Config) *Collector {
smbclientListAllCollectors := false
c := &Collector{
smbclientCollectorsEnabled: &config.CollectorsEnabled,
smbclientListAllCollectors: &smbclientListAllCollectors,
smbClientCollectorsEnabled: &config.CollectorsEnabled,
smbClientListAllCollectors: &smbclientListAllCollectors,
}
c.SetLogger(logger)
@@ -83,12 +82,12 @@ func New(logger log.Logger, config *Config) *Collector {
func NewWithFlags(app *kingpin.Application) *Collector {
return &Collector{
smbclientListAllCollectors: app.Flag(
smbClientListAllCollectors: app.Flag(
"collectors.smbclient.list",
"List the collectors along with their perflib object name/ids",
).Bool(),
smbclientCollectorsEnabled: app.Flag(
smbClientCollectorsEnabled: app.Flag(
"collectors.smbclient.enabled",
"Comma-separated list of collectors to use. Defaults to all, if not specified.",
).Default(ConfigDefaults.CollectorsEnabled).String(),
@@ -124,59 +123,59 @@ func (c *Collector) Build() error {
)
}
c.RequestQueueSecsTotal = desc("data_queue_seconds_total",
c.requestQueueSecsTotal = desc("data_queue_seconds_total",
"Seconds requests waited on queue on this share",
[]string{"server", "share"},
)
c.ReadRequestQueueSecsTotal = desc("read_queue_seconds_total",
c.readRequestQueueSecsTotal = desc("read_queue_seconds_total",
"Seconds read requests waited on queue on this share",
[]string{"server", "share"},
)
c.WriteRequestQueueSecsTotal = desc("write_queue_seconds_total",
c.writeRequestQueueSecsTotal = desc("write_queue_seconds_total",
"Seconds write requests waited on queue on this share",
[]string{"server", "share"},
)
c.RequestSecs = desc("request_seconds_total",
c.requestSecs = desc("request_seconds_total",
"Seconds waiting for requests on this share",
[]string{"server", "share"},
)
c.CreditStallsTotal = desc("stalls_total",
c.creditStallsTotal = desc("stalls_total",
"The number of requests delayed based on insufficient credits on this share",
[]string{"server", "share"},
)
c.CurrentDataQueued = desc("requests_queued",
c.currentDataQueued = desc("requests_queued",
"The point in time number of requests outstanding on this share",
[]string{"server", "share"},
)
c.DataBytesTotal = desc("data_bytes_total",
c.dataBytesTotal = desc("data_bytes_total",
"The bytes read or written on this share",
[]string{"server", "share"},
)
c.DataRequestsTotal = desc("requests_total",
c.dataRequestsTotal = desc("requests_total",
"The requests on this share",
[]string{"server", "share"},
)
c.MetadataRequestsTotal = desc("metadata_requests_total",
c.metadataRequestsTotal = desc("metadata_requests_total",
"The metadata requests on this share",
[]string{"server", "share"},
)
c.ReadBytesTransmittedViaSMBDirectTotal = desc("read_bytes_via_smbdirect_total",
c.readBytesTransmittedViaSMBDirectTotal = desc("read_bytes_via_smbdirect_total",
"The bytes read from this share via RDMA direct placement",
[]string{"server", "share"},
)
c.ReadBytesTotal = desc("read_bytes_total",
c.readBytesTotal = desc("read_bytes_total",
"The bytes read on this share",
[]string{"server", "share"},
)
c.ReadRequestsTransmittedViaSMBDirectTotal = desc("read_requests_via_smbdirect_total",
c.readRequestsTransmittedViaSMBDirectTotal = desc("read_requests_via_smbdirect_total",
"The read requests on this share via RDMA direct placement",
[]string{"server", "share"},
)
c.ReadsTotal = desc("read_requests_total",
c.readsTotal = desc("read_requests_total",
"The read requests on this share",
[]string{"server", "share"},
)
c.TurboIOReadsTotal = desc("turbo_io_reads_total",
c.turboIOReadsTotal = desc("turbo_io_reads_total",
"The read requests that go through Turbo I/O",
[]string{"server", "share"},
)
@@ -184,27 +183,27 @@ func (c *Collector) Build() error {
"The write requests that go through Turbo I/O",
[]string{"server", "share"},
)
c.WriteBytesTransmittedViaSMBDirectTotal = desc("write_bytes_via_smbdirect_total",
c.writeBytesTransmittedViaSMBDirectTotal = desc("write_bytes_via_smbdirect_total",
"The written bytes to this share via RDMA direct placement",
[]string{"server", "share"},
)
c.WriteBytesTotal = desc("write_bytes_total",
c.writeBytesTotal = desc("write_bytes_total",
"The bytes written on this share",
[]string{"server", "share"},
)
c.WriteRequestsTransmittedViaSMBDirectTotal = desc("write_requests_via_smbdirect_total",
c.writeRequestsTransmittedViaSMBDirectTotal = desc("write_requests_via_smbdirect_total",
"The write requests to this share via RDMA direct placement",
[]string{"server", "share"},
)
c.WritesTotal = desc("write_requests_total",
c.writesTotal = desc("write_requests_total",
"The write requests on this share",
[]string{"server", "share"},
)
c.ReadSecsTotal = desc("read_seconds_total",
c.readSecsTotal = desc("read_seconds_total",
"Seconds waiting for read requests on this share",
[]string{"server", "share"},
)
c.WriteSecsTotal = desc("write_seconds_total",
c.writeSecsTotal = desc("write_seconds_total",
"Seconds waiting for write requests on this share",
[]string{"server", "share"},
)
@@ -215,7 +214,7 @@ func (c *Collector) Build() error {
"ClientShares": "SMB Client Shares",
}
if *c.smbclientListAllCollectors {
if *c.smbClientListAllCollectors {
fmt.Printf("%-32s %-32s\n", "Collector Name", "Perflib Object") //nolint:forbidigo
for _, cname := range smbclientAllCollectorNames {
fmt.Printf("%-32s %-32s\n", cname, collectorDesc[cname]) //nolint:forbidigo
@@ -224,12 +223,12 @@ func (c *Collector) Build() error {
os.Exit(0)
}
if *c.smbclientCollectorsEnabled == "" {
if *c.smbClientCollectorsEnabled == "" {
for _, collectorName := range smbclientAllCollectorNames {
c.enabledCollectors = append(c.enabledCollectors, collectorName)
}
} else {
for _, collectorName := range strings.Split(*c.smbclientCollectorsEnabled, ",") {
for _, collectorName := range strings.Split(*c.smbClientCollectorsEnabled, ",") {
if slices.Contains(smbclientAllCollectorNames, collectorName) {
c.enabledCollectors = append(c.enabledCollectors, collectorName)
} else {
@@ -298,7 +297,7 @@ func (c *Collector) collectClientShares(ctx *types.ScrapeContext, ch chan<- prom
shareValue := parsed[1]
// Request time spent on queue. Convert from ticks to seconds.
ch <- prometheus.MustNewConstMetric(
c.RequestQueueSecsTotal,
c.requestQueueSecsTotal,
prometheus.CounterValue,
instance.AvgDataQueueLength*perflib.TicksToSecondScaleFactor,
serverValue, shareValue,
@@ -306,28 +305,28 @@ func (c *Collector) collectClientShares(ctx *types.ScrapeContext, ch chan<- prom
// Read time spent on queue. Convert from ticks to seconds.
ch <- prometheus.MustNewConstMetric(
c.ReadRequestQueueSecsTotal,
c.readRequestQueueSecsTotal,
prometheus.CounterValue,
instance.AvgReadQueueLength*perflib.TicksToSecondScaleFactor,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.ReadSecsTotal,
c.readSecsTotal,
prometheus.CounterValue,
instance.AvgSecPerRead*perflib.TicksToSecondScaleFactor,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.WriteSecsTotal,
c.writeSecsTotal,
prometheus.CounterValue,
instance.AvgSecPerWrite*perflib.TicksToSecondScaleFactor,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.RequestSecs,
c.requestSecs,
prometheus.CounterValue,
instance.AvgSecPerDataRequest*perflib.TicksToSecondScaleFactor,
serverValue, shareValue,
@@ -335,77 +334,77 @@ func (c *Collector) collectClientShares(ctx *types.ScrapeContext, ch chan<- prom
// Write time spent on queue. Convert from ticks to seconds.
ch <- prometheus.MustNewConstMetric(
c.WriteRequestQueueSecsTotal,
c.writeRequestQueueSecsTotal,
prometheus.CounterValue,
instance.AvgWriteQueueLength*perflib.TicksToSecondScaleFactor,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.CreditStallsTotal,
c.creditStallsTotal,
prometheus.CounterValue,
instance.CreditStallsPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.CurrentDataQueued,
c.currentDataQueued,
prometheus.GaugeValue,
instance.CurrentDataQueueLength,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.DataBytesTotal,
c.dataBytesTotal,
prometheus.CounterValue,
instance.DataBytesPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.DataRequestsTotal,
c.dataRequestsTotal,
prometheus.CounterValue,
instance.DataRequestsPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.MetadataRequestsTotal,
c.metadataRequestsTotal,
prometheus.CounterValue,
instance.MetadataRequestsPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.ReadBytesTransmittedViaSMBDirectTotal,
c.readBytesTransmittedViaSMBDirectTotal,
prometheus.CounterValue,
instance.ReadBytesTransmittedViaSMBDirectPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.ReadBytesTotal,
c.readBytesTotal,
prometheus.CounterValue,
instance.ReadBytesPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.ReadRequestsTransmittedViaSMBDirectTotal,
c.readRequestsTransmittedViaSMBDirectTotal,
prometheus.CounterValue,
instance.ReadRequestsTransmittedViaSMBDirectPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.ReadsTotal,
c.readsTotal,
prometheus.CounterValue,
instance.ReadRequestsPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.TurboIOReadsTotal,
c.turboIOReadsTotal,
prometheus.CounterValue,
instance.TurboIOReadsPerSec,
serverValue, shareValue,
@@ -419,28 +418,28 @@ func (c *Collector) collectClientShares(ctx *types.ScrapeContext, ch chan<- prom
)
ch <- prometheus.MustNewConstMetric(
c.WriteBytesTransmittedViaSMBDirectTotal,
c.writeBytesTransmittedViaSMBDirectTotal,
prometheus.CounterValue,
instance.WriteBytesTransmittedViaSMBDirectPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.WriteBytesTotal,
c.writeBytesTotal,
prometheus.CounterValue,
instance.WriteBytesPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.WriteRequestsTransmittedViaSMBDirectTotal,
c.writeRequestsTransmittedViaSMBDirectTotal,
prometheus.CounterValue,
instance.WriteRequestsTransmittedViaSMBDirectPerSec,
serverValue, shareValue,
)
ch <- prometheus.MustNewConstMetric(
c.WritesTotal,
c.writesTotal,
prometheus.CounterValue,
instance.WriteRequestsPerSec,
serverValue, shareValue,

View File

@@ -29,54 +29,53 @@ var ConfigDefaults = Config{
type Collector struct {
logger log.Logger
serverInclude *string
serverExclude *string
BadmailedMessagesBadPickupFileTotal *prometheus.Desc
BadmailedMessagesGeneralFailureTotal *prometheus.Desc
BadmailedMessagesHopCountExceededTotal *prometheus.Desc
BadmailedMessagesNDROfDSNTotal *prometheus.Desc
BadmailedMessagesNoRecipientsTotal *prometheus.Desc
BadmailedMessagesTriggeredViaEventTotal *prometheus.Desc
BytesSentTotal *prometheus.Desc
BytesReceivedTotal *prometheus.Desc
CategorizerQueueLength *prometheus.Desc
ConnectionErrorsTotal *prometheus.Desc
CurrentMessagesInLocalDelivery *prometheus.Desc
DirectoryDropsTotal *prometheus.Desc
DNSQueriesTotal *prometheus.Desc
DSNFailuresTotal *prometheus.Desc
ETRNMessagesTotal *prometheus.Desc
InboundConnectionsCurrent *prometheus.Desc
InboundConnectionsTotal *prometheus.Desc
LocalQueueLength *prometheus.Desc
LocalRetryQueueLength *prometheus.Desc
MailFilesOpen *prometheus.Desc
MessageBytesReceivedTotal *prometheus.Desc
MessageBytesSentTotal *prometheus.Desc
MessageDeliveryRetriesTotal *prometheus.Desc
MessageSendRetriesTotal *prometheus.Desc
MessagesCurrentlyUndeliverable *prometheus.Desc
MessagesDeliveredTotal *prometheus.Desc
MessagesPendingRouting *prometheus.Desc
MessagesReceivedTotal *prometheus.Desc
MessagesRefusedForAddressObjectsTotal *prometheus.Desc
MessagesRefusedForMailObjectsTotal *prometheus.Desc
MessagesRefusedForSizeTotal *prometheus.Desc
MessagesSentTotal *prometheus.Desc
MessagesSubmittedTotal *prometheus.Desc
NDRsGeneratedTotal *prometheus.Desc
OutboundConnectionsCurrent *prometheus.Desc
OutboundConnectionsRefusedTotal *prometheus.Desc
OutboundConnectionsTotal *prometheus.Desc
QueueFilesOpen *prometheus.Desc
PickupDirectoryMessagesRetrievedTotal *prometheus.Desc
RemoteQueueLength *prometheus.Desc
RemoteRetryQueueLength *prometheus.Desc
RoutingTableLookupsTotal *prometheus.Desc
serverInclude *string
serverExclude *string
serverIncludePattern *regexp.Regexp
serverExcludePattern *regexp.Regexp
badMailedMessagesBadPickupFileTotal *prometheus.Desc
badMailedMessagesGeneralFailureTotal *prometheus.Desc
badMailedMessagesHopCountExceededTotal *prometheus.Desc
badMailedMessagesNDROfDSNTotal *prometheus.Desc
badMailedMessagesNoRecipientsTotal *prometheus.Desc
badMailedMessagesTriggeredViaEventTotal *prometheus.Desc
bytesReceivedTotal *prometheus.Desc
bytesSentTotal *prometheus.Desc
categorizerQueueLength *prometheus.Desc
connectionErrorsTotal *prometheus.Desc
currentMessagesInLocalDelivery *prometheus.Desc
dnsQueriesTotal *prometheus.Desc
dsnFailuresTotal *prometheus.Desc
directoryDropsTotal *prometheus.Desc
etrnMessagesTotal *prometheus.Desc
inboundConnectionsCurrent *prometheus.Desc
inboundConnectionsTotal *prometheus.Desc
localQueueLength *prometheus.Desc
localRetryQueueLength *prometheus.Desc
mailFilesOpen *prometheus.Desc
messageBytesReceivedTotal *prometheus.Desc
messageBytesSentTotal *prometheus.Desc
messageDeliveryRetriesTotal *prometheus.Desc
messageSendRetriesTotal *prometheus.Desc
messagesCurrentlyUndeliverable *prometheus.Desc
messagesDeliveredTotal *prometheus.Desc
messagesPendingRouting *prometheus.Desc
messagesReceivedTotal *prometheus.Desc
messagesRefusedForAddressObjectsTotal *prometheus.Desc
messagesRefusedForMailObjectsTotal *prometheus.Desc
messagesRefusedForSizeTotal *prometheus.Desc
messagesSentTotal *prometheus.Desc
messagesSubmittedTotal *prometheus.Desc
ndrsGeneratedTotal *prometheus.Desc
outboundConnectionsCurrent *prometheus.Desc
outboundConnectionsRefusedTotal *prometheus.Desc
outboundConnectionsTotal *prometheus.Desc
pickupDirectoryMessagesRetrievedTotal *prometheus.Desc
queueFilesOpen *prometheus.Desc
remoteQueueLength *prometheus.Desc
remoteRetryQueueLength *prometheus.Desc
routingTableLookupsTotal *prometheus.Desc
}
func New(logger log.Logger, config *Config) *Collector {
@@ -128,253 +127,253 @@ func (c *Collector) Close() error {
func (c *Collector) Build() error {
_ = level.Info(c.logger).Log("msg", "smtp collector is in an experimental state! Metrics for this collector have not been tested.")
c.BadmailedMessagesBadPickupFileTotal = prometheus.NewDesc(
c.badMailedMessagesBadPickupFileTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "badmailed_messages_bad_pickup_file_total"),
"Total number of malformed pickup messages sent to badmail",
[]string{"site"},
nil,
)
c.BadmailedMessagesGeneralFailureTotal = prometheus.NewDesc(
c.badMailedMessagesGeneralFailureTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "badmailed_messages_general_failure_total"),
"Total number of messages sent to badmail for reasons not associated with a specific counter",
[]string{"site"},
nil,
)
c.BadmailedMessagesHopCountExceededTotal = prometheus.NewDesc(
c.badMailedMessagesHopCountExceededTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "badmailed_messages_hop_count_exceeded_total"),
"Total number of messages sent to badmail because they had exceeded the maximum hop count",
[]string{"site"},
nil,
)
c.BadmailedMessagesNDROfDSNTotal = prometheus.NewDesc(
c.badMailedMessagesNDROfDSNTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "badmailed_messages_ndr_of_dns_total"),
"Total number of Delivery Status Notifications sent to badmail because they could not be delivered",
[]string{"site"},
nil,
)
c.BadmailedMessagesNoRecipientsTotal = prometheus.NewDesc(
c.badMailedMessagesNoRecipientsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "badmailed_messages_no_recipients_total"),
"Total number of messages sent to badmail because they had no recipients",
[]string{"site"},
nil,
)
c.BadmailedMessagesTriggeredViaEventTotal = prometheus.NewDesc(
c.badMailedMessagesTriggeredViaEventTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "badmailed_messages_triggered_via_event_total"),
"Total number of messages sent to badmail at the request of a server event sink",
[]string{"site"},
nil,
)
c.BytesSentTotal = prometheus.NewDesc(
c.bytesSentTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bytes_sent_total"),
"Total number of bytes sent",
[]string{"site"},
nil,
)
c.BytesReceivedTotal = prometheus.NewDesc(
c.bytesReceivedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bytes_received_total"),
"Total number of bytes received",
[]string{"site"},
nil,
)
c.CategorizerQueueLength = prometheus.NewDesc(
c.categorizerQueueLength = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "categorizer_queue_length"),
"Number of messages in the categorizer queue",
[]string{"site"},
nil,
)
c.ConnectionErrorsTotal = prometheus.NewDesc(
c.connectionErrorsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "connection_errors_total"),
"Total number of connection errors",
[]string{"site"},
nil,
)
c.CurrentMessagesInLocalDelivery = prometheus.NewDesc(
c.currentMessagesInLocalDelivery = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_messages_in_local_delivery"),
"Number of messages that are currently being processed by a server event sink for local delivery",
[]string{"site"},
nil,
)
c.DirectoryDropsTotal = prometheus.NewDesc(
c.directoryDropsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "directory_drops_total"),
"Total number of messages placed in a drop directory",
[]string{"site"},
nil,
)
c.DSNFailuresTotal = prometheus.NewDesc(
c.dsnFailuresTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dsn_failures_total"),
"Total number of failed DSN generation attempts",
[]string{"site"},
nil,
)
c.DNSQueriesTotal = prometheus.NewDesc(
c.dnsQueriesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dns_queries_total"),
"Total number of DNS lookups",
[]string{"site"},
nil,
)
c.ETRNMessagesTotal = prometheus.NewDesc(
c.etrnMessagesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "etrn_messages_total"),
"Total number of ETRN messages received by the server",
[]string{"site"},
nil,
)
c.InboundConnectionsCurrent = prometheus.NewDesc(
c.inboundConnectionsCurrent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "inbound_connections_current"),
"Total number of connections currently inbound",
[]string{"site"},
nil,
)
c.InboundConnectionsTotal = prometheus.NewDesc(
c.inboundConnectionsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "inbound_connections_total"),
"Total number of inbound connections received",
[]string{"site"},
nil,
)
c.LocalQueueLength = prometheus.NewDesc(
c.localQueueLength = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "local_queue_length"),
"Number of messages in the local queue",
[]string{"site"},
nil,
)
c.LocalRetryQueueLength = prometheus.NewDesc(
c.localRetryQueueLength = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "local_retry_queue_length"),
"Number of messages in the local retry queue",
[]string{"site"},
nil,
)
c.MailFilesOpen = prometheus.NewDesc(
c.mailFilesOpen = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mail_files_open"),
"Number of handles to open mail files",
[]string{"site"},
nil,
)
c.MessageBytesReceivedTotal = prometheus.NewDesc(
c.messageBytesReceivedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "message_bytes_received_total"),
"Total number of bytes received in messages",
[]string{"site"},
nil,
)
c.MessageBytesSentTotal = prometheus.NewDesc(
c.messageBytesSentTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "message_bytes_sent_total"),
"Total number of bytes sent in messages",
[]string{"site"},
nil,
)
c.MessageDeliveryRetriesTotal = prometheus.NewDesc(
c.messageDeliveryRetriesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "message_delivery_retries_total"),
"Total number of local deliveries that were retried",
[]string{"site"},
nil,
)
c.MessageSendRetriesTotal = prometheus.NewDesc(
c.messageSendRetriesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "message_send_retries_total"),
"Total number of outbound message sends that were retried",
[]string{"site"},
nil,
)
c.MessagesCurrentlyUndeliverable = prometheus.NewDesc(
c.messagesCurrentlyUndeliverable = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_currently_undeliverable"),
"Number of messages that have been reported as currently undeliverable by routing",
[]string{"site"},
nil,
)
c.MessagesDeliveredTotal = prometheus.NewDesc(
c.messagesDeliveredTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_delivered_total"),
"Total number of messages delivered to local mailboxes",
[]string{"site"},
nil,
)
c.MessagesPendingRouting = prometheus.NewDesc(
c.messagesPendingRouting = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_pending_routing"),
"Number of messages that have been categorized but not routed",
[]string{"site"},
nil,
)
c.MessagesReceivedTotal = prometheus.NewDesc(
c.messagesReceivedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_received_total"),
"Total number of inbound messages accepted",
[]string{"site"},
nil,
)
c.MessagesRefusedForAddressObjectsTotal = prometheus.NewDesc(
c.messagesRefusedForAddressObjectsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_refused_for_address_objects_total"),
"Total number of messages refused due to no address objects",
[]string{"site"},
nil,
)
c.MessagesRefusedForMailObjectsTotal = prometheus.NewDesc(
c.messagesRefusedForMailObjectsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_refused_for_mail_objects_total"),
"Total number of messages refused due to no mail objects",
[]string{"site"},
nil,
)
c.MessagesRefusedForSizeTotal = prometheus.NewDesc(
c.messagesRefusedForSizeTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_refused_for_size_total"),
"Total number of messages rejected because they were too big",
[]string{"site"},
nil,
)
c.MessagesSentTotal = prometheus.NewDesc(
c.messagesSentTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_sent_total"),
"Total number of outbound messages sent",
[]string{"site"},
nil,
)
c.MessagesSubmittedTotal = prometheus.NewDesc(
c.messagesSubmittedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "messages_submitted_total"),
"Total number of messages submitted to queuing for delivery",
[]string{"site"},
nil,
)
c.NDRsGeneratedTotal = prometheus.NewDesc(
c.ndrsGeneratedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "ndrs_generated_total"),
"Total number of non-delivery reports that have been generated",
[]string{"site"},
nil,
)
c.OutboundConnectionsCurrent = prometheus.NewDesc(
c.outboundConnectionsCurrent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "outbound_connections_current"),
"Number of connections currently outbound",
[]string{"site"},
nil,
)
c.OutboundConnectionsRefusedTotal = prometheus.NewDesc(
c.outboundConnectionsRefusedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "outbound_connections_refused_total"),
"Total number of connection attempts refused by remote sites",
[]string{"site"},
nil,
)
c.OutboundConnectionsTotal = prometheus.NewDesc(
c.outboundConnectionsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "outbound_connections_total"),
"Total number of outbound connections attempted",
[]string{"site"},
nil,
)
c.PickupDirectoryMessagesRetrievedTotal = prometheus.NewDesc(
c.pickupDirectoryMessagesRetrievedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "pickup_directory_messages_retrieved_total"),
"Total number of messages retrieved from the mail pick-up directory",
[]string{"site"},
nil,
)
c.QueueFilesOpen = prometheus.NewDesc(
c.queueFilesOpen = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "queue_files_open"),
"Number of handles to open queue files",
[]string{"site"},
nil,
)
c.RemoteQueueLength = prometheus.NewDesc(
c.remoteQueueLength = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "remote_queue_length"),
"Number of messages in the remote queue",
[]string{"site"},
nil,
)
c.RemoteRetryQueueLength = prometheus.NewDesc(
c.remoteRetryQueueLength = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "remote_retry_queue_length"),
"Number of messages in the retry queue for remote delivery",
[]string{"site"},
nil,
)
c.RoutingTableLookupsTotal = prometheus.NewDesc(
c.routingTableLookupsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "routing_table_lookups_total"),
"Total number of routing table lookups",
[]string{"site"},
@@ -468,287 +467,287 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
}
ch <- prometheus.MustNewConstMetric(
c.BadmailedMessagesBadPickupFileTotal,
c.badMailedMessagesBadPickupFileTotal,
prometheus.CounterValue,
server.BadmailedMessagesBadPickupFileTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.BadmailedMessagesHopCountExceededTotal,
c.badMailedMessagesHopCountExceededTotal,
prometheus.CounterValue,
server.BadmailedMessagesHopCountExceededTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.BadmailedMessagesNDROfDSNTotal,
c.badMailedMessagesNDROfDSNTotal,
prometheus.CounterValue,
server.BadmailedMessagesNDROfDSNTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.BadmailedMessagesNoRecipientsTotal,
c.badMailedMessagesNoRecipientsTotal,
prometheus.CounterValue,
server.BadmailedMessagesNoRecipientsTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.BadmailedMessagesTriggeredViaEventTotal,
c.badMailedMessagesTriggeredViaEventTotal,
prometheus.CounterValue,
server.BadmailedMessagesTriggeredViaEventTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.BytesSentTotal,
c.bytesSentTotal,
prometheus.CounterValue,
server.BytesSentTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.BytesReceivedTotal,
c.bytesReceivedTotal,
prometheus.CounterValue,
server.BytesReceivedTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.CategorizerQueueLength,
c.categorizerQueueLength,
prometheus.GaugeValue,
server.CategorizerQueueLength,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionErrorsTotal,
c.connectionErrorsTotal,
prometheus.CounterValue,
server.ConnectionErrorsTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.CurrentMessagesInLocalDelivery,
c.currentMessagesInLocalDelivery,
prometheus.GaugeValue,
server.CurrentMessagesInLocalDelivery,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.DirectoryDropsTotal,
c.directoryDropsTotal,
prometheus.CounterValue,
server.DirectoryDropsTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.DSNFailuresTotal,
c.dsnFailuresTotal,
prometheus.CounterValue,
server.DSNFailuresTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.DNSQueriesTotal,
c.dnsQueriesTotal,
prometheus.CounterValue,
server.DNSQueriesTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ETRNMessagesTotal,
c.etrnMessagesTotal,
prometheus.CounterValue,
server.ETRNMessagesTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.InboundConnectionsTotal,
c.inboundConnectionsTotal,
prometheus.CounterValue,
server.InboundConnectionsTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.InboundConnectionsCurrent,
c.inboundConnectionsCurrent,
prometheus.GaugeValue,
server.InboundConnectionsCurrent,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.LocalQueueLength,
c.localQueueLength,
prometheus.GaugeValue,
server.LocalQueueLength,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.LocalRetryQueueLength,
c.localRetryQueueLength,
prometheus.GaugeValue,
server.LocalRetryQueueLength,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MailFilesOpen,
c.mailFilesOpen,
prometheus.GaugeValue,
server.MailFilesOpen,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessageBytesReceivedTotal,
c.messageBytesReceivedTotal,
prometheus.CounterValue,
server.MessageBytesReceivedTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessageBytesSentTotal,
c.messageBytesSentTotal,
prometheus.CounterValue,
server.MessageBytesSentTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessageDeliveryRetriesTotal,
c.messageDeliveryRetriesTotal,
prometheus.CounterValue,
server.MessageDeliveryRetriesTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessageSendRetriesTotal,
c.messageSendRetriesTotal,
prometheus.CounterValue,
server.MessageSendRetriesTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesCurrentlyUndeliverable,
c.messagesCurrentlyUndeliverable,
prometheus.GaugeValue,
server.MessagesCurrentlyUndeliverable,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesDeliveredTotal,
c.messagesDeliveredTotal,
prometheus.CounterValue,
server.MessagesDeliveredTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesPendingRouting,
c.messagesPendingRouting,
prometheus.GaugeValue,
server.MessagesPendingRouting,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesReceivedTotal,
c.messagesReceivedTotal,
prometheus.CounterValue,
server.MessagesReceivedTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesRefusedForAddressObjectsTotal,
c.messagesRefusedForAddressObjectsTotal,
prometheus.CounterValue,
server.MessagesRefusedForAddressObjectsTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesRefusedForMailObjectsTotal,
c.messagesRefusedForMailObjectsTotal,
prometheus.CounterValue,
server.MessagesRefusedForMailObjectsTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesRefusedForSizeTotal,
c.messagesRefusedForSizeTotal,
prometheus.CounterValue,
server.MessagesRefusedForSizeTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesSentTotal,
c.messagesSentTotal,
prometheus.CounterValue,
server.MessagesSentTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.MessagesSubmittedTotal,
c.messagesSubmittedTotal,
prometheus.CounterValue,
server.MessagesSubmittedTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NDRsGeneratedTotal,
c.ndrsGeneratedTotal,
prometheus.CounterValue,
server.NDRsGeneratedTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.OutboundConnectionsCurrent,
c.outboundConnectionsCurrent,
prometheus.GaugeValue,
server.OutboundConnectionsCurrent,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.OutboundConnectionsRefusedTotal,
c.outboundConnectionsRefusedTotal,
prometheus.CounterValue,
server.OutboundConnectionsRefusedTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.OutboundConnectionsTotal,
c.outboundConnectionsTotal,
prometheus.CounterValue,
server.OutboundConnectionsTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.QueueFilesOpen,
c.queueFilesOpen,
prometheus.GaugeValue,
server.QueueFilesOpen,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.PickupDirectoryMessagesRetrievedTotal,
c.pickupDirectoryMessagesRetrievedTotal,
prometheus.CounterValue,
server.PickupDirectoryMessagesRetrievedTotal,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.RemoteQueueLength,
c.remoteQueueLength,
prometheus.GaugeValue,
server.RemoteQueueLength,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.RemoteRetryQueueLength,
c.remoteRetryQueueLength,
prometheus.GaugeValue,
server.RemoteRetryQueueLength,
server.Name,
)
ch <- prometheus.MustNewConstMetric(
c.RoutingTableLookupsTotal,
c.routingTableLookupsTotal,
prometheus.CounterValue,
server.RoutingTableLookupsTotal,
server.Name,

View File

@@ -21,12 +21,12 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
ContextSwitchesTotal *prometheus.Desc
ExceptionDispatchesTotal *prometheus.Desc
ProcessorQueueLength *prometheus.Desc
SystemCallsTotal *prometheus.Desc
SystemUpTime *prometheus.Desc
Threads *prometheus.Desc
contextSwitchesTotal *prometheus.Desc
exceptionDispatchesTotal *prometheus.Desc
processorQueueLength *prometheus.Desc
systemCallsTotal *prometheus.Desc
systemUpTime *prometheus.Desc
threads *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -57,37 +57,37 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.ContextSwitchesTotal = prometheus.NewDesc(
c.contextSwitchesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "context_switches_total"),
"Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec)",
nil,
nil,
)
c.ExceptionDispatchesTotal = prometheus.NewDesc(
c.exceptionDispatchesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "exception_dispatches_total"),
"Total number of exceptions dispatched (WMI source: PerfOS_System.ExceptionDispatchesPersec)",
nil,
nil,
)
c.ProcessorQueueLength = prometheus.NewDesc(
c.processorQueueLength = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "processor_queue_length"),
"Length of processor queue (WMI source: PerfOS_System.ProcessorQueueLength)",
nil,
nil,
)
c.SystemCallsTotal = prometheus.NewDesc(
c.systemCallsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "system_calls_total"),
"Total number of system calls (WMI source: PerfOS_System.SystemCallsPersec)",
nil,
nil,
)
c.SystemUpTime = prometheus.NewDesc(
c.systemUpTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "system_up_time"),
"System boot time (WMI source: PerfOS_System.SystemUpTime)",
nil,
nil,
)
c.Threads = prometheus.NewDesc(
c.threads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "threads"),
"Current number of threads (WMI source: PerfOS_System.Threads)",
nil,
@@ -124,32 +124,32 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
}
ch <- prometheus.MustNewConstMetric(
c.ContextSwitchesTotal,
c.contextSwitchesTotal,
prometheus.CounterValue,
dst[0].ContextSwitchesPersec,
)
ch <- prometheus.MustNewConstMetric(
c.ExceptionDispatchesTotal,
c.exceptionDispatchesTotal,
prometheus.CounterValue,
dst[0].ExceptionDispatchesPersec,
)
ch <- prometheus.MustNewConstMetric(
c.ProcessorQueueLength,
c.processorQueueLength,
prometheus.GaugeValue,
dst[0].ProcessorQueueLength,
)
ch <- prometheus.MustNewConstMetric(
c.SystemCallsTotal,
c.systemCallsTotal,
prometheus.CounterValue,
dst[0].SystemCallsPersec,
)
ch <- prometheus.MustNewConstMetric(
c.SystemUpTime,
c.systemUpTime,
prometheus.GaugeValue,
dst[0].SystemUpTime,
)
ch <- prometheus.MustNewConstMetric(
c.Threads,
c.threads,
prometheus.GaugeValue,
dst[0].Threads,
)

View File

@@ -21,15 +21,15 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
ConnectionFailures *prometheus.Desc
ConnectionsActive *prometheus.Desc
ConnectionsEstablished *prometheus.Desc
ConnectionsPassive *prometheus.Desc
ConnectionsReset *prometheus.Desc
SegmentsTotal *prometheus.Desc
SegmentsReceivedTotal *prometheus.Desc
SegmentsRetransmittedTotal *prometheus.Desc
SegmentsSentTotal *prometheus.Desc
connectionFailures *prometheus.Desc
connectionsActive *prometheus.Desc
connectionsEstablished *prometheus.Desc
connectionsPassive *prometheus.Desc
connectionsReset *prometheus.Desc
segmentsTotal *prometheus.Desc
segmentsReceivedTotal *prometheus.Desc
segmentsRetransmittedTotal *prometheus.Desc
segmentsSentTotal *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -60,55 +60,55 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.ConnectionFailures = prometheus.NewDesc(
c.connectionFailures = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "connection_failures_total"),
"(TCP.ConnectionFailures)",
[]string{"af"},
nil,
)
c.ConnectionsActive = prometheus.NewDesc(
c.connectionsActive = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "connections_active_total"),
"(TCP.ConnectionsActive)",
[]string{"af"},
nil,
)
c.ConnectionsEstablished = prometheus.NewDesc(
c.connectionsEstablished = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "connections_established"),
"(TCP.ConnectionsEstablished)",
[]string{"af"},
nil,
)
c.ConnectionsPassive = prometheus.NewDesc(
c.connectionsPassive = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "connections_passive_total"),
"(TCP.ConnectionsPassive)",
[]string{"af"},
nil,
)
c.ConnectionsReset = prometheus.NewDesc(
c.connectionsReset = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "connections_reset_total"),
"(TCP.ConnectionsReset)",
[]string{"af"},
nil,
)
c.SegmentsTotal = prometheus.NewDesc(
c.segmentsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "segments_total"),
"(TCP.SegmentsTotal)",
[]string{"af"},
nil,
)
c.SegmentsReceivedTotal = prometheus.NewDesc(
c.segmentsReceivedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "segments_received_total"),
"(TCP.SegmentsReceivedTotal)",
[]string{"af"},
nil,
)
c.SegmentsRetransmittedTotal = prometheus.NewDesc(
c.segmentsRetransmittedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "segments_retransmitted_total"),
"(TCP.SegmentsRetransmittedTotal)",
[]string{"af"},
nil,
)
c.SegmentsSentTotal = prometheus.NewDesc(
c.segmentsSentTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "segments_sent_total"),
"(TCP.SegmentsSentTotal)",
[]string{"af"},
@@ -144,55 +144,55 @@ type tcp struct {
func writeTCPCounters(metrics tcp, labels []string, c *Collector, ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(
c.ConnectionFailures,
c.connectionFailures,
prometheus.CounterValue,
metrics.ConnectionFailures,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionsActive,
c.connectionsActive,
prometheus.CounterValue,
metrics.ConnectionsActive,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionsEstablished,
c.connectionsEstablished,
prometheus.GaugeValue,
metrics.ConnectionsEstablished,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionsPassive,
c.connectionsPassive,
prometheus.CounterValue,
metrics.ConnectionsPassive,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionsReset,
c.connectionsReset,
prometheus.CounterValue,
metrics.ConnectionsReset,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.SegmentsTotal,
c.segmentsTotal,
prometheus.CounterValue,
metrics.SegmentsPersec,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.SegmentsReceivedTotal,
c.segmentsReceivedTotal,
prometheus.CounterValue,
metrics.SegmentsReceivedPersec,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.SegmentsRetransmittedTotal,
c.segmentsRetransmittedTotal,
prometheus.CounterValue,
metrics.SegmentsRetransmittedPersec,
labels...,
)
ch <- prometheus.MustNewConstMetric(
c.SegmentsSentTotal,
c.segmentsSentTotal,
prometheus.CounterValue,
metrics.SegmentsSentPersec,
labels...,

View File

@@ -28,47 +28,47 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
AudioBytesReceived *prometheus.Desc
AudioBytesSent *prometheus.Desc
AudioRXBWkbitPersec *prometheus.Desc
AudioTXBWkbitPersec *prometheus.Desc
AudioTXBWLimitkbitPersec *prometheus.Desc
audioBytesReceived *prometheus.Desc
audioBytesSent *prometheus.Desc
audioRXBWKBitPerSec *prometheus.Desc
audioTXBWKBitPerSec *prometheus.Desc
audioTXBWLimitKBitPerSec *prometheus.Desc
BytesReceived *prometheus.Desc
BytesSent *prometheus.Desc
PacketsReceived *prometheus.Desc
PacketsSent *prometheus.Desc
RXPacketsLost *prometheus.Desc
SessionDurationSeconds *prometheus.Desc
TXPacketsLost *prometheus.Desc
bytesReceived *prometheus.Desc
bytesSent *prometheus.Desc
packetsReceived *prometheus.Desc
packetsSent *prometheus.Desc
rxPacketsLost *prometheus.Desc
sessionDurationSeconds *prometheus.Desc
txPacketsLost *prometheus.Desc
ImagingActiveMinimumQuality *prometheus.Desc
ImagingApex2800Offload *prometheus.Desc
ImagingBytesReceived *prometheus.Desc
ImagingBytesSent *prometheus.Desc
ImagingDecoderCapabilitykbitPersec *prometheus.Desc
ImagingEncodedFramesPersec *prometheus.Desc
ImagingMegapixelPersec *prometheus.Desc
ImagingNegativeAcknowledgements *prometheus.Desc
ImagingRXBWkbitPersec *prometheus.Desc
ImagingSVGAdevTapframesPersec *prometheus.Desc
ImagingTXBWkbitPersec *prometheus.Desc
imagingActiveMinimumQuality *prometheus.Desc
imagingApex2800Offload *prometheus.Desc
imagingBytesReceived *prometheus.Desc
imagingBytesSent *prometheus.Desc
imagingDecoderCapabilityKBitPerSec *prometheus.Desc
imagingEncodedFramesPerSec *prometheus.Desc
imagingMegapixelPerSec *prometheus.Desc
imagingNegativeAcknowledgements *prometheus.Desc
imagingRXBWKBitPerSec *prometheus.Desc
imagingSVGAdevTapframesPerSec *prometheus.Desc
imagingTXBWKBitPerSec *prometheus.Desc
RoundTripLatencyms *prometheus.Desc
RXBWkbitPersec *prometheus.Desc
RXBWPeakkbitPersec *prometheus.Desc
RXPacketLossPercent *prometheus.Desc
RXPacketLossPercent_Base *prometheus.Desc
TXBWActiveLimitkbitPersec *prometheus.Desc
TXBWkbitPersec *prometheus.Desc
TXBWLimitkbitPersec *prometheus.Desc
TXPacketLossPercent *prometheus.Desc
TXPacketLossPercent_Base *prometheus.Desc
rxBWKBitPerSec *prometheus.Desc
rxBWPeakKBitPerSec *prometheus.Desc
rxPacketLossPercent *prometheus.Desc
rxPacketLossPercentBase *prometheus.Desc
txBWActiveLimitKBitPerSec *prometheus.Desc
txBWKBitPerSec *prometheus.Desc
txBWLimitKBitPerSec *prometheus.Desc
txPacketLossPercent *prometheus.Desc
txPacketLossPercentBase *prometheus.Desc
USBBytesReceived *prometheus.Desc
USBBytesSent *prometheus.Desc
USBRXBWkbitPersec *prometheus.Desc
USBTXBWkbitPersec *prometheus.Desc
usbBytesReceived *prometheus.Desc
usbBytesSent *prometheus.Desc
usbRXBWKBitPerSec *prometheus.Desc
usbTXBWKBitPerSec *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -99,143 +99,145 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.AudioBytesReceived = prometheus.NewDesc(
// _ = level.Warn(c.logger).Log("msg", "teradici_pcoip collector is deprecated and will be removed in the future.")
c.audioBytesReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "audio_bytes_received_total"),
"(AudioBytesReceived)",
nil,
nil,
)
c.AudioBytesSent = prometheus.NewDesc(
c.audioBytesSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "audio_bytes_sent_total"),
"(AudioBytesSent)",
nil,
nil,
)
c.AudioRXBWkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "audio_rx_bw_kbit_persec"),
"(AudioRXBWkbitPersec)",
c.audioRXBWKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "audio_rx_bw_KBit_persec"),
"(AudioRXBWKBitPerSec)",
nil,
nil,
)
c.AudioTXBWkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "audio_tx_bw_kbit_persec"),
"(AudioTXBWkbitPersec)",
c.audioTXBWKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "audio_tx_bw_KBit_persec"),
"(AudioTXBWKBitPerSec)",
nil,
nil,
)
c.AudioTXBWLimitkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "audio_tx_bw_limit_kbit_persec"),
"(AudioTXBWLimitkbitPersec)",
c.audioTXBWLimitKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "audio_tx_bw_limit_KBit_persec"),
"(AudioTXBWLimitKBitPerSec)",
nil,
nil,
)
c.BytesReceived = prometheus.NewDesc(
c.bytesReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bytes_received_total"),
"(BytesReceived)",
nil,
nil,
)
c.BytesSent = prometheus.NewDesc(
c.bytesSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bytes_sent_total"),
"(BytesSent)",
nil,
nil,
)
c.PacketsReceived = prometheus.NewDesc(
c.packetsReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "packets_received_total"),
"(PacketsReceived)",
nil,
nil,
)
c.PacketsSent = prometheus.NewDesc(
c.packetsSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "packets_sent_total"),
"(PacketsSent)",
nil,
nil,
)
c.RXPacketsLost = prometheus.NewDesc(
c.rxPacketsLost = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rx_packets_lost_total"),
"(RXPacketsLost)",
nil,
nil,
)
c.SessionDurationSeconds = prometheus.NewDesc(
c.sessionDurationSeconds = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "session_duration_seconds_total"),
"(SessionDurationSeconds)",
nil,
nil,
)
c.TXPacketsLost = prometheus.NewDesc(
c.txPacketsLost = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_packets_lost_total"),
"(TXPacketsLost)",
nil,
nil,
)
c.ImagingActiveMinimumQuality = prometheus.NewDesc(
c.imagingActiveMinimumQuality = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_active_min_quality"),
"(ImagingActiveMinimumQuality)",
nil,
nil,
)
c.ImagingApex2800Offload = prometheus.NewDesc(
c.imagingApex2800Offload = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_apex2800_offload"),
"(ImagingApex2800Offload)",
nil,
nil,
)
c.ImagingBytesReceived = prometheus.NewDesc(
c.imagingBytesReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_bytes_received_total"),
"(ImagingBytesReceived)",
nil,
nil,
)
c.ImagingBytesSent = prometheus.NewDesc(
c.imagingBytesSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_bytes_sent_total"),
"(ImagingBytesSent)",
nil,
nil,
)
c.ImagingDecoderCapabilitykbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_decoder_capability_kbit_persec"),
"(ImagingDecoderCapabilitykbitPersec)",
c.imagingDecoderCapabilityKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_decoder_capability_KBit_persec"),
"(ImagingDecoderCapabilityKBitPerSec)",
nil,
nil,
)
c.ImagingEncodedFramesPersec = prometheus.NewDesc(
c.imagingEncodedFramesPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_encoded_frames_persec"),
"(ImagingEncodedFramesPersec)",
"(ImagingEncodedFramesPerSec)",
nil,
nil,
)
c.ImagingMegapixelPersec = prometheus.NewDesc(
c.imagingMegapixelPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_megapixel_persec"),
"(ImagingMegapixelPersec)",
"(ImagingMegapixelPerSec)",
nil,
nil,
)
c.ImagingNegativeAcknowledgements = prometheus.NewDesc(
c.imagingNegativeAcknowledgements = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_negative_acks_total"),
"(ImagingNegativeAcknowledgements)",
nil,
nil,
)
c.ImagingRXBWkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_rx_bw_kbit_persec"),
"(ImagingRXBWkbitPersec)",
c.imagingRXBWKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_rx_bw_KBit_persec"),
"(ImagingRXBWKBitPerSec)",
nil,
nil,
)
c.ImagingSVGAdevTapframesPersec = prometheus.NewDesc(
c.imagingSVGAdevTapframesPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_svga_devtap_frames_persec"),
"(ImagingSVGAdevTapframesPersec)",
"(ImagingSVGAdevTapframesPerSec)",
nil,
nil,
)
c.ImagingTXBWkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_tx_bw_kbit_persec"),
"(ImagingTXBWkbitPersec)",
c.imagingTXBWKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "imaging_tx_bw_KBit_persec"),
"(ImagingTXBWKBitPerSec)",
nil,
nil,
)
@@ -246,82 +248,82 @@ func (c *Collector) Build() error {
nil,
nil,
)
c.RXBWkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rx_bw_kbit_persec"),
"(RXBWkbitPersec)",
c.rxBWKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rx_bw_KBit_persec"),
"(RXBWKBitPerSec)",
nil,
nil,
)
c.RXBWPeakkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rx_bw_peak_kbit_persec"),
"(RXBWPeakkbitPersec)",
c.rxBWPeakKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rx_bw_peak_KBit_persec"),
"(RXBWPeakKBitPerSec)",
nil,
nil,
)
c.RXPacketLossPercent = prometheus.NewDesc(
c.rxPacketLossPercent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rx_packet_loss_percent"),
"(RXPacketLossPercent)",
nil,
nil,
)
c.RXPacketLossPercent_Base = prometheus.NewDesc(
c.rxPacketLossPercentBase = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rx_packet_loss_percent_base"),
"(RXPacketLossPercent_Base)",
nil,
nil,
)
c.TXBWActiveLimitkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_bw_active_limit_kbit_persec"),
"(TXBWActiveLimitkbitPersec)",
c.txBWActiveLimitKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_bw_active_limit_KBit_persec"),
"(TXBWActiveLimitKBitPerSec)",
nil,
nil,
)
c.TXBWkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_bw_kbit_persec"),
"(TXBWkbitPersec)",
c.txBWKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_bw_KBit_persec"),
"(TXBWKBitPerSec)",
nil,
nil,
)
c.TXBWLimitkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_bw_limit_kbit_persec"),
"(TXBWLimitkbitPersec)",
c.txBWLimitKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_bw_limit_KBit_persec"),
"(TXBWLimitKBitPerSec)",
nil,
nil,
)
c.TXPacketLossPercent = prometheus.NewDesc(
c.txPacketLossPercent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_packet_loss_percent"),
"(TXPacketLossPercent)",
nil,
nil,
)
c.TXPacketLossPercent_Base = prometheus.NewDesc(
c.txPacketLossPercentBase = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "tx_packet_loss_percent_base"),
"(TXPacketLossPercent_Base)",
nil,
nil,
)
c.USBBytesReceived = prometheus.NewDesc(
c.usbBytesReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "usb_bytes_received_total"),
"(USBBytesReceived)",
nil,
nil,
)
c.USBBytesSent = prometheus.NewDesc(
c.usbBytesSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "usb_bytes_sent_total"),
"(USBBytesSent)",
nil,
nil,
)
c.USBRXBWkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "usb_rx_bw_kbit_persec"),
"(USBRXBWkbitPersec)",
c.usbRXBWKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "usb_rx_bw_KBit_persec"),
"(USBRXBWKBitPerSec)",
nil,
nil,
)
c.USBTXBWkbitPersec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "usb_tx_bw_kbit_persec"),
"(USBTXBWkbitPersec)",
c.usbTXBWKBitPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "usb_tx_bw_KBit_persec"),
"(USBTXBWKBitPerSec)",
nil,
nil,
)
@@ -357,9 +359,9 @@ func (c *Collector) Collect(_ *types.ScrapeContext, ch chan<- prometheus.Metric)
type win32_PerfRawData_TeradiciPerf_PCoIPSessionAudioStatistics struct {
AudioBytesReceived uint64
AudioBytesSent uint64
AudioRXBWkbitPersec uint64
AudioTXBWkbitPersec uint64
AudioTXBWLimitkbitPersec uint64
AudioRXBWKBitPerSec uint64
AudioTXBWKBitPerSec uint64
AudioTXBWLimitKBitPerSec uint64
}
type win32_PerfRawData_TeradiciPerf_PCoIPSessionGeneralStatistics struct {
@@ -377,33 +379,33 @@ type win32_PerfRawData_TeradiciPerf_PCoIPSessionImagingStatistics struct {
ImagingApex2800Offload uint32
ImagingBytesReceived uint64
ImagingBytesSent uint64
ImagingDecoderCapabilitykbitPersec uint32
ImagingEncodedFramesPersec uint32
ImagingMegapixelPersec uint32
ImagingDecoderCapabilityKBitPerSec uint32
ImagingEncodedFramesPerSec uint32
ImagingMegapixelPerSec uint32
ImagingNegativeAcknowledgements uint32
ImagingRXBWkbitPersec uint64
ImagingSVGAdevTapframesPersec uint32
ImagingTXBWkbitPersec uint64
ImagingRXBWKBitPerSec uint64
ImagingSVGAdevTapframesPerSec uint32
ImagingTXBWKBitPerSec uint64
}
type win32_PerfRawData_TeradiciPerf_PCoIPSessionNetworkStatistics struct {
RoundTripLatencyms uint32
RXBWkbitPersec uint64
RXBWPeakkbitPersec uint32
RXBWKBitPerSec uint64
RXBWPeakKBitPerSec uint32
RXPacketLossPercent uint32
RXPacketLossPercent_Base uint32
TXBWActiveLimitkbitPersec uint32
TXBWkbitPersec uint64
TXBWLimitkbitPersec uint32
RXPacketLossPercentBase uint32
TXBWActiveLimitKBitPerSec uint32
TXBWKBitPerSec uint64
TXBWLimitKBitPerSec uint32
TXPacketLossPercent uint32
TXPacketLossPercent_Base uint32
TXPacketLossPercentBase uint32
}
type win32_PerfRawData_TeradiciPerf_PCoIPSessionUsbStatistics struct {
USBBytesReceived uint64
USBBytesSent uint64
USBRXBWkbitPersec uint64
USBTXBWkbitPersec uint64
USBRXBWKBitPerSec uint64
USBTXBWKBitPerSec uint64
}
func (c *Collector) collectAudio(ch chan<- prometheus.Metric) error {
@@ -417,33 +419,33 @@ func (c *Collector) collectAudio(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.AudioBytesReceived,
c.audioBytesReceived,
prometheus.CounterValue,
float64(dst[0].AudioBytesReceived),
)
ch <- prometheus.MustNewConstMetric(
c.AudioBytesSent,
c.audioBytesSent,
prometheus.CounterValue,
float64(dst[0].AudioBytesSent),
)
ch <- prometheus.MustNewConstMetric(
c.AudioRXBWkbitPersec,
c.audioRXBWKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].AudioRXBWkbitPersec),
float64(dst[0].AudioRXBWKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.AudioTXBWkbitPersec,
c.audioTXBWKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].AudioTXBWkbitPersec),
float64(dst[0].AudioTXBWKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.AudioTXBWLimitkbitPersec,
c.audioTXBWLimitKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].AudioTXBWLimitkbitPersec),
float64(dst[0].AudioTXBWLimitKBitPerSec),
)
return nil
@@ -460,43 +462,43 @@ func (c *Collector) collectGeneral(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.BytesReceived,
c.bytesReceived,
prometheus.CounterValue,
float64(dst[0].BytesReceived),
)
ch <- prometheus.MustNewConstMetric(
c.BytesSent,
c.bytesSent,
prometheus.CounterValue,
float64(dst[0].BytesSent),
)
ch <- prometheus.MustNewConstMetric(
c.PacketsReceived,
c.packetsReceived,
prometheus.CounterValue,
float64(dst[0].PacketsReceived),
)
ch <- prometheus.MustNewConstMetric(
c.PacketsSent,
c.packetsSent,
prometheus.CounterValue,
float64(dst[0].PacketsSent),
)
ch <- prometheus.MustNewConstMetric(
c.RXPacketsLost,
c.rxPacketsLost,
prometheus.CounterValue,
float64(dst[0].RXPacketsLost),
)
ch <- prometheus.MustNewConstMetric(
c.SessionDurationSeconds,
c.sessionDurationSeconds,
prometheus.CounterValue,
float64(dst[0].SessionDurationSeconds),
)
ch <- prometheus.MustNewConstMetric(
c.TXPacketsLost,
c.txPacketsLost,
prometheus.CounterValue,
float64(dst[0].TXPacketsLost),
)
@@ -515,69 +517,69 @@ func (c *Collector) collectImaging(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.ImagingActiveMinimumQuality,
c.imagingActiveMinimumQuality,
prometheus.GaugeValue,
float64(dst[0].ImagingActiveMinimumQuality),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingApex2800Offload,
c.imagingApex2800Offload,
prometheus.GaugeValue,
float64(dst[0].ImagingApex2800Offload),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingBytesReceived,
c.imagingBytesReceived,
prometheus.CounterValue,
float64(dst[0].ImagingBytesReceived),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingBytesSent,
c.imagingBytesSent,
prometheus.CounterValue,
float64(dst[0].ImagingBytesSent),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingDecoderCapabilitykbitPersec,
c.imagingDecoderCapabilityKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].ImagingDecoderCapabilitykbitPersec),
float64(dst[0].ImagingDecoderCapabilityKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingEncodedFramesPersec,
c.imagingEncodedFramesPerSec,
prometheus.GaugeValue,
float64(dst[0].ImagingEncodedFramesPersec),
float64(dst[0].ImagingEncodedFramesPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingMegapixelPersec,
c.imagingMegapixelPerSec,
prometheus.GaugeValue,
float64(dst[0].ImagingMegapixelPersec),
float64(dst[0].ImagingMegapixelPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingNegativeAcknowledgements,
c.imagingNegativeAcknowledgements,
prometheus.CounterValue,
float64(dst[0].ImagingNegativeAcknowledgements),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingRXBWkbitPersec,
c.imagingRXBWKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].ImagingRXBWkbitPersec),
float64(dst[0].ImagingRXBWKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingSVGAdevTapframesPersec,
c.imagingSVGAdevTapframesPerSec,
prometheus.GaugeValue,
float64(dst[0].ImagingSVGAdevTapframesPersec),
float64(dst[0].ImagingSVGAdevTapframesPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.ImagingTXBWkbitPersec,
c.imagingTXBWKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].ImagingTXBWkbitPersec),
float64(dst[0].ImagingTXBWKBitPerSec),
)
return nil
@@ -600,57 +602,57 @@ func (c *Collector) collectNetwork(ch chan<- prometheus.Metric) error {
)
ch <- prometheus.MustNewConstMetric(
c.RXBWkbitPersec,
c.rxBWKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].RXBWkbitPersec),
float64(dst[0].RXBWKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.RXBWPeakkbitPersec,
c.rxBWPeakKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].RXBWPeakkbitPersec),
float64(dst[0].RXBWPeakKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.RXPacketLossPercent,
c.rxPacketLossPercent,
prometheus.GaugeValue,
float64(dst[0].RXPacketLossPercent),
)
ch <- prometheus.MustNewConstMetric(
c.RXPacketLossPercent_Base,
c.rxPacketLossPercentBase,
prometheus.GaugeValue,
float64(dst[0].RXPacketLossPercent_Base),
float64(dst[0].RXPacketLossPercentBase),
)
ch <- prometheus.MustNewConstMetric(
c.TXBWActiveLimitkbitPersec,
c.txBWActiveLimitKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].TXBWActiveLimitkbitPersec),
float64(dst[0].TXBWActiveLimitKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.TXBWkbitPersec,
c.txBWKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].TXBWkbitPersec),
float64(dst[0].TXBWKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.TXBWLimitkbitPersec,
c.txBWLimitKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].TXBWLimitkbitPersec),
float64(dst[0].TXBWLimitKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.TXPacketLossPercent,
c.txPacketLossPercent,
prometheus.GaugeValue,
float64(dst[0].TXPacketLossPercent),
)
ch <- prometheus.MustNewConstMetric(
c.TXPacketLossPercent_Base,
c.txPacketLossPercentBase,
prometheus.GaugeValue,
float64(dst[0].TXPacketLossPercent_Base),
float64(dst[0].TXPacketLossPercentBase),
)
return nil
@@ -667,27 +669,27 @@ func (c *Collector) collectUsb(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.USBBytesReceived,
c.usbBytesReceived,
prometheus.CounterValue,
float64(dst[0].USBBytesReceived),
)
ch <- prometheus.MustNewConstMetric(
c.USBBytesSent,
c.usbBytesSent,
prometheus.CounterValue,
float64(dst[0].USBBytesSent),
)
ch <- prometheus.MustNewConstMetric(
c.USBRXBWkbitPersec,
c.usbRXBWKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].USBRXBWkbitPersec),
float64(dst[0].USBRXBWKBitPerSec),
)
ch <- prometheus.MustNewConstMetric(
c.USBTXBWkbitPersec,
c.usbTXBWKBitPerSec,
prometheus.GaugeValue,
float64(dst[0].USBTXBWkbitPersec),
float64(dst[0].USBTXBWKBitPerSec),
)
return nil

View File

@@ -57,22 +57,21 @@ type Collector struct {
hServer syscall.Handle
SessionInfo *prometheus.Desc
LocalSessionCount *prometheus.Desc
ConnectionBrokerPerformance *prometheus.Desc
HandleCount *prometheus.Desc
PageFaultsPersec *prometheus.Desc
PageFileBytes *prometheus.Desc
PageFileBytesPeak *prometheus.Desc
PercentCPUTime *prometheus.Desc
PoolNonpagedBytes *prometheus.Desc
PoolPagedBytes *prometheus.Desc
PrivateBytes *prometheus.Desc
ThreadCount *prometheus.Desc
VirtualBytes *prometheus.Desc
VirtualBytesPeak *prometheus.Desc
WorkingSet *prometheus.Desc
WorkingSetPeak *prometheus.Desc
sessionInfo *prometheus.Desc
connectionBrokerPerformance *prometheus.Desc
handleCount *prometheus.Desc
pageFaultsPerSec *prometheus.Desc
pageFileBytes *prometheus.Desc
pageFileBytesPeak *prometheus.Desc
percentCPUTime *prometheus.Desc
poolNonPagedBytes *prometheus.Desc
poolPagedBytes *prometheus.Desc
privateBytes *prometheus.Desc
threadCount *prometheus.Desc
virtualBytes *prometheus.Desc
virtualBytesPeak *prometheus.Desc
workingSet *prometheus.Desc
workingSetPeak *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -114,91 +113,91 @@ func (c *Collector) Close() error {
func (c *Collector) Build() error {
c.connectionBrokerEnabled = isConnectionBrokerServer(c.logger)
c.SessionInfo = prometheus.NewDesc(
c.sessionInfo = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "session_info"),
"Terminal Services sessions info",
[]string{"session_name", "user", "host", "state"},
nil,
)
c.ConnectionBrokerPerformance = prometheus.NewDesc(
c.connectionBrokerPerformance = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "connection_broker_performance_total"),
"The total number of connections handled by the Connection Brokers since the service started.",
[]string{"connection"},
nil,
)
c.HandleCount = prometheus.NewDesc(
c.handleCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "handles"),
"Total number of handles currently opened by this process. This number is the sum of the handles currently opened by each thread in this process.",
[]string{"session_name"},
nil,
)
c.PageFaultsPersec = prometheus.NewDesc(
c.pageFaultsPerSec = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "page_fault_total"),
"Rate at which page faults occur in the threads executing in this process. A page fault occurs when a thread refers to a virtual memory page that is not in its working set in main memory. The page may not be retrieved from disk if it is on the standby list and therefore already in main memory. The page also may not be retrieved if it is in use by another process which shares the page.",
[]string{"session_name"},
nil,
)
c.PageFileBytes = prometheus.NewDesc(
c.pageFileBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "page_file_bytes"),
"Current number of bytes this process has used in the paging file(s). Paging files are used to store pages of memory used by the process that are not contained in other files. Paging files are shared by all processes, and lack of space in paging files can prevent other processes from allocating memory.",
[]string{"session_name"},
nil,
)
c.PageFileBytesPeak = prometheus.NewDesc(
c.pageFileBytesPeak = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "page_file_bytes_peak"),
"Maximum number of bytes this process has used in the paging file(s). Paging files are used to store pages of memory used by the process that are not contained in other files. Paging files are shared by all processes, and lack of space in paging files can prevent other processes from allocating memory.",
[]string{"session_name"},
nil,
)
c.PercentCPUTime = prometheus.NewDesc(
c.percentCPUTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cpu_time_seconds_total"),
"Total elapsed time that this process's threads have spent executing code.",
[]string{"mode", "session_name"},
nil,
)
c.PoolNonpagedBytes = prometheus.NewDesc(
c.poolNonPagedBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "pool_non_paged_bytes"),
"Number of bytes in the non-paged pool, an area of system memory (physical memory used by the operating system) for objects that cannot be written to disk, but must remain in physical memory as long as they are allocated. This property displays the last observed value only; it is not an average.",
[]string{"session_name"},
nil,
)
c.PoolPagedBytes = prometheus.NewDesc(
c.poolPagedBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "pool_paged_bytes"),
"Number of bytes in the paged pool, an area of system memory (physical memory used by the operating system) for objects that can be written to disk when they are not being used. This property displays the last observed value only; it is not an average.",
[]string{"session_name"},
nil,
)
c.PrivateBytes = prometheus.NewDesc(
c.privateBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "private_bytes"),
"Current number of bytes this process has allocated that cannot be shared with other processes.",
[]string{"session_name"},
nil,
)
c.ThreadCount = prometheus.NewDesc(
c.threadCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "threads"),
"Number of threads currently active in this process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes instructions. Every running process has at least one thread.",
[]string{"session_name"},
nil,
)
c.VirtualBytes = prometheus.NewDesc(
c.virtualBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "virtual_bytes"),
"Current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite and, by using too much, the process can limit its ability to load libraries.",
[]string{"session_name"},
nil,
)
c.VirtualBytesPeak = prometheus.NewDesc(
c.virtualBytesPeak = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "virtual_bytes_peak"),
"Maximum number of bytes of virtual address space the process has used at any one time. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite and, by using too much, the process might limit its ability to load libraries.",
[]string{"session_name"},
nil,
)
c.WorkingSet = prometheus.NewDesc(
c.workingSet = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "working_set_bytes"),
"Current number of bytes in the working set of this process. The working set is the set of memory pages touched recently by the threads in the process. If free memory in the computer is above a threshold, pages are left in the working set of a process even if they are not in use. When free memory falls below a threshold, pages are trimmed from working sets. If they are needed, they are then soft-faulted back into the working set before they leave main memory.",
[]string{"session_name"},
nil,
)
c.WorkingSetPeak = prometheus.NewDesc(
c.workingSetPeak = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "working_set_bytes_peak"),
"Maximum number of bytes in the working set of this process at any point in time. The working set is the set of memory pages touched recently by the threads in the process. If free memory in the computer is above a threshold, pages are left in the working set of a process even if they are not in use. When free memory falls below a threshold, pages are trimmed from working sets. If they are needed, they are then soft-faulted back into the working set before they leave main memory.",
[]string{"session_name"},
@@ -277,94 +276,94 @@ func (c *Collector) collectTSSessionCounters(ctx *types.ScrapeContext, ch chan<-
names[n] = true
ch <- prometheus.MustNewConstMetric(
c.HandleCount,
c.handleCount,
prometheus.GaugeValue,
d.HandleCount,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.PageFaultsPersec,
c.pageFaultsPerSec,
prometheus.CounterValue,
d.PageFaultsPersec,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.PageFileBytes,
c.pageFileBytes,
prometheus.GaugeValue,
d.PageFileBytes,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.PageFileBytesPeak,
c.pageFileBytesPeak,
prometheus.GaugeValue,
d.PageFileBytesPeak,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.PercentCPUTime,
c.percentCPUTime,
prometheus.CounterValue,
d.PercentPrivilegedTime,
d.Name,
"privileged",
)
ch <- prometheus.MustNewConstMetric(
c.PercentCPUTime,
c.percentCPUTime,
prometheus.CounterValue,
d.PercentProcessorTime,
d.Name,
"processor",
)
ch <- prometheus.MustNewConstMetric(
c.PercentCPUTime,
c.percentCPUTime,
prometheus.CounterValue,
d.PercentUserTime,
d.Name,
"user",
)
ch <- prometheus.MustNewConstMetric(
c.PoolNonpagedBytes,
c.poolNonPagedBytes,
prometheus.GaugeValue,
d.PoolNonpagedBytes,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.PoolPagedBytes,
c.poolPagedBytes,
prometheus.GaugeValue,
d.PoolPagedBytes,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.PrivateBytes,
c.privateBytes,
prometheus.GaugeValue,
d.PrivateBytes,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ThreadCount,
c.threadCount,
prometheus.GaugeValue,
d.ThreadCount,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.VirtualBytes,
c.virtualBytes,
prometheus.GaugeValue,
d.VirtualBytes,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.VirtualBytesPeak,
c.virtualBytesPeak,
prometheus.GaugeValue,
d.VirtualBytesPeak,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.WorkingSet,
c.workingSet,
prometheus.GaugeValue,
d.WorkingSet,
d.Name,
)
ch <- prometheus.MustNewConstMetric(
c.WorkingSetPeak,
c.workingSetPeak,
prometheus.GaugeValue,
d.WorkingSetPeak,
d.Name,
@@ -390,21 +389,21 @@ func (c *Collector) collectCollectionBrokerPerformanceCounter(ctx *types.ScrapeC
}
ch <- prometheus.MustNewConstMetric(
c.ConnectionBrokerPerformance,
c.connectionBrokerPerformance,
prometheus.CounterValue,
dst[0].SuccessfulConnections,
"Successful",
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionBrokerPerformance,
c.connectionBrokerPerformance,
prometheus.CounterValue,
dst[0].PendingConnections,
"Pending",
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionBrokerPerformance,
c.connectionBrokerPerformance,
prometheus.CounterValue,
dst[0].FailedConnections,
"Failed",
@@ -432,7 +431,7 @@ func (c *Collector) collectWTSSessions(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.SessionInfo,
c.sessionInfo,
prometheus.GaugeValue,
isState,
strings.Replace(session.SessionName, "#", " ", -1),

View File

@@ -54,9 +54,9 @@ type Collector struct {
directories string
// Only set for testing to get predictable output.
mtime *float64
mTime *float64
mtimeDesc *prometheus.Desc
mTimeDesc *prometheus.Desc
}
func New(logger log.Logger, config *Config) *Collector {
@@ -105,7 +105,7 @@ func (c *Collector) Build() error {
_ = level.Info(c.logger).Log("msg", "textfile Collector directories: "+c.directories)
c.mtimeDesc = prometheus.NewDesc(
c.mTimeDesc = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, "textfile", "mtime_seconds"),
"Unixtime mtime of textfiles successfully read.",
[]string{"file"},
@@ -254,10 +254,10 @@ func (c *Collector) exportMTimes(mtimes map[string]time.Time, ch chan<- promethe
for _, filename := range filenames {
mtime := float64(mtimes[filename].UnixNano() / 1e9)
if c.mtime != nil {
mtime = *c.mtime
if c.mTime != nil {
mtime = *c.mTime
}
ch <- prometheus.MustNewConstMetric(c.mtimeDesc, prometheus.GaugeValue, mtime, filename)
ch <- prometheus.MustNewConstMetric(c.mTimeDesc, prometheus.GaugeValue, mtime, filename)
}
}
}

View File

@@ -23,9 +23,9 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
PercentPassiveLimit *prometheus.Desc
Temperature *prometheus.Desc
ThrottleReasons *prometheus.Desc
percentPassiveLimit *prometheus.Desc
temperature *prometheus.Desc
throttleReasons *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -56,7 +56,7 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.Temperature = prometheus.NewDesc(
c.temperature = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "temperature_celsius"),
"(Temperature)",
[]string{
@@ -64,7 +64,7 @@ func (c *Collector) Build() error {
},
nil,
)
c.PercentPassiveLimit = prometheus.NewDesc(
c.percentPassiveLimit = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "percent_passive_limit"),
"(PercentPassiveLimit)",
[]string{
@@ -72,7 +72,7 @@ func (c *Collector) Build() error {
},
nil,
)
c.ThrottleReasons = prometheus.NewDesc(
c.throttleReasons = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "throttle_reasons"),
"(ThrottleReasons)",
[]string{
@@ -118,21 +118,21 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
for _, info := range dst {
// Divide by 10 and subtract 273.15 to convert decikelvin to celsius
ch <- prometheus.MustNewConstMetric(
c.Temperature,
c.temperature,
prometheus.GaugeValue,
(float64(info.HighPrecisionTemperature)/10.0)-273.15,
info.Name,
)
ch <- prometheus.MustNewConstMetric(
c.PercentPassiveLimit,
c.percentPassiveLimit,
prometheus.GaugeValue,
float64(info.PercentPassiveLimit),
info.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ThrottleReasons,
c.throttleReasons,
prometheus.GaugeValue,
float64(info.ThrottleReasons),
info.Name,

View File

@@ -24,12 +24,12 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
ClockFrequencyAdjustmentPPBTotal *prometheus.Desc
ComputedTimeOffset *prometheus.Desc
NTPClientTimeSourceCount *prometheus.Desc
NTPRoundtripDelay *prometheus.Desc
NTPServerIncomingRequestsTotal *prometheus.Desc
NTPServerOutgoingResponsesTotal *prometheus.Desc
clockFrequencyAdjustmentPPBTotal *prometheus.Desc
computedTimeOffset *prometheus.Desc
ntpClientTimeSourceCount *prometheus.Desc
ntpRoundTripDelay *prometheus.Desc
ntpServerIncomingRequestsTotal *prometheus.Desc
ntpServerOutgoingResponsesTotal *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -64,37 +64,37 @@ func (c *Collector) Build() error {
return errors.New("Windows version older than Server 2016 detected. The time collector will not run and should be disabled via CLI flags or configuration file")
}
c.ClockFrequencyAdjustmentPPBTotal = prometheus.NewDesc(
c.clockFrequencyAdjustmentPPBTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "clock_frequency_adjustment_ppb_total"),
"Total adjustment made to the local system clock frequency by W32Time in Parts Per Billion (PPB) units.",
nil,
nil,
)
c.ComputedTimeOffset = prometheus.NewDesc(
c.computedTimeOffset = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "computed_time_offset_seconds"),
"Absolute time offset between the system clock and the chosen time source, in seconds",
nil,
nil,
)
c.NTPClientTimeSourceCount = prometheus.NewDesc(
c.ntpClientTimeSourceCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "ntp_client_time_sources"),
"Active number of NTP Time sources being used by the client",
nil,
nil,
)
c.NTPRoundtripDelay = prometheus.NewDesc(
c.ntpRoundTripDelay = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "ntp_round_trip_delay_seconds"),
"Roundtrip delay experienced by the NTP client in receiving a response from the server for the most recent request, in seconds",
nil,
nil,
)
c.NTPServerOutgoingResponsesTotal = prometheus.NewDesc(
c.ntpServerOutgoingResponsesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "ntp_server_outgoing_responses_total"),
"Total number of requests responded to by NTP server",
nil,
nil,
)
c.NTPServerIncomingRequestsTotal = prometheus.NewDesc(
c.ntpServerIncomingRequestsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "ntp_server_incoming_requests_total"),
"Total number of requests received by NTP server",
nil,
@@ -130,32 +130,32 @@ func (c *Collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
}
ch <- prometheus.MustNewConstMetric(
c.ClockFrequencyAdjustmentPPBTotal,
c.clockFrequencyAdjustmentPPBTotal,
prometheus.CounterValue,
dst[0].ClockFrequencyAdjustmentPPBTotal,
)
ch <- prometheus.MustNewConstMetric(
c.ComputedTimeOffset,
c.computedTimeOffset,
prometheus.GaugeValue,
dst[0].ComputedTimeOffset/1000000, // microseconds -> seconds
)
ch <- prometheus.MustNewConstMetric(
c.NTPClientTimeSourceCount,
c.ntpClientTimeSourceCount,
prometheus.GaugeValue,
dst[0].NTPClientTimeSourceCount,
)
ch <- prometheus.MustNewConstMetric(
c.NTPRoundtripDelay,
c.ntpRoundTripDelay,
prometheus.GaugeValue,
dst[0].NTPRoundtripDelay/1000000, // microseconds -> seconds
)
ch <- prometheus.MustNewConstMetric(
c.NTPServerIncomingRequestsTotal,
c.ntpServerIncomingRequestsTotal,
prometheus.CounterValue,
dst[0].NTPServerIncomingRequestsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.NTPServerOutgoingResponsesTotal,
c.ntpServerOutgoingResponsesTotal,
prometheus.CounterValue,
dst[0].NTPServerOutgoingResponsesTotal,
)

View File

@@ -24,26 +24,26 @@ var ConfigDefaults = Config{}
type Collector struct {
logger log.Logger
MemActive *prometheus.Desc
MemBallooned *prometheus.Desc
MemLimit *prometheus.Desc
MemMapped *prometheus.Desc
MemOverhead *prometheus.Desc
MemReservation *prometheus.Desc
MemShared *prometheus.Desc
MemSharedSaved *prometheus.Desc
MemShares *prometheus.Desc
MemSwapped *prometheus.Desc
MemTargetSize *prometheus.Desc
MemUsed *prometheus.Desc
memActive *prometheus.Desc
memBallooned *prometheus.Desc
memLimit *prometheus.Desc
memMapped *prometheus.Desc
memOverhead *prometheus.Desc
memReservation *prometheus.Desc
memShared *prometheus.Desc
memSharedSaved *prometheus.Desc
memShares *prometheus.Desc
memSwapped *prometheus.Desc
memTargetSize *prometheus.Desc
memUsed *prometheus.Desc
CpuLimitMHz *prometheus.Desc
CpuReservationMHz *prometheus.Desc
CpuShares *prometheus.Desc
CpuStolenTotal *prometheus.Desc
CpuTimeTotal *prometheus.Desc
EffectiveVMSpeedMHz *prometheus.Desc
HostProcessorSpeedMHz *prometheus.Desc
cpuLimitMHz *prometheus.Desc
cpuReservationMHz *prometheus.Desc
cpuShares *prometheus.Desc
cpuStolenTotal *prometheus.Desc
cpuTimeTotal *prometheus.Desc
effectiveVMSpeedMHz *prometheus.Desc
hostProcessorSpeedMHz *prometheus.Desc
}
func New(logger log.Logger, _ *Config) *Collector {
@@ -74,116 +74,116 @@ func (c *Collector) Close() error {
}
func (c *Collector) Build() error {
c.MemActive = prometheus.NewDesc(
c.memActive = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_active_bytes"),
"(MemActiveMB)",
nil,
nil,
)
c.MemBallooned = prometheus.NewDesc(
c.memBallooned = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_ballooned_bytes"),
"(MemBalloonedMB)",
nil,
nil,
)
c.MemLimit = prometheus.NewDesc(
c.memLimit = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_limit_bytes"),
"(MemLimitMB)",
nil,
nil,
)
c.MemMapped = prometheus.NewDesc(
c.memMapped = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_mapped_bytes"),
"(MemMappedMB)",
nil,
nil,
)
c.MemOverhead = prometheus.NewDesc(
c.memOverhead = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_overhead_bytes"),
"(MemOverheadMB)",
nil,
nil,
)
c.MemReservation = prometheus.NewDesc(
c.memReservation = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_reservation_bytes"),
"(MemReservationMB)",
nil,
nil,
)
c.MemShared = prometheus.NewDesc(
c.memShared = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_shared_bytes"),
"(MemSharedMB)",
nil,
nil,
)
c.MemSharedSaved = prometheus.NewDesc(
c.memSharedSaved = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_shared_saved_bytes"),
"(MemSharedSavedMB)",
nil,
nil,
)
c.MemShares = prometheus.NewDesc(
c.memShares = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_shares"),
"(MemShares)",
nil,
nil,
)
c.MemSwapped = prometheus.NewDesc(
c.memSwapped = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_swapped_bytes"),
"(MemSwappedMB)",
nil,
nil,
)
c.MemTargetSize = prometheus.NewDesc(
c.memTargetSize = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_target_size_bytes"),
"(MemTargetSizeMB)",
nil,
nil,
)
c.MemUsed = prometheus.NewDesc(
c.memUsed = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "mem_used_bytes"),
"(MemUsedMB)",
nil,
nil,
)
c.CpuLimitMHz = prometheus.NewDesc(
c.cpuLimitMHz = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cpu_limit_mhz"),
"(CpuLimitMHz)",
nil,
nil,
)
c.CpuReservationMHz = prometheus.NewDesc(
c.cpuReservationMHz = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cpu_reservation_mhz"),
"(CpuReservationMHz)",
nil,
nil,
)
c.CpuShares = prometheus.NewDesc(
c.cpuShares = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cpu_shares"),
"(CpuShares)",
nil,
nil,
)
c.CpuStolenTotal = prometheus.NewDesc(
c.cpuStolenTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cpu_stolen_seconds_total"),
"(CpuStolenMs)",
nil,
nil,
)
c.CpuTimeTotal = prometheus.NewDesc(
c.cpuTimeTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cpu_time_seconds_total"),
"(CpuTimePercents)",
nil,
nil,
)
c.EffectiveVMSpeedMHz = prometheus.NewDesc(
c.effectiveVMSpeedMHz = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "effective_vm_speed_mhz"),
"(EffectiveVMSpeedMHz)",
nil,
nil,
)
c.HostProcessorSpeedMHz = prometheus.NewDesc(
c.hostProcessorSpeedMHz = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "host_processor_speed_mhz"),
"(HostProcessorSpeedMHz)",
nil,
@@ -242,73 +242,73 @@ func (c *Collector) collectMem(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.MemActive,
c.memActive,
prometheus.GaugeValue,
mbToBytes(dst[0].MemActiveMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemBallooned,
c.memBallooned,
prometheus.GaugeValue,
mbToBytes(dst[0].MemBalloonedMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemLimit,
c.memLimit,
prometheus.GaugeValue,
mbToBytes(dst[0].MemLimitMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemMapped,
c.memMapped,
prometheus.GaugeValue,
mbToBytes(dst[0].MemMappedMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemOverhead,
c.memOverhead,
prometheus.GaugeValue,
mbToBytes(dst[0].MemOverheadMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemReservation,
c.memReservation,
prometheus.GaugeValue,
mbToBytes(dst[0].MemReservationMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemShared,
c.memShared,
prometheus.GaugeValue,
mbToBytes(dst[0].MemSharedMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemSharedSaved,
c.memSharedSaved,
prometheus.GaugeValue,
mbToBytes(dst[0].MemSharedSavedMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemShares,
c.memShares,
prometheus.GaugeValue,
float64(dst[0].MemShares),
)
ch <- prometheus.MustNewConstMetric(
c.MemSwapped,
c.memSwapped,
prometheus.GaugeValue,
mbToBytes(dst[0].MemSwappedMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemTargetSize,
c.memTargetSize,
prometheus.GaugeValue,
mbToBytes(dst[0].MemTargetSizeMB),
)
ch <- prometheus.MustNewConstMetric(
c.MemUsed,
c.memUsed,
prometheus.GaugeValue,
mbToBytes(dst[0].MemUsedMB),
)
@@ -331,43 +331,43 @@ func (c *Collector) collectCpu(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.CpuLimitMHz,
c.cpuLimitMHz,
prometheus.GaugeValue,
float64(dst[0].CpuLimitMHz),
)
ch <- prometheus.MustNewConstMetric(
c.CpuReservationMHz,
c.cpuReservationMHz,
prometheus.GaugeValue,
float64(dst[0].CpuReservationMHz),
)
ch <- prometheus.MustNewConstMetric(
c.CpuShares,
c.cpuShares,
prometheus.GaugeValue,
float64(dst[0].CpuShares),
)
ch <- prometheus.MustNewConstMetric(
c.CpuStolenTotal,
c.cpuStolenTotal,
prometheus.CounterValue,
float64(dst[0].CpuStolenMs)*perflib.TicksToSecondScaleFactor,
)
ch <- prometheus.MustNewConstMetric(
c.CpuTimeTotal,
c.cpuTimeTotal,
prometheus.CounterValue,
float64(dst[0].CpuTimePercents)*perflib.TicksToSecondScaleFactor,
)
ch <- prometheus.MustNewConstMetric(
c.EffectiveVMSpeedMHz,
c.effectiveVMSpeedMHz,
prometheus.GaugeValue,
float64(dst[0].EffectiveVMSpeedMHz),
)
ch <- prometheus.MustNewConstMetric(
c.HostProcessorSpeedMHz,
c.hostProcessorSpeedMHz,
prometheus.GaugeValue,
float64(dst[0].HostProcessorSpeedMHz),
)

File diff suppressed because it is too large Load Diff