mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
netframework: merge multiple collector into one (Click here for more information) (#1633)
This commit is contained in:
@@ -31,14 +31,7 @@ Name | Description | Enabled by default
|
|||||||
[mscluster](docs/collector.mscluster.md) | MSCluster metrics |
|
[mscluster](docs/collector.mscluster.md) | MSCluster metrics |
|
||||||
[msmq](docs/collector.msmq.md) | MSMQ queues |
|
[msmq](docs/collector.msmq.md) | MSMQ queues |
|
||||||
[mssql](docs/collector.mssql.md) | [SQL Server Performance Objects](https://docs.microsoft.com/en-us/sql/relational-databases/performance-monitor/use-sql-server-objects#SQLServerPOs) metrics |
|
[mssql](docs/collector.mssql.md) | [SQL Server Performance Objects](https://docs.microsoft.com/en-us/sql/relational-databases/performance-monitor/use-sql-server-objects#SQLServerPOs) metrics |
|
||||||
[netframework_clrexceptions](docs/collector.netframework_clrexceptions.md) | .NET Framework CLR Exceptions |
|
[netframework](docs/collector.netframework.md) | .NET Framework metrics |
|
||||||
[netframework_clrinterop](docs/collector.netframework_clrinterop.md) | .NET Framework Interop Metrics |
|
|
||||||
[netframework_clrjit](docs/collector.netframework_clrjit.md) | .NET Framework JIT metrics |
|
|
||||||
[netframework_clrloading](docs/collector.netframework_clrloading.md) | .NET Framework CLR Loading metrics |
|
|
||||||
[netframework_clrlocksandthreads](docs/collector.netframework_clrlocksandthreads.md) | .NET Framework locks and metrics threads |
|
|
||||||
[netframework_clrmemory](docs/collector.netframework_clrmemory.md) | .NET Framework Memory metrics |
|
|
||||||
[netframework_clrremoting](docs/collector.netframework_clrremoting.md) | .NET Framework Remoting metrics |
|
|
||||||
[netframework_clrsecurity](docs/collector.netframework_clrsecurity.md) | .NET Framework Security Check metrics |
|
|
||||||
[net](docs/collector.net.md) | Network interface I/O | ✓
|
[net](docs/collector.net.md) | Network interface I/O | ✓
|
||||||
[os](docs/collector.os.md) | OS metrics (memory, processes, users) | ✓
|
[os](docs/collector.os.md) | OS metrics (memory, processes, users) | ✓
|
||||||
[physical_disk](docs/collector.physical_disk.md) | physical disk metrics | ✓
|
[physical_disk](docs/collector.physical_disk.md) | physical disk metrics | ✓
|
||||||
|
|||||||
@@ -25,14 +25,7 @@ This directory contains documentation of the collectors in the windows_exporter,
|
|||||||
- [`msmq`](collector.msmq.md)
|
- [`msmq`](collector.msmq.md)
|
||||||
- [`mssql`](collector.mssql.md)
|
- [`mssql`](collector.mssql.md)
|
||||||
- [`net`](collector.net.md)
|
- [`net`](collector.net.md)
|
||||||
- [`netframework_clrexceptions`](collector.netframework_clrexceptions.md)
|
- [`netframework`](collector.netframework.md)
|
||||||
- [`netframework_clrinterop`](collector.netframework_clrinterop.md)
|
|
||||||
- [`netframework_clrjit`](collector.netframework_clrjit.md)
|
|
||||||
- [`netframework_clrloading`](collector.netframework_clrloading.md)
|
|
||||||
- [`netframework_clrlocksandthreads`](collector.netframework_clrlocksandthreads.md)
|
|
||||||
- [`netframework_clrmemory`](collector.netframework_clrmemory.md)
|
|
||||||
- [`netframework_clrremoting`](collector.netframework_clrremoting.md)
|
|
||||||
- [`netframework_clrsecurity`](collector.netframework_clrsecurity.md)
|
|
||||||
- [`nps`](collector.nps.md)
|
- [`nps`](collector.nps.md)
|
||||||
- [`os`](collector.os.md)
|
- [`os`](collector.os.md)
|
||||||
- [`physical_disk`](collector.physical_disk.md)
|
- [`physical_disk`](collector.physical_disk.md)
|
||||||
|
|||||||
113
docs/collector.netframework.md
Normal file
113
docs/collector.netframework.md
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
# netframework collector
|
||||||
|
|
||||||
|
The netframework collector exposes metrics about dotnet framework.
|
||||||
|
|
||||||
|
| | |
|
||||||
|
|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **Metric name prefix** | `netframework_clrexceptions` |
|
||||||
|
| **Classes** | `Win32_PerfRawData_NETFramework_NETCLRExceptions`, `Win32_PerfRawData_NETFramework_NETCLRInterop`, `Win32_PerfRawData_NETFramework_NETCLRJit`, `Win32_PerfRawData_NETFramework_NETCLRLoading`, `Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads`, `Win32_PerfRawData_NETFramework_NETCLRMemory`, `Win32_PerfRawData_NETFramework_NETCLRRemoting`, `Win32_PerfRawData_NETFramework_NETCLRSecurity` |
|
||||||
|
| **Enabled by default?** | No |
|
||||||
|
|
||||||
|
## Flags
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
|
## Metrics
|
||||||
|
|
||||||
|
### CLR Exceptions
|
||||||
|
|
||||||
|
| Name | Description | Type | Labels |
|
||||||
|
|-----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||||
|
| `windows_netframework_clrexceptions_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. | counter | `process` |
|
||||||
|
| `windows_netframework_clrexceptions_exceptions_filters_total` | Displays the total number of .NET exception filters executed. An exception filter evaluates regardless of whether an exception is handled. | counter | `process` |
|
||||||
|
| `windows_netframework_clrexceptions_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. | counter | `process` |
|
||||||
|
| `windows_netframework_clrexceptions_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. | counter | `process` |
|
||||||
|
|
||||||
|
### CLR Interop
|
||||||
|
|
||||||
|
| Name | Description | Type | Labels |
|
||||||
|
|---------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||||
|
| `windows_netframework_clrinterop_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. | counter | `process` |
|
||||||
|
| `windows_netframework_clrinterop_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. | counter | `process` |
|
||||||
|
| `windows_netframework_clrinterop_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. | counter | `process` |
|
||||||
|
|
||||||
|
### CLR JIT
|
||||||
|
|
||||||
|
| Name | Description | Type | Labels |
|
||||||
|
|-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||||
|
| `windows_netframework_clrjit_jit_methods_total` | Displays the total number of methods JIT-compiled since the application started. This counter does not include pre-JIT-compiled methods. | counter | `process` |
|
||||||
|
| `windows_netframework_clrjit_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrjit_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. | counter | `process` |
|
||||||
|
| `windows_netframework_clrjit_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 | counter | `process` |
|
||||||
|
|
||||||
|
### CLR Loading
|
||||||
|
|
||||||
|
| Name | Description | Type | Labels |
|
||||||
|
|-------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||||
|
| `windows_netframework_clrloading_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrloading_appdomains_loaded_current` | Displays the current number of application domains loaded in this application. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrloading_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrloading_classes_loaded_current` | Displays the current number of classes loaded in all assemblies. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrloading_appdomains_loaded_total` | Displays the peak number of application domains loaded since the application started. | counter | `process` |
|
||||||
|
| `windows_netframework_clrloading_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. | counter | `process` |
|
||||||
|
| `windows_netframework_clrloading_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. | counter | `process` |
|
||||||
|
| `windows_netframework_clrloading_classes_loaded_total` | Displays the cumulative number of classes loaded in all assemblies since the application started. | counter | `process` |
|
||||||
|
| `windows_netframework_clrloading_class_load_failures_total` | Displays the peak number of classes that have failed to load since the application started. | counter | `process` |
|
||||||
|
|
||||||
|
### CLR Locks and Threads
|
||||||
|
|
||||||
|
| Name | Description | Type | Labels |
|
||||||
|
|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||||
|
| `windows_netframework_clrlocksandthreads_current_queue_length` | Displays the total number of threads that are currently waiting to acquire a managed lock in the application. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrlocksandthreads_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrlocksandthreads_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrlocksandthreads_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrlocksandthreads_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. | counter | `process` |
|
||||||
|
| `windows_netframework_clrlocksandthreads_queue_length_total` | Displays the total number of threads that waited to acquire a managed lock since the application started. | counter | `process` |
|
||||||
|
| `windows_netframework_clrlocksandthreads_contentions_total` | Displays the total number of times that threads in the runtime have attempted to acquire a managed lock unsuccessfully. | counter | `process` |
|
||||||
|
|
||||||
|
### CLR Memory
|
||||||
|
|
||||||
|
| Name | Description | Type | Labels |
|
||||||
|
|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||||
|
| `windows_netframework_clrmemory_allocated_bytes_total` | Displays the total number of bytes allocated on the garbage collection heap. | counter | `process` |
|
||||||
|
| `windows_netframework_clrmemory_finalization_survivors` | Displays the number of garbage-collected objects that survive a collection because they are waiting to be finalized. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrmemory_heap_size_bytes` | Displays the maximum bytes that can be allocated; it does not indicate the current number of bytes allocated. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrmemory_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrmemory_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrmemory_collections_total` | Displays the number of times the generation objects are garbage collected since the application started. | counter | `process` |
|
||||||
|
| `windows_netframework_clrmemory_induced_gc_total` | Displays the peak number of times garbage collection was performed because of an explicit call to GC.Collect. | counter | `process` |
|
||||||
|
| `windows_netframework_clrmemory_number_pinned_objects` | Displays the number of pinned objects encountered in the last garbage collection. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrmemory_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrmemory_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrmemory_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. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrmemory_gc_time_percent` | Displays the percentage of time that was spent performing a garbage collection in the last sample. | gauge | `process` |
|
||||||
|
|
||||||
|
### CLR Remoting
|
||||||
|
|
||||||
|
| Name | Description | Type | Labels |
|
||||||
|
|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||||
|
| `windows_netframework_clrremoting_channels_total` | Displays the total number of remoting channels registered across all application domains since application started. | counter | `process` |
|
||||||
|
| `windows_netframework_clrremoting_context_bound_classes_loaded` | Displays the current number of context-bound classes that are loaded. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrremoting_context_bound_objects_total` | Displays the total number of context-bound objects allocated. | counter | `process` |
|
||||||
|
| `windows_netframework_clrremoting_context_proxies_total` | Displays the total number of remoting proxy objects in this process since it started. | counter | `process` |
|
||||||
|
| `windows_netframework_clrremoting_contexts` | Displays the current number of remoting contexts in the application. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrremoting_remote_calls_total` | Displays the total number of remote procedure calls invoked since the application started. | counter | `process` |
|
||||||
|
|
||||||
|
### CLR Security
|
||||||
|
|
||||||
|
| Name | Description | Type | Labels |
|
||||||
|
|-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||||
|
| `windows_netframework_clrsecurity_link_time_checks_total` | Displays the total number of link-time code access security checks since the application started. | counter | `process` |
|
||||||
|
| `windows_netframework_clrsecurity_rt_checks_time_percent` | Displays the percentage of time spent performing runtime code access security checks in the last sample. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrsecurity_stack_walk_depth` | Displays the depth of the stack during that last runtime code access security check. | gauge | `process` |
|
||||||
|
| `windows_netframework_clrsecurity_runtime_checks_total` | Displays the total number of runtime code access security checks performed since the application started. | counter | `process` |
|
||||||
|
|
||||||
|
### Example metric
|
||||||
|
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||||
|
|
||||||
|
## Useful queries
|
||||||
|
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||||
|
|
||||||
|
## Alerting examples
|
||||||
|
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
# netframework_clrexceptions collector
|
|
||||||
|
|
||||||
The netframework_clrexceptions collector exposes metrics about CLR exceptions in the dotnet framework.
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `netframework_clrexceptions`
|
|
||||||
Classes | `Win32_PerfRawData_NETFramework_NETCLRExceptions`
|
|
||||||
Enabled by default? | No
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_netframework_clrexceptions_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. | counter | `process`
|
|
||||||
`windows_netframework_clrexceptions_exceptions_filters_total` | Displays the total number of .NET exception filters executed. An exception filter evaluates regardless of whether an exception is handled. | counter | `process`
|
|
||||||
`windows_netframework_clrexceptions_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. | counter | `process`
|
|
||||||
`windows_netframework_clrexceptions_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. | counter | `process`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
# netframework_clrinterop collector
|
|
||||||
|
|
||||||
The netframework_clrinterop collector exposes metrics about interop between the dotnet framework and outside components.
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `netframework_clrinterop`
|
|
||||||
Classes | `Win32_PerfRawData_NETFramework_NETCLRInterop`
|
|
||||||
Enabled by default? | No
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_netframework_clrinterop_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. | counter | `process`
|
|
||||||
`windows_netframework_clrinterop_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. | counter | `process`
|
|
||||||
`windows_netframework_clrinterop_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. | counter | `process`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
# netframework_clrjit collector
|
|
||||||
|
|
||||||
The netframework_clrjit collector exposes metrics about the dotnet Just-in-Time compiler.
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `netframework_clrjit`
|
|
||||||
Classes | `Win32_PerfRawData_NETFramework_NETCLRJit`
|
|
||||||
Enabled by default? | No
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_netframework_clrjit_jit_methods_total` | Displays the total number of methods JIT-compiled since the application started. This counter does not include pre-JIT-compiled methods. | counter | `process`
|
|
||||||
`windows_netframework_clrjit_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrjit_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. | counter | `process`
|
|
||||||
`windows_netframework_clrjit_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 | counter | `process`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
# netframework_clrloading collector
|
|
||||||
|
|
||||||
The netframework_clrloading collector exposes metrics about the dotnet loader.
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `netframework_clrloading`
|
|
||||||
Classes | `Win32_PerfRawData_NETFramework_NETCLRLoading`
|
|
||||||
Enabled by default? | No
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_netframework_clrloading_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrloading_appdomains_loaded_current` | Displays the current number of application domains loaded in this application. | gauge | `process`
|
|
||||||
`windows_netframework_clrloading_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrloading_classes_loaded_current` | Displays the current number of classes loaded in all assemblies. | gauge | `process`
|
|
||||||
`windows_netframework_clrloading_appdomains_loaded_total` | Displays the peak number of application domains loaded since the application started. | counter | `process`
|
|
||||||
`windows_netframework_clrloading_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. | counter | `process`
|
|
||||||
`windows_netframework_clrloading_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. | counter | `process`
|
|
||||||
`windows_netframework_clrloading_classes_loaded_total` | Displays the cumulative number of classes loaded in all assemblies since the application started. | counter | `process`
|
|
||||||
`windows_netframework_clrloading_class_load_failures_total` | Displays the peak number of classes that have failed to load since the application started. | counter | `process`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
# netframework_clrlocksandthreads collector
|
|
||||||
|
|
||||||
The netframework_clrlocksandthreads collector exposes metrics about locks and threads in dotnet applications.
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `netframework_clrlocksandthreads`
|
|
||||||
Classes | `Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads`
|
|
||||||
Enabled by default? | No
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_netframework_clrlocksandthreads_current_queue_length` | Displays the total number of threads that are currently waiting to acquire a managed lock in the application. | gauge | `process`
|
|
||||||
`windows_netframework_clrlocksandthreads_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrlocksandthreads_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrlocksandthreads_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrlocksandthreads_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. | counter | `process`
|
|
||||||
`windows_netframework_clrlocksandthreads_queue_length_total` | Displays the total number of threads that waited to acquire a managed lock since the application started. | counter | `process`
|
|
||||||
`windows_netframework_clrlocksandthreads_contentions_total` | Displays the total number of times that threads in the runtime have attempted to acquire a managed lock unsuccessfully. | counter | `process`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
# netframework_clrmemory collector
|
|
||||||
|
|
||||||
The netframework_clrmemory collector exposes metrics about memory in dotnet applications.
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `netframework_clrmemory`
|
|
||||||
Classes | `Win32_PerfRawData_NETFramework_NETCLRMemory`
|
|
||||||
Enabled by default? | No
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_netframework_clrmemory_allocated_bytes_total` | Displays the total number of bytes allocated on the garbage collection heap. | counter | `process`
|
|
||||||
`windows_netframework_clrmemory_finalization_survivors` | Displays the number of garbage-collected objects that survive a collection because they are waiting to be finalized. | gauge | `process`
|
|
||||||
`windows_netframework_clrmemory_heap_size_bytes` | Displays the maximum bytes that can be allocated; it does not indicate the current number of bytes allocated. | gauge | `process`
|
|
||||||
`windows_netframework_clrmemory_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrmemory_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrmemory_collections_total` | Displays the number of times the generation objects are garbage collected since the application started. | counter | `process`
|
|
||||||
`windows_netframework_clrmemory_induced_gc_total` | Displays the peak number of times garbage collection was performed because of an explicit call to GC.Collect. | counter | `process`
|
|
||||||
`windows_netframework_clrmemory_number_pinned_objects` | Displays the number of pinned objects encountered in the last garbage collection. | gauge | `process`
|
|
||||||
`windows_netframework_clrmemory_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrmemory_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrmemory_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. | gauge | `process`
|
|
||||||
`windows_netframework_clrmemory_gc_time_percent` | Displays the percentage of time that was spent performing a garbage collection in the last sample. | gauge | `process`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
# netframework_clrremoting collector
|
|
||||||
|
|
||||||
The netframework_clrremoting collector exposes metrics about dotnet remoting.
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `netframework_clrremoting`
|
|
||||||
Classes | `Win32_PerfRawData_NETFramework_NETCLRRemoting`
|
|
||||||
Enabled by default? | No
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_netframework_clrremoting_channels_total` | Displays the total number of remoting channels registered across all application domains since application started. | counter | `process`
|
|
||||||
`windows_netframework_clrremoting_context_bound_classes_loaded` | Displays the current number of context-bound classes that are loaded. | gauge | `process`
|
|
||||||
`windows_netframework_clrremoting_context_bound_objects_total` | Displays the total number of context-bound objects allocated. | counter | `process`
|
|
||||||
`windows_netframework_clrremoting_context_proxies_total` | Displays the total number of remoting proxy objects in this process since it started. | counter | `process`
|
|
||||||
`windows_netframework_clrremoting_contexts` | Displays the current number of remoting contexts in the application. | gauge | `process`
|
|
||||||
`windows_netframework_clrremoting_remote_calls_total` | Displays the total number of remote procedure calls invoked since the application started. | counter | `process`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
# netframework_clrsecurity collector
|
|
||||||
|
|
||||||
The netframework_clrsecurity collector exposes metrics about security checks in dotnet applications
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `netframework_clrsecurity`
|
|
||||||
Classes | `Win32_PerfRawData_NETFramework_NETCLRSecurity`
|
|
||||||
Enabled by default? | No
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_netframework_clrsecurity_link_time_checks_total` | Displays the total number of link-time code access security checks since the application started. | counter | `process`
|
|
||||||
`windows_netframework_clrsecurity_rt_checks_time_percent` | Displays the percentage of time spent performing runtime code access security checks in the last sample. | gauge | `process`
|
|
||||||
`windows_netframework_clrsecurity_stack_walk_depth` | Displays the depth of the stack during that last runtime code access security check. | gauge | `process`
|
|
||||||
`windows_netframework_clrsecurity_runtime_checks_total` | Displays the total number of runtime code access security checks performed since the application started. | counter | `process`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -34,14 +34,7 @@ import (
|
|||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/msmq"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/msmq"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/mssql"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/mssql"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/net"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/net"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrexceptions"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrinterop"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrjit"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrloading"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrlocksandthreads"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrmemory"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrremoting"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrsecurity"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/nps"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/nps"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/os"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/os"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/perfdata"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/perfdata"
|
||||||
@@ -108,14 +101,7 @@ func NewWithConfig(config Config) *MetricCollectors {
|
|||||||
collectors[msmq.Name] = msmq.New(&config.Msmq)
|
collectors[msmq.Name] = msmq.New(&config.Msmq)
|
||||||
collectors[mssql.Name] = mssql.New(&config.Mssql)
|
collectors[mssql.Name] = mssql.New(&config.Mssql)
|
||||||
collectors[net.Name] = net.New(&config.Net)
|
collectors[net.Name] = net.New(&config.Net)
|
||||||
collectors[netframework_clrexceptions.Name] = netframework_clrexceptions.New(&config.NetframeworkClrexceptions)
|
collectors[netframework.Name] = netframework.New(&config.NetFramework)
|
||||||
collectors[netframework_clrinterop.Name] = netframework_clrinterop.New(&config.NetframeworkClrinterop)
|
|
||||||
collectors[netframework_clrjit.Name] = netframework_clrjit.New(&config.NetframeworkClrjit)
|
|
||||||
collectors[netframework_clrloading.Name] = netframework_clrloading.New(&config.NetframeworkClrloading)
|
|
||||||
collectors[netframework_clrlocksandthreads.Name] = netframework_clrlocksandthreads.New(&config.NetframeworkClrlocksandthreads)
|
|
||||||
collectors[netframework_clrmemory.Name] = netframework_clrmemory.New(&config.NetframeworkClrmemory)
|
|
||||||
collectors[netframework_clrremoting.Name] = netframework_clrremoting.New(&config.NetframeworkClrremoting)
|
|
||||||
collectors[netframework_clrsecurity.Name] = netframework_clrsecurity.New(&config.NetframeworkClrsecurity)
|
|
||||||
collectors[nps.Name] = nps.New(&config.Nps)
|
collectors[nps.Name] = nps.New(&config.Nps)
|
||||||
collectors[os.Name] = os.New(&config.Os)
|
collectors[os.Name] = os.New(&config.Os)
|
||||||
collectors[perfdata.Name] = perfdata.New(&config.PerfData)
|
collectors[perfdata.Name] = perfdata.New(&config.PerfData)
|
||||||
|
|||||||
@@ -25,14 +25,7 @@ import (
|
|||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/msmq"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/msmq"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/mssql"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/mssql"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/net"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/net"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrexceptions"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrinterop"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrjit"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrloading"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrlocksandthreads"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrmemory"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrremoting"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrsecurity"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/nps"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/nps"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/os"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/os"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/perfdata"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/perfdata"
|
||||||
@@ -57,116 +50,102 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
AD ad.Config `yaml:"ad"`
|
AD ad.Config `yaml:"ad"`
|
||||||
ADCS adcs.Config `yaml:"adcs"`
|
ADCS adcs.Config `yaml:"adcs"`
|
||||||
ADFS adfs.Config `yaml:"adfs"`
|
ADFS adfs.Config `yaml:"adfs"`
|
||||||
Cache cache.Config `yaml:"cache"`
|
Cache cache.Config `yaml:"cache"`
|
||||||
Container container.Config `yaml:"container"`
|
Container container.Config `yaml:"container"`
|
||||||
CPU cpu.Config `yaml:"cpu"`
|
CPU cpu.Config `yaml:"cpu"`
|
||||||
CPUInfo cpu_info.Config `yaml:"cpu_info"`
|
CPUInfo cpu_info.Config `yaml:"cpu_info"`
|
||||||
Cs cs.Config `yaml:"cs"`
|
Cs cs.Config `yaml:"cs"`
|
||||||
DFSR dfsr.Config `yaml:"dfsr"`
|
DFSR dfsr.Config `yaml:"dfsr"`
|
||||||
Dhcp dhcp.Config `yaml:"dhcp"`
|
Dhcp dhcp.Config `yaml:"dhcp"`
|
||||||
DiskDrive diskdrive.Config `yaml:"diskdrive"` //nolint:tagliatelle
|
DiskDrive diskdrive.Config `yaml:"diskdrive"` //nolint:tagliatelle
|
||||||
DNS dns.Config `yaml:"dns"`
|
DNS dns.Config `yaml:"dns"`
|
||||||
Exchange exchange.Config `yaml:"exchange"`
|
Exchange exchange.Config `yaml:"exchange"`
|
||||||
Fsrmquota fsrmquota.Config `yaml:"fsrmquota"`
|
Fsrmquota fsrmquota.Config `yaml:"fsrmquota"`
|
||||||
Hyperv hyperv.Config `yaml:"hyperv"`
|
Hyperv hyperv.Config `yaml:"hyperv"`
|
||||||
IIS iis.Config `yaml:"iis"`
|
IIS iis.Config `yaml:"iis"`
|
||||||
License license.Config `yaml:"license"`
|
License license.Config `yaml:"license"`
|
||||||
LogicalDisk logical_disk.Config `yaml:"logical_disk"`
|
LogicalDisk logical_disk.Config `yaml:"logical_disk"`
|
||||||
Logon logon.Config `yaml:"logon"`
|
Logon logon.Config `yaml:"logon"`
|
||||||
Memory memory.Config `yaml:"memory"`
|
Memory memory.Config `yaml:"memory"`
|
||||||
Mscluster mscluster.Config `yaml:"mscluster"`
|
Mscluster mscluster.Config `yaml:"mscluster"`
|
||||||
Msmq msmq.Config `yaml:"msmq"`
|
Msmq msmq.Config `yaml:"msmq"`
|
||||||
Mssql mssql.Config `yaml:"mssql"`
|
Mssql mssql.Config `yaml:"mssql"`
|
||||||
Net net.Config `yaml:"net"`
|
Net net.Config `yaml:"net"`
|
||||||
NetframeworkClrexceptions netframework_clrexceptions.Config `yaml:"netframework_clrexceptions"`
|
NetFramework netframework.Config `yaml:"net_framework"`
|
||||||
NetframeworkClrinterop netframework_clrinterop.Config `yaml:"netframework_clrinterop"`
|
Nps nps.Config `yaml:"nps"`
|
||||||
NetframeworkClrjit netframework_clrjit.Config `yaml:"netframework_clrjit"`
|
Os os.Config `yaml:"os"`
|
||||||
NetframeworkClrloading netframework_clrloading.Config `yaml:"netframework_clrloading"`
|
PerfData perfdata.Config `yaml:"perf_data"`
|
||||||
NetframeworkClrlocksandthreads netframework_clrlocksandthreads.Config `yaml:"netframework_clrlocksandthreads"`
|
PhysicalDisk physical_disk.Config `yaml:"physical_disk"`
|
||||||
NetframeworkClrmemory netframework_clrmemory.Config `yaml:"netframework_clrmemory"`
|
Printer printer.Config `yaml:"printer"`
|
||||||
NetframeworkClrremoting netframework_clrremoting.Config `yaml:"netframework_clrremoting"`
|
Process process.Config `yaml:"process"`
|
||||||
NetframeworkClrsecurity netframework_clrsecurity.Config `yaml:"netframework_clrsecurity"`
|
RemoteFx remote_fx.Config `yaml:"remote_fx"`
|
||||||
Nps nps.Config `yaml:"nps"`
|
ScheduledTask scheduled_task.Config `yaml:"scheduled_task"`
|
||||||
Os os.Config `yaml:"os"`
|
Service service.Config `yaml:"service"`
|
||||||
PerfData perfdata.Config `yaml:"perf_data"`
|
SMB smb.Config `yaml:"smb"`
|
||||||
PhysicalDisk physical_disk.Config `yaml:"physical_disk"`
|
SMBClient smbclient.Config `yaml:"smbclient"` //nolint:tagliatelle
|
||||||
Printer printer.Config `yaml:"printer"`
|
SMTP smtp.Config `yaml:"smtp"`
|
||||||
Process process.Config `yaml:"process"`
|
System system.Config `yaml:"system"`
|
||||||
RemoteFx remote_fx.Config `yaml:"remote_fx"`
|
TeradiciPcoip teradici_pcoip.Config `yaml:"teradici_pcoip"`
|
||||||
ScheduledTask scheduled_task.Config `yaml:"scheduled_task"`
|
TCP tcp.Config `yaml:"tcp"`
|
||||||
Service service.Config `yaml:"service"`
|
TerminalServices terminal_services.Config `yaml:"terminal_services"`
|
||||||
SMB smb.Config `yaml:"smb"`
|
Textfile textfile.Config `yaml:"textfile"`
|
||||||
SMBClient smbclient.Config `yaml:"smbclient"` //nolint:tagliatelle
|
Thermalzone thermalzone.Config `yaml:"thermalzone"`
|
||||||
SMTP smtp.Config `yaml:"smtp"`
|
Time time.Config `yaml:"time"`
|
||||||
System system.Config `yaml:"system"`
|
Vmware vmware.Config `yaml:"vmware"`
|
||||||
TeradiciPcoip teradici_pcoip.Config `yaml:"teradici_pcoip"`
|
VmwareBlast vmware_blast.Config `yaml:"vmware_blast"`
|
||||||
TCP tcp.Config `yaml:"tcp"`
|
|
||||||
TerminalServices terminal_services.Config `yaml:"terminal_services"`
|
|
||||||
Textfile textfile.Config `yaml:"textfile"`
|
|
||||||
Thermalzone thermalzone.Config `yaml:"thermalzone"`
|
|
||||||
Time time.Config `yaml:"time"`
|
|
||||||
Vmware vmware.Config `yaml:"vmware"`
|
|
||||||
VmwareBlast vmware_blast.Config `yaml:"vmware_blast"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConfigDefaults Is an interface to be used by the external libraries. It holds all ConfigDefaults form all collectors
|
// ConfigDefaults Is an interface to be used by the external libraries. It holds all ConfigDefaults form all collectors
|
||||||
//
|
//
|
||||||
//goland:noinspection GoUnusedGlobalVariable
|
//goland:noinspection GoUnusedGlobalVariable
|
||||||
var ConfigDefaults = Config{
|
var ConfigDefaults = Config{
|
||||||
AD: ad.ConfigDefaults,
|
AD: ad.ConfigDefaults,
|
||||||
ADCS: adcs.ConfigDefaults,
|
ADCS: adcs.ConfigDefaults,
|
||||||
ADFS: adfs.ConfigDefaults,
|
ADFS: adfs.ConfigDefaults,
|
||||||
Cache: cache.ConfigDefaults,
|
Cache: cache.ConfigDefaults,
|
||||||
Container: container.ConfigDefaults,
|
Container: container.ConfigDefaults,
|
||||||
CPU: cpu.ConfigDefaults,
|
CPU: cpu.ConfigDefaults,
|
||||||
CPUInfo: cpu_info.ConfigDefaults,
|
CPUInfo: cpu_info.ConfigDefaults,
|
||||||
Cs: cs.ConfigDefaults,
|
Cs: cs.ConfigDefaults,
|
||||||
DFSR: dfsr.ConfigDefaults,
|
DFSR: dfsr.ConfigDefaults,
|
||||||
Dhcp: dhcp.ConfigDefaults,
|
Dhcp: dhcp.ConfigDefaults,
|
||||||
DiskDrive: diskdrive.ConfigDefaults,
|
DiskDrive: diskdrive.ConfigDefaults,
|
||||||
DNS: dns.ConfigDefaults,
|
DNS: dns.ConfigDefaults,
|
||||||
Exchange: exchange.ConfigDefaults,
|
Exchange: exchange.ConfigDefaults,
|
||||||
Fsrmquota: fsrmquota.ConfigDefaults,
|
Fsrmquota: fsrmquota.ConfigDefaults,
|
||||||
Hyperv: hyperv.ConfigDefaults,
|
Hyperv: hyperv.ConfigDefaults,
|
||||||
IIS: iis.ConfigDefaults,
|
IIS: iis.ConfigDefaults,
|
||||||
License: license.ConfigDefaults,
|
License: license.ConfigDefaults,
|
||||||
LogicalDisk: logical_disk.ConfigDefaults,
|
LogicalDisk: logical_disk.ConfigDefaults,
|
||||||
Logon: logon.ConfigDefaults,
|
Logon: logon.ConfigDefaults,
|
||||||
Memory: memory.ConfigDefaults,
|
Memory: memory.ConfigDefaults,
|
||||||
Mscluster: mscluster.ConfigDefaults,
|
Mscluster: mscluster.ConfigDefaults,
|
||||||
Msmq: msmq.ConfigDefaults,
|
Msmq: msmq.ConfigDefaults,
|
||||||
Mssql: mssql.ConfigDefaults,
|
Mssql: mssql.ConfigDefaults,
|
||||||
Net: net.ConfigDefaults,
|
Net: net.ConfigDefaults,
|
||||||
NetframeworkClrexceptions: netframework_clrexceptions.ConfigDefaults,
|
NetFramework: netframework.ConfigDefaults,
|
||||||
NetframeworkClrinterop: netframework_clrinterop.ConfigDefaults,
|
Nps: nps.ConfigDefaults,
|
||||||
NetframeworkClrjit: netframework_clrjit.ConfigDefaults,
|
Os: os.ConfigDefaults,
|
||||||
NetframeworkClrloading: netframework_clrloading.ConfigDefaults,
|
PerfData: perfdata.ConfigDefaults,
|
||||||
NetframeworkClrlocksandthreads: netframework_clrlocksandthreads.ConfigDefaults,
|
PhysicalDisk: physical_disk.ConfigDefaults,
|
||||||
NetframeworkClrmemory: netframework_clrmemory.ConfigDefaults,
|
Printer: printer.ConfigDefaults,
|
||||||
NetframeworkClrremoting: netframework_clrremoting.ConfigDefaults,
|
Process: process.ConfigDefaults,
|
||||||
NetframeworkClrsecurity: netframework_clrsecurity.ConfigDefaults,
|
RemoteFx: remote_fx.ConfigDefaults,
|
||||||
Nps: nps.ConfigDefaults,
|
ScheduledTask: scheduled_task.ConfigDefaults,
|
||||||
Os: os.ConfigDefaults,
|
Service: service.ConfigDefaults,
|
||||||
PerfData: perfdata.ConfigDefaults,
|
SMB: smb.ConfigDefaults,
|
||||||
PhysicalDisk: physical_disk.ConfigDefaults,
|
SMBClient: smbclient.ConfigDefaults,
|
||||||
Printer: printer.ConfigDefaults,
|
SMTP: smtp.ConfigDefaults,
|
||||||
Process: process.ConfigDefaults,
|
System: system.ConfigDefaults,
|
||||||
RemoteFx: remote_fx.ConfigDefaults,
|
TeradiciPcoip: teradici_pcoip.ConfigDefaults,
|
||||||
ScheduledTask: scheduled_task.ConfigDefaults,
|
TCP: tcp.ConfigDefaults,
|
||||||
Service: service.ConfigDefaults,
|
TerminalServices: terminal_services.ConfigDefaults,
|
||||||
SMB: smb.ConfigDefaults,
|
Textfile: textfile.ConfigDefaults,
|
||||||
SMBClient: smbclient.ConfigDefaults,
|
Thermalzone: thermalzone.ConfigDefaults,
|
||||||
SMTP: smtp.ConfigDefaults,
|
Time: time.ConfigDefaults,
|
||||||
System: system.ConfigDefaults,
|
Vmware: vmware.ConfigDefaults,
|
||||||
TeradiciPcoip: teradici_pcoip.ConfigDefaults,
|
VmwareBlast: vmware_blast.ConfigDefaults,
|
||||||
TCP: tcp.ConfigDefaults,
|
|
||||||
TerminalServices: terminal_services.ConfigDefaults,
|
|
||||||
Textfile: textfile.ConfigDefaults,
|
|
||||||
Thermalzone: thermalzone.ConfigDefaults,
|
|
||||||
Time: time.ConfigDefaults,
|
|
||||||
Vmware: vmware.ConfigDefaults,
|
|
||||||
VmwareBlast: vmware_blast.ConfigDefaults,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,14 +29,7 @@ import (
|
|||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/msmq"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/msmq"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/mssql"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/mssql"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/net"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/net"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrexceptions"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrinterop"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrjit"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrloading"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrlocksandthreads"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrmemory"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrremoting"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrsecurity"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/nps"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/nps"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/os"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/os"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/perfdata"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/perfdata"
|
||||||
@@ -67,59 +60,52 @@ func NewBuilderWithFlags[C Collector](fn BuilderWithFlags[C]) BuilderWithFlags[C
|
|||||||
}
|
}
|
||||||
|
|
||||||
var BuildersWithFlags = map[string]BuilderWithFlags[Collector]{
|
var BuildersWithFlags = map[string]BuilderWithFlags[Collector]{
|
||||||
ad.Name: NewBuilderWithFlags(ad.NewWithFlags),
|
ad.Name: NewBuilderWithFlags(ad.NewWithFlags),
|
||||||
adcs.Name: NewBuilderWithFlags(adcs.NewWithFlags),
|
adcs.Name: NewBuilderWithFlags(adcs.NewWithFlags),
|
||||||
adfs.Name: NewBuilderWithFlags(adfs.NewWithFlags),
|
adfs.Name: NewBuilderWithFlags(adfs.NewWithFlags),
|
||||||
cache.Name: NewBuilderWithFlags(cache.NewWithFlags),
|
cache.Name: NewBuilderWithFlags(cache.NewWithFlags),
|
||||||
container.Name: NewBuilderWithFlags(container.NewWithFlags),
|
container.Name: NewBuilderWithFlags(container.NewWithFlags),
|
||||||
cpu.Name: NewBuilderWithFlags(cpu.NewWithFlags),
|
cpu.Name: NewBuilderWithFlags(cpu.NewWithFlags),
|
||||||
cpu_info.Name: NewBuilderWithFlags(cpu_info.NewWithFlags),
|
cpu_info.Name: NewBuilderWithFlags(cpu_info.NewWithFlags),
|
||||||
cs.Name: NewBuilderWithFlags(cs.NewWithFlags),
|
cs.Name: NewBuilderWithFlags(cs.NewWithFlags),
|
||||||
dfsr.Name: NewBuilderWithFlags(dfsr.NewWithFlags),
|
dfsr.Name: NewBuilderWithFlags(dfsr.NewWithFlags),
|
||||||
dhcp.Name: NewBuilderWithFlags(dhcp.NewWithFlags),
|
dhcp.Name: NewBuilderWithFlags(dhcp.NewWithFlags),
|
||||||
diskdrive.Name: NewBuilderWithFlags(diskdrive.NewWithFlags),
|
diskdrive.Name: NewBuilderWithFlags(diskdrive.NewWithFlags),
|
||||||
dns.Name: NewBuilderWithFlags(dns.NewWithFlags),
|
dns.Name: NewBuilderWithFlags(dns.NewWithFlags),
|
||||||
exchange.Name: NewBuilderWithFlags(exchange.NewWithFlags),
|
exchange.Name: NewBuilderWithFlags(exchange.NewWithFlags),
|
||||||
fsrmquota.Name: NewBuilderWithFlags(fsrmquota.NewWithFlags),
|
fsrmquota.Name: NewBuilderWithFlags(fsrmquota.NewWithFlags),
|
||||||
hyperv.Name: NewBuilderWithFlags(hyperv.NewWithFlags),
|
hyperv.Name: NewBuilderWithFlags(hyperv.NewWithFlags),
|
||||||
iis.Name: NewBuilderWithFlags(iis.NewWithFlags),
|
iis.Name: NewBuilderWithFlags(iis.NewWithFlags),
|
||||||
license.Name: NewBuilderWithFlags(license.NewWithFlags),
|
license.Name: NewBuilderWithFlags(license.NewWithFlags),
|
||||||
logical_disk.Name: NewBuilderWithFlags(logical_disk.NewWithFlags),
|
logical_disk.Name: NewBuilderWithFlags(logical_disk.NewWithFlags),
|
||||||
logon.Name: NewBuilderWithFlags(logon.NewWithFlags),
|
logon.Name: NewBuilderWithFlags(logon.NewWithFlags),
|
||||||
memory.Name: NewBuilderWithFlags(memory.NewWithFlags),
|
memory.Name: NewBuilderWithFlags(memory.NewWithFlags),
|
||||||
mscluster.Name: NewBuilderWithFlags(mscluster.NewWithFlags),
|
mscluster.Name: NewBuilderWithFlags(mscluster.NewWithFlags),
|
||||||
msmq.Name: NewBuilderWithFlags(msmq.NewWithFlags),
|
msmq.Name: NewBuilderWithFlags(msmq.NewWithFlags),
|
||||||
mssql.Name: NewBuilderWithFlags(mssql.NewWithFlags),
|
mssql.Name: NewBuilderWithFlags(mssql.NewWithFlags),
|
||||||
net.Name: NewBuilderWithFlags(net.NewWithFlags),
|
net.Name: NewBuilderWithFlags(net.NewWithFlags),
|
||||||
netframework_clrexceptions.Name: NewBuilderWithFlags(netframework_clrexceptions.NewWithFlags),
|
netframework.Name: NewBuilderWithFlags(netframework.NewWithFlags),
|
||||||
netframework_clrinterop.Name: NewBuilderWithFlags(netframework_clrinterop.NewWithFlags),
|
nps.Name: NewBuilderWithFlags(nps.NewWithFlags),
|
||||||
netframework_clrjit.Name: NewBuilderWithFlags(netframework_clrjit.NewWithFlags),
|
os.Name: NewBuilderWithFlags(os.NewWithFlags),
|
||||||
netframework_clrloading.Name: NewBuilderWithFlags(netframework_clrloading.NewWithFlags),
|
perfdata.Name: NewBuilderWithFlags(perfdata.NewWithFlags),
|
||||||
netframework_clrlocksandthreads.Name: NewBuilderWithFlags(netframework_clrlocksandthreads.NewWithFlags),
|
physical_disk.Name: NewBuilderWithFlags(physical_disk.NewWithFlags),
|
||||||
netframework_clrmemory.Name: NewBuilderWithFlags(netframework_clrmemory.NewWithFlags),
|
printer.Name: NewBuilderWithFlags(printer.NewWithFlags),
|
||||||
netframework_clrremoting.Name: NewBuilderWithFlags(netframework_clrremoting.NewWithFlags),
|
process.Name: NewBuilderWithFlags(process.NewWithFlags),
|
||||||
netframework_clrsecurity.Name: NewBuilderWithFlags(netframework_clrsecurity.NewWithFlags),
|
remote_fx.Name: NewBuilderWithFlags(remote_fx.NewWithFlags),
|
||||||
nps.Name: NewBuilderWithFlags(nps.NewWithFlags),
|
scheduled_task.Name: NewBuilderWithFlags(scheduled_task.NewWithFlags),
|
||||||
os.Name: NewBuilderWithFlags(os.NewWithFlags),
|
service.Name: NewBuilderWithFlags(service.NewWithFlags),
|
||||||
perfdata.Name: NewBuilderWithFlags(perfdata.NewWithFlags),
|
smb.Name: NewBuilderWithFlags(smb.NewWithFlags),
|
||||||
physical_disk.Name: NewBuilderWithFlags(physical_disk.NewWithFlags),
|
smbclient.Name: NewBuilderWithFlags(smbclient.NewWithFlags),
|
||||||
printer.Name: NewBuilderWithFlags(printer.NewWithFlags),
|
smtp.Name: NewBuilderWithFlags(smtp.NewWithFlags),
|
||||||
process.Name: NewBuilderWithFlags(process.NewWithFlags),
|
system.Name: NewBuilderWithFlags(system.NewWithFlags),
|
||||||
remote_fx.Name: NewBuilderWithFlags(remote_fx.NewWithFlags),
|
teradici_pcoip.Name: NewBuilderWithFlags(teradici_pcoip.NewWithFlags),
|
||||||
scheduled_task.Name: NewBuilderWithFlags(scheduled_task.NewWithFlags),
|
tcp.Name: NewBuilderWithFlags(tcp.NewWithFlags),
|
||||||
service.Name: NewBuilderWithFlags(service.NewWithFlags),
|
terminal_services.Name: NewBuilderWithFlags(terminal_services.NewWithFlags),
|
||||||
smb.Name: NewBuilderWithFlags(smb.NewWithFlags),
|
textfile.Name: NewBuilderWithFlags(textfile.NewWithFlags),
|
||||||
smbclient.Name: NewBuilderWithFlags(smbclient.NewWithFlags),
|
thermalzone.Name: NewBuilderWithFlags(thermalzone.NewWithFlags),
|
||||||
smtp.Name: NewBuilderWithFlags(smtp.NewWithFlags),
|
time.Name: NewBuilderWithFlags(time.NewWithFlags),
|
||||||
system.Name: NewBuilderWithFlags(system.NewWithFlags),
|
vmware.Name: NewBuilderWithFlags(vmware.NewWithFlags),
|
||||||
teradici_pcoip.Name: NewBuilderWithFlags(teradici_pcoip.NewWithFlags),
|
vmware_blast.Name: NewBuilderWithFlags(vmware_blast.NewWithFlags),
|
||||||
tcp.Name: NewBuilderWithFlags(tcp.NewWithFlags),
|
|
||||||
terminal_services.Name: NewBuilderWithFlags(terminal_services.NewWithFlags),
|
|
||||||
textfile.Name: NewBuilderWithFlags(textfile.NewWithFlags),
|
|
||||||
thermalzone.Name: NewBuilderWithFlags(thermalzone.NewWithFlags),
|
|
||||||
time.Name: NewBuilderWithFlags(time.NewWithFlags),
|
|
||||||
vmware.Name: NewBuilderWithFlags(vmware.NewWithFlags),
|
|
||||||
vmware_blast.Name: NewBuilderWithFlags(vmware_blast.NewWithFlags),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Available() []string {
|
func Available() []string {
|
||||||
|
|||||||
@@ -298,9 +298,5 @@ func (c *Collector) Collect(_ *types.ScrapeContext, _ *slog.Logger, ch chan<- pr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(errs) > 0 {
|
return errors.Join(errs...)
|
||||||
return errors.Join(errs...)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|||||||
245
pkg/collector/netframework/netframework.go
Normal file
245
pkg/collector/netframework/netframework.go
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
//go:build windows
|
||||||
|
|
||||||
|
package netframework
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"log/slog"
|
||||||
|
"slices"
|
||||||
|
|
||||||
|
"github.com/alecthomas/kingpin/v2"
|
||||||
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/yusufpapurcu/wmi"
|
||||||
|
)
|
||||||
|
|
||||||
|
const Name = "netframework"
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
CollectorsEnabled []string `yaml:"collectors_enabled"`
|
||||||
|
}
|
||||||
|
|
||||||
|
var ConfigDefaults = Config{
|
||||||
|
CollectorsEnabled: []string{
|
||||||
|
collectorClrExceptions,
|
||||||
|
collectorClrInterop,
|
||||||
|
collectorClrJIT,
|
||||||
|
collectorClrLoading,
|
||||||
|
collectorClrLocksAndThreads,
|
||||||
|
collectorClrMemory,
|
||||||
|
collectorClrRemoting,
|
||||||
|
collectorClrSecurity,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
collectorClrExceptions = "clrexceptions"
|
||||||
|
collectorClrInterop = "clrinterop"
|
||||||
|
collectorClrJIT = "clrjit"
|
||||||
|
collectorClrLoading = "clrloading"
|
||||||
|
collectorClrLocksAndThreads = "clrlocksandthreads"
|
||||||
|
collectorClrMemory = "clrmemory"
|
||||||
|
collectorClrRemoting = "clrremoting"
|
||||||
|
collectorClrSecurity = "clrsecurity"
|
||||||
|
)
|
||||||
|
|
||||||
|
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRExceptions metrics.
|
||||||
|
type Collector struct {
|
||||||
|
config Config
|
||||||
|
wmiClient *wmi.Client
|
||||||
|
|
||||||
|
// clrexceptions
|
||||||
|
numberOfExceptionsThrown *prometheus.Desc
|
||||||
|
numberOfFilters *prometheus.Desc
|
||||||
|
numberOfFinally *prometheus.Desc
|
||||||
|
throwToCatchDepth *prometheus.Desc
|
||||||
|
|
||||||
|
// clrinterop
|
||||||
|
numberOfCCWs *prometheus.Desc
|
||||||
|
numberOfMarshalling *prometheus.Desc
|
||||||
|
numberOfStubs *prometheus.Desc
|
||||||
|
|
||||||
|
// clrjit
|
||||||
|
numberOfMethodsJitted *prometheus.Desc
|
||||||
|
timeInJit *prometheus.Desc
|
||||||
|
standardJitFailures *prometheus.Desc
|
||||||
|
totalNumberOfILBytesJitted *prometheus.Desc
|
||||||
|
|
||||||
|
// clrloading
|
||||||
|
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
|
||||||
|
|
||||||
|
// clrlocksandthreads
|
||||||
|
currentQueueLength *prometheus.Desc
|
||||||
|
numberOfCurrentLogicalThreads *prometheus.Desc
|
||||||
|
numberOfCurrentPhysicalThreads *prometheus.Desc
|
||||||
|
numberOfCurrentRecognizedThreads *prometheus.Desc
|
||||||
|
numberOfTotalRecognizedThreads *prometheus.Desc
|
||||||
|
queueLengthPeak *prometheus.Desc
|
||||||
|
totalNumberOfContentions *prometheus.Desc
|
||||||
|
|
||||||
|
// clrmemory
|
||||||
|
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
|
||||||
|
|
||||||
|
// clrremoting
|
||||||
|
channels *prometheus.Desc
|
||||||
|
contextBoundClassesLoaded *prometheus.Desc
|
||||||
|
contextBoundObjects *prometheus.Desc
|
||||||
|
contextProxies *prometheus.Desc
|
||||||
|
contexts *prometheus.Desc
|
||||||
|
totalRemoteCalls *prometheus.Desc
|
||||||
|
|
||||||
|
// clrsecurity
|
||||||
|
numberLinkTimeChecks *prometheus.Desc
|
||||||
|
timeInRTChecks *prometheus.Desc
|
||||||
|
stackWalkDepth *prometheus.Desc
|
||||||
|
totalRuntimeChecks *prometheus.Desc
|
||||||
|
}
|
||||||
|
|
||||||
|
func New(config *Config) *Collector {
|
||||||
|
if config == nil {
|
||||||
|
config = &ConfigDefaults
|
||||||
|
}
|
||||||
|
|
||||||
|
c := &Collector{
|
||||||
|
config: *config,
|
||||||
|
}
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewWithFlags(_ *kingpin.Application) *Collector {
|
||||||
|
return &Collector{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Collector) GetName() string {
|
||||||
|
return Name
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
||||||
|
return []string{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Collector) Close(_ *slog.Logger) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
||||||
|
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
||||||
|
return errors.New("wmiClient or SWbemServicesClient is nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
c.wmiClient = wmiClient
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrExceptions) {
|
||||||
|
c.buildClrExceptions()
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrInterop) {
|
||||||
|
c.buildClrInterop()
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrJIT) {
|
||||||
|
c.buildClrJIT()
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrLoading) {
|
||||||
|
c.buildClrLoading()
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrLocksAndThreads) {
|
||||||
|
c.buildClrLocksAndThreads()
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrMemory) {
|
||||||
|
c.buildClrMemory()
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrRemoting) {
|
||||||
|
c.buildClrRemoting()
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrSecurity) {
|
||||||
|
c.buildClrSecurity()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Collect sends the metric values for each metric
|
||||||
|
// to the provided prometheus Metric channel.
|
||||||
|
func (c *Collector) Collect(_ *types.ScrapeContext, _ *slog.Logger, ch chan<- prometheus.Metric) error {
|
||||||
|
var (
|
||||||
|
err error
|
||||||
|
errs []error
|
||||||
|
)
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrExceptions) {
|
||||||
|
if err = c.collectClrExceptions(ch); err != nil {
|
||||||
|
errs = append(errs, fmt.Errorf("failed to collect %s metrics: %w", collectorClrExceptions, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrInterop) {
|
||||||
|
if err = c.collectClrInterop(ch); err != nil {
|
||||||
|
errs = append(errs, fmt.Errorf("failed to collect %s metrics: %w", collectorClrInterop, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrJIT) {
|
||||||
|
if err = c.collectClrJIT(ch); err != nil {
|
||||||
|
errs = append(errs, fmt.Errorf("failed to collect %s metrics: %w", collectorClrJIT, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrLoading) {
|
||||||
|
if err = c.collectClrLoading(ch); err != nil {
|
||||||
|
errs = append(errs, fmt.Errorf("failed to collect %s metrics: %w", collectorClrLoading, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrLocksAndThreads) {
|
||||||
|
if err = c.collectClrLocksAndThreads(ch); err != nil {
|
||||||
|
errs = append(errs, fmt.Errorf("failed to collect %s metrics: %w", collectorClrLocksAndThreads, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrMemory) {
|
||||||
|
if err = c.collectClrMemory(ch); err != nil {
|
||||||
|
errs = append(errs, fmt.Errorf("failed to collect %s metrics: %w", collectorClrMemory, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrRemoting) {
|
||||||
|
if err = c.collectClrRemoting(ch); err != nil {
|
||||||
|
errs = append(errs, fmt.Errorf("failed to collect %s metrics: %w", collectorClrRemoting, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if slices.Contains(c.config.CollectorsEnabled, collectorClrSecurity) {
|
||||||
|
if err = c.collectClrSecurity(ch); err != nil {
|
||||||
|
errs = append(errs, fmt.Errorf("failed to collect %s metrics: %w", collectorClrSecurity, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return errors.Join(errs...)
|
||||||
|
}
|
||||||
@@ -1,68 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package netframework_clrexceptions
|
package netframework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/yusufpapurcu/wmi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const Name = "netframework_clrexceptions"
|
func (c *Collector) buildClrExceptions() {
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRExceptions metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
wmiClient *wmi.Client
|
|
||||||
|
|
||||||
numberOfExceptionsThrown *prometheus.Desc
|
|
||||||
numberOfFilters *prometheus.Desc
|
|
||||||
numberOfFinally *prometheus.Desc
|
|
||||||
throwToCatchDepth *prometheus.Desc
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
|
||||||
return []string{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close(_ *slog.Logger) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|
||||||
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
|
||||||
return errors.New("wmiClient or SWbemServicesClient is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
c.wmiClient = wmiClient
|
|
||||||
c.numberOfExceptionsThrown = prometheus.NewDesc(
|
c.numberOfExceptionsThrown = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "exceptions_thrown_total"),
|
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.",
|
"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.",
|
||||||
@@ -87,23 +32,6 @@ func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|||||||
[]string{"process"},
|
[]string{"process"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
|
||||||
logger = logger.With(slog.String("collector", Name))
|
|
||||||
if err := c.collect(ch); err != nil {
|
|
||||||
logger.Error("failed collecting win32_perfrawdata_netframework_netclrexceptions metrics",
|
|
||||||
slog.Any("err", err),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Win32_PerfRawData_NETFramework_NETCLRExceptions struct {
|
type Win32_PerfRawData_NETFramework_NETCLRExceptions struct {
|
||||||
@@ -116,7 +44,7 @@ type Win32_PerfRawData_NETFramework_NETCLRExceptions struct {
|
|||||||
ThrowToCatchDepthPersec uint32
|
ThrowToCatchDepthPersec uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectClrExceptions(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_NETFramework_NETCLRExceptions
|
var dst []Win32_PerfRawData_NETFramework_NETCLRExceptions
|
||||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRExceptions", &dst); err != nil {
|
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRExceptions", &dst); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1,67 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package netframework_clrinterop
|
package netframework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/yusufpapurcu/wmi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const Name = "netframework_clrinterop"
|
func (c *Collector) buildClrInterop() {
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRInterop metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
wmiClient *wmi.Client
|
|
||||||
|
|
||||||
numberOfCCWs *prometheus.Desc
|
|
||||||
numberOfMarshalling *prometheus.Desc
|
|
||||||
numberOfStubs *prometheus.Desc
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
|
||||||
return []string{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close(_ *slog.Logger) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|
||||||
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
|
||||||
return errors.New("wmiClient or SWbemServicesClient is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
c.wmiClient = wmiClient
|
|
||||||
c.numberOfCCWs = prometheus.NewDesc(
|
c.numberOfCCWs = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "com_callable_wrappers_total"),
|
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.",
|
"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.",
|
||||||
@@ -80,23 +26,6 @@ func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|||||||
[]string{"process"},
|
[]string{"process"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
|
||||||
logger = logger.With(slog.String("collector", Name))
|
|
||||||
if err := c.collect(ch); err != nil {
|
|
||||||
logger.Error("failed collecting win32_perfrawdata_netframework_netclrinterop metrics",
|
|
||||||
slog.Any("err", err),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Win32_PerfRawData_NETFramework_NETCLRInterop struct {
|
type Win32_PerfRawData_NETFramework_NETCLRInterop struct {
|
||||||
@@ -109,7 +38,7 @@ type Win32_PerfRawData_NETFramework_NETCLRInterop struct {
|
|||||||
NumberofTLBimportsPersec uint32
|
NumberofTLBimportsPersec uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectClrInterop(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_NETFramework_NETCLRInterop
|
var dst []Win32_PerfRawData_NETFramework_NETCLRInterop
|
||||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRInterop", &dst); err != nil {
|
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRInterop", &dst); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1,62 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package netframework_clrjit
|
package netframework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/yusufpapurcu/wmi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const Name = "netframework_clrjit"
|
func (c *Collector) buildClrJIT() {
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRJit metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
wmiClient *wmi.Client
|
|
||||||
|
|
||||||
numberOfMethodsJitted *prometheus.Desc
|
|
||||||
timeInJit *prometheus.Desc
|
|
||||||
standardJitFailures *prometheus.Desc
|
|
||||||
totalNumberOfILBytesJitted *prometheus.Desc
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
|
||||||
return []string{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close(_ *slog.Logger) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, _ *wmi.Client) error {
|
|
||||||
c.numberOfMethodsJitted = prometheus.NewDesc(
|
c.numberOfMethodsJitted = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "jit_methods_total"),
|
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.",
|
"Displays the total number of methods JIT-compiled since the application started. This counter does not include pre-JIT-compiled methods.",
|
||||||
@@ -81,23 +32,6 @@ func (c *Collector) Build(_ *slog.Logger, _ *wmi.Client) error {
|
|||||||
[]string{"process"},
|
[]string{"process"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
|
||||||
logger = logger.With(slog.String("collector", Name))
|
|
||||||
if err := c.collect(ch); err != nil {
|
|
||||||
logger.Error("failed collecting win32_perfrawdata_netframework_netclrjit metrics",
|
|
||||||
slog.Any("err", err),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Win32_PerfRawData_NETFramework_NETCLRJit struct {
|
type Win32_PerfRawData_NETFramework_NETCLRJit struct {
|
||||||
@@ -112,7 +46,7 @@ type Win32_PerfRawData_NETFramework_NETCLRJit struct {
|
|||||||
TotalNumberofILBytesJitted uint32
|
TotalNumberofILBytesJitted uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectClrJIT(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_NETFramework_NETCLRJit
|
var dst []Win32_PerfRawData_NETFramework_NETCLRJit
|
||||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRJit", &dst); err != nil {
|
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRJit", &dst); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1,74 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package netframework_clrloading
|
package netframework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/yusufpapurcu/wmi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const Name = "netframework_clrloading"
|
func (c *Collector) buildClrLoading() {
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRLoading metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
wmiClient *wmi.Client
|
|
||||||
|
|
||||||
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(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
|
||||||
return []string{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close(_ *slog.Logger) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|
||||||
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
|
||||||
return errors.New("wmiClient or SWbemServicesClient is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
c.wmiClient = wmiClient
|
|
||||||
|
|
||||||
c.bytesInLoaderHeap = prometheus.NewDesc(
|
c.bytesInLoaderHeap = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "loader_heap_size_bytes"),
|
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.",
|
"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.",
|
||||||
@@ -123,23 +62,6 @@ func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|||||||
[]string{"process"},
|
[]string{"process"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
|
||||||
logger = logger.With(slog.String("collector", Name))
|
|
||||||
if err := c.collect(ch); err != nil {
|
|
||||||
logger.Error("failed collecting win32_perfrawdata_netframework_netclrloading metrics",
|
|
||||||
slog.Any("err", err),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Win32_PerfRawData_NETFramework_NETCLRLoading struct {
|
type Win32_PerfRawData_NETFramework_NETCLRLoading struct {
|
||||||
@@ -163,7 +85,7 @@ type Win32_PerfRawData_NETFramework_NETCLRLoading struct {
|
|||||||
TotalNumberofLoadFailures uint32
|
TotalNumberofLoadFailures uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectClrLoading(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_NETFramework_NETCLRLoading
|
var dst []Win32_PerfRawData_NETFramework_NETCLRLoading
|
||||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRLoading", &dst); err != nil {
|
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRLoading", &dst); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1,72 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package netframework_clrlocksandthreads
|
package netframework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/yusufpapurcu/wmi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const Name = "netframework_clrlocksandthreads"
|
func (c *Collector) buildClrLocksAndThreads() {
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
wmiClient *wmi.Client
|
|
||||||
|
|
||||||
currentQueueLength *prometheus.Desc
|
|
||||||
numberOfCurrentLogicalThreads *prometheus.Desc
|
|
||||||
numberOfCurrentPhysicalThreads *prometheus.Desc
|
|
||||||
numberOfCurrentRecognizedThreads *prometheus.Desc
|
|
||||||
numberOfTotalRecognizedThreads *prometheus.Desc
|
|
||||||
queueLengthPeak *prometheus.Desc
|
|
||||||
totalNumberOfContentions *prometheus.Desc
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
|
||||||
return []string{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close(_ *slog.Logger) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|
||||||
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
|
||||||
return errors.New("wmiClient or SWbemServicesClient is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
c.wmiClient = wmiClient
|
|
||||||
|
|
||||||
c.currentQueueLength = prometheus.NewDesc(
|
c.currentQueueLength = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "current_queue_length"),
|
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.",
|
"Displays the total number of threads that are currently waiting to acquire a managed lock in the application.",
|
||||||
@@ -109,23 +50,6 @@ func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|||||||
[]string{"process"},
|
[]string{"process"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
|
||||||
logger = logger.With(slog.String("collector", Name))
|
|
||||||
if err := c.collect(ch); err != nil {
|
|
||||||
logger.Error("failed collecting win32_perfrawdata_netframework_netclrlocksandthreads metrics",
|
|
||||||
slog.Any("err", err),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads struct {
|
type Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads struct {
|
||||||
@@ -143,7 +67,7 @@ type Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads struct {
|
|||||||
TotalNumberofContentions uint32
|
TotalNumberofContentions uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectClrLocksAndThreads(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads
|
var dst []Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads
|
||||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads", &dst); err != nil {
|
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads", &dst); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1,77 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package netframework_clrmemory
|
package netframework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/yusufpapurcu/wmi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const Name = "netframework_clrmemory"
|
func (c *Collector) buildClrMemory() {
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRMemory metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
wmiClient *wmi.Client
|
|
||||||
|
|
||||||
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(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
|
||||||
return []string{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close(_ *slog.Logger) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|
||||||
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
|
||||||
return errors.New("wmiClient or SWbemServicesClient is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
c.wmiClient = wmiClient
|
|
||||||
|
|
||||||
c.allocatedBytes = prometheus.NewDesc(
|
c.allocatedBytes = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "allocated_bytes_total"),
|
prometheus.BuildFQName(types.Namespace, Name, "allocated_bytes_total"),
|
||||||
"Displays the total number of bytes allocated on the garbage collection heap.",
|
"Displays the total number of bytes allocated on the garbage collection heap.",
|
||||||
@@ -144,23 +80,6 @@ func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|||||||
[]string{"process"},
|
[]string{"process"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
|
||||||
logger = logger.With(slog.String("collector", Name))
|
|
||||||
if err := c.collect(ch); err != nil {
|
|
||||||
logger.Error("failed collecting win32_perfrawdata_netframework_netclrmemory metrics",
|
|
||||||
slog.Any("err", err),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Win32_PerfRawData_NETFramework_NETCLRMemory struct {
|
type Win32_PerfRawData_NETFramework_NETCLRMemory struct {
|
||||||
@@ -197,7 +116,7 @@ type Win32_PerfRawData_NETFramework_NETCLRMemory struct {
|
|||||||
PromotedMemoryfromGen1 uint64
|
PromotedMemoryfromGen1 uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectClrMemory(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_NETFramework_NETCLRMemory
|
var dst []Win32_PerfRawData_NETFramework_NETCLRMemory
|
||||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRMemory", &dst); err != nil {
|
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRMemory", &dst); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1,71 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package netframework_clrremoting
|
package netframework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/yusufpapurcu/wmi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const Name = "netframework_clrremoting"
|
func (c *Collector) buildClrRemoting() {
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRRemoting metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
wmiClient *wmi.Client
|
|
||||||
|
|
||||||
channels *prometheus.Desc
|
|
||||||
contextBoundClassesLoaded *prometheus.Desc
|
|
||||||
contextBoundObjects *prometheus.Desc
|
|
||||||
contextProxies *prometheus.Desc
|
|
||||||
contexts *prometheus.Desc
|
|
||||||
totalRemoteCalls *prometheus.Desc
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
|
||||||
return []string{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close(_ *slog.Logger) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|
||||||
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
|
||||||
return errors.New("wmiClient or SWbemServicesClient is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
c.wmiClient = wmiClient
|
|
||||||
|
|
||||||
c.channels = prometheus.NewDesc(
|
c.channels = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "channels_total"),
|
prometheus.BuildFQName(types.Namespace, Name, "channels_total"),
|
||||||
"Displays the total number of remoting channels registered across all application domains since application started.",
|
"Displays the total number of remoting channels registered across all application domains since application started.",
|
||||||
@@ -102,23 +44,6 @@ func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|||||||
[]string{"process"},
|
[]string{"process"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
|
||||||
logger = logger.With(slog.String("collector", Name))
|
|
||||||
if err := c.collect(ch); err != nil {
|
|
||||||
logger.Error("failed collecting win32_perfrawdata_netframework_netclrremoting metrics",
|
|
||||||
slog.Any("err", err),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Win32_PerfRawData_NETFramework_NETCLRRemoting struct {
|
type Win32_PerfRawData_NETFramework_NETCLRRemoting struct {
|
||||||
@@ -133,7 +58,7 @@ type Win32_PerfRawData_NETFramework_NETCLRRemoting struct {
|
|||||||
TotalRemoteCalls uint32
|
TotalRemoteCalls uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectClrRemoting(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_NETFramework_NETCLRRemoting
|
var dst []Win32_PerfRawData_NETFramework_NETCLRRemoting
|
||||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRRemoting", &dst); err != nil {
|
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRRemoting", &dst); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1,68 +1,13 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package netframework_clrsecurity
|
package netframework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/yusufpapurcu/wmi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const Name = "netframework_clrsecurity"
|
func (c *Collector) buildClrSecurity() {
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI Win32_PerfRawData_NETFramework_NETCLRSecurity metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
wmiClient *wmi.Client
|
|
||||||
|
|
||||||
numberLinkTimeChecks *prometheus.Desc
|
|
||||||
timeInRTChecks *prometheus.Desc
|
|
||||||
stackWalkDepth *prometheus.Desc
|
|
||||||
totalRuntimeChecks *prometheus.Desc
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
|
||||||
return []string{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close(_ *slog.Logger) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|
||||||
if wmiClient == nil || wmiClient.SWbemServicesClient == nil {
|
|
||||||
return errors.New("wmiClient or SWbemServicesClient is nil")
|
|
||||||
}
|
|
||||||
|
|
||||||
c.wmiClient = wmiClient
|
|
||||||
c.numberLinkTimeChecks = prometheus.NewDesc(
|
c.numberLinkTimeChecks = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "link_time_checks_total"),
|
prometheus.BuildFQName(types.Namespace, Name, "link_time_checks_total"),
|
||||||
"Displays the total number of link-time code access security checks since the application started.",
|
"Displays the total number of link-time code access security checks since the application started.",
|
||||||
@@ -87,23 +32,6 @@ func (c *Collector) Build(_ *slog.Logger, wmiClient *wmi.Client) error {
|
|||||||
[]string{"process"},
|
[]string{"process"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
|
||||||
logger = logger.With(slog.String("collector", Name))
|
|
||||||
if err := c.collect(ch); err != nil {
|
|
||||||
logger.Error("failed collecting win32_perfrawdata_netframework_netclrsecurity metrics",
|
|
||||||
slog.Any("err", err),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Win32_PerfRawData_NETFramework_NETCLRSecurity struct {
|
type Win32_PerfRawData_NETFramework_NETCLRSecurity struct {
|
||||||
@@ -117,7 +45,7 @@ type Win32_PerfRawData_NETFramework_NETCLRSecurity struct {
|
|||||||
TotalRuntimeChecks uint32
|
TotalRuntimeChecks uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collect(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectClrSecurity(ch chan<- prometheus.Metric) error {
|
||||||
var dst []Win32_PerfRawData_NETFramework_NETCLRSecurity
|
var dst []Win32_PerfRawData_NETFramework_NETCLRSecurity
|
||||||
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRSecurity", &dst); err != nil {
|
if err := c.wmiClient.Query("SELECT * FROM Win32_PerfRawData_NETFramework_NETCLRSecurity", &dst); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package netframework_clrexceptions_test
|
package netframework_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrexceptions"
|
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework"
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
func BenchmarkCollector(b *testing.B) {
|
||||||
// No context name required as Collector source is WMI
|
// No context name required as Collector source is WMI
|
||||||
testutils.FuncBenchmarkCollector(b, netframework_clrexceptions.Name, netframework_clrexceptions.NewWithFlags)
|
testutils.FuncBenchmarkCollector(b, netframework.Name, netframework.NewWithFlags)
|
||||||
}
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package netframework_clrinterop_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrinterop"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
|
||||||
// No context name required as collector source is WMI
|
|
||||||
testutils.FuncBenchmarkCollector(b, netframework_clrinterop.Name, netframework_clrinterop.NewWithFlags)
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package netframework_clrjit_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrjit"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
|
||||||
// No context name required as collector source is WMI
|
|
||||||
testutils.FuncBenchmarkCollector(b, netframework_clrjit.Name, netframework_clrjit.NewWithFlags)
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package netframework_clrloading_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrloading"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
|
||||||
// No context name required as collector source is WMI
|
|
||||||
testutils.FuncBenchmarkCollector(b, netframework_clrloading.Name, netframework_clrloading.NewWithFlags)
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package netframework_clrlocksandthreads_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrlocksandthreads"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
|
||||||
// No context name required as collector source is WMI
|
|
||||||
testutils.FuncBenchmarkCollector(b, netframework_clrlocksandthreads.Name, netframework_clrlocksandthreads.NewWithFlags)
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package netframework_clrmemory_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrmemory"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
|
||||||
// No context name required as collector source is WMI
|
|
||||||
testutils.FuncBenchmarkCollector(b, netframework_clrmemory.Name, netframework_clrmemory.NewWithFlags)
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package netframework_clrremoting_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrremoting"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
|
||||||
// No context name required as collector source is WMI
|
|
||||||
testutils.FuncBenchmarkCollector(b, netframework_clrremoting.Name, netframework_clrremoting.NewWithFlags)
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package netframework_clrsecurity_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/collector/netframework_clrsecurity"
|
|
||||||
"github.com/prometheus-community/windows_exporter/pkg/testutils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
|
||||||
// No context name required as collector source is WMI
|
|
||||||
testutils.FuncBenchmarkCollector(b, netframework_clrsecurity.Name, netframework_clrsecurity.NewWithFlags)
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user