Perflib often exposes duplicate IIS entries, suffixed with '#' and a
number (I.E. iis_site_name#1).
These duplicate entries were causing the exporter to fail scraping due
to duplicate metrics.
Based on user feedback, the entry with the highest suffix
value is kept, with other duplicate entries discarded.
E.G. Given the following list of site names, "Site_B" would be
discarded, and "Site_B#2" would be kept and presented as "Site_B" in the
collector metrics.
[ "Site_A", "Site_B", "Site_C", "Site_B#2" ]
Signed-off-by: Ben Reedy <breed808@breed808.com>
Collector builder functions are only used internally in the `collector`
package, and shouldn't needlessly be exposed as part of the package API
to downstream clients.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Behaviour of init functions has been centralised in `collector/init.go`,
and can be called during exporter startup. This allows the exporter to
control the timing of collector initialisation, rather than relying on
the import & `init()` method.
This should reduce unexpected behaviour arising from the use of
`init()`, such as #551.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Bumps [github.com/alecthomas/kingpin](https://github.com/alecthomas/kingpin) from
v2.2.6 to v2.3.2.
This also changes the upstream package name from
gopkg.in/alecthomas/kingpin.v2 to github.com/alecthomas/kingpin/v2 which
is required by the upstream exporter-toolkit package.
Signed-off-by: Ben Reedy <breed808@breed808.com>
This includes a move from github.com/StackExchange/wmi to
github.com/yusufpapurcu/wmi, as the StackExchange repository has been
archived.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Signed-off-by: Tom Powell <t.powell@mwam.com>
Added collector for VMware Blast session metrics
Signed-off-by: Tom Powell <t.powell@mwam.com>
Updating collection logic to handle missing WMI classes
Signed-off-by: Tom Powell <t.powell@mwam.com>
Updating packet loss metric to gauge
Signed-off-by: Tom Powell <t.powell@mwam.com>
This change adds 4 new CPU related metrics:
* process_mperf_total
* processor_rtc_total
* processor_utility_total
* processor_privileged_utility_total
and renames the existing process_performance to
processor_performance_total, since it was previously misunderstood and
was unlikely to be have been useful without the above new metrics
The data sources for these are not particularly well understood, and the
examples show that in some cases, arbitrary scaling factors are required
to actually make them useful, but in my testing on hundreds of systems
with a broad range of CPUs and operating systems from 2012r2 through to
2019 has proved out that we can use them to accurately display actual
CPU frequencies and CPU utilisation as it is represented in taskmgr.
Things I don't particularly like and would like input on:
* I would have preferred to do the scaling of processor_mperf_total in
the code, but there isn't an elegant way of doing this right now.
* Maybe processor_mperf_total should be called
processor_mperformance_total.
See #787 for discussion.
Signed-off-by: Steffen Higel <higels@valvesoftware.com>
OLE objects must be manually cleared or released to prevent leaks.
Note that these objects do not appear in the heap, so the pprof heap
profiles aren't helpful in identifying OLE leaks.
Resident memory continues to increase if objects are not properly cleared.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Collector would previously break from loop rather than skip nameless
entries, with the additional result of spamming event logs.
Signed-off-by: Ben Reedy <breed808@breed808.com>
UpdateDomain metric not exists as we can see in https://docs.microsoft.com/en-us/previous-versions/windows/desktop/cluswmi/mscluster-resourcegroup, just removing from mscluster_resourcegroup.go
When execute windows_exporter.exe with this metric we get this error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x60 pc=0xaad61d]
goroutine 66 [running]:
github.com/prometheus/client_golang/prometheus.NewConstMetric(0xc00009de30?, 0x2?, 0x3ff0000000000000?, {0xc000387730?, 0x1?, 0x1?})
C:/Users/ricar/go/pkg/mod/github.com/prometheus/client_golang@v1.12.2/prometheus/value.go:88 +0x1d
github.com/prometheus/client_golang/prometheus.MustNewConstMetric(...)
C:/Users/ricar/go/pkg/mod/github.com/prometheus/client_golang@v1.12.2/prometheus/value.go:105
github.com/prometheus-community/windows_exporter/collector.(*MSCluster_ResourceGroupCollector).Collect(0xc000552000, 0x0?, 0x0?)
E:/Downloads/Prometheus/windows_exporter/windows_exporter/collector/mscluster_resourcegroup.go:240 +0xdfb
main.execute({0xc00006e0c6, 0x17}, {0xef6420, 0xc000552000}, 0x0?, 0x0?)
E:/Downloads/Prometheus/windows_exporter/windows_exporter/exporter.go:199 +0x84
main.windowsCollector.Collect.func2({0xc00006e0c6, 0x17}, {0xef6420?, 0xc000552000?})
E:/Downloads/Prometheus/windows_exporter/windows_exporter/exporter.go:140 +0x9b
created by main.windowsCollector.Collect
E:/Downloads/Prometheus/windows_exporter/windows_exporter/exporter.go:138 +0x5c5
Signed-off-by: Alex Wiedermann <alexwdrnn@gmail.com>