This fix ensures that network stats for containerd on Windows are successfully collected. Before this change, other container stats such as CPU and memory are successfully collected, but network stats are failing for containerd.
The root cause is that the code for collecting network stats was originally written to work with docker which relies on v1 schema. After dockershim removal as Kubernetes's container runtime, containerd adoption has increased and this error is more frequently encountered when using containerd as the runtime. containerd uses v2 schema whereby the network stats need to be queried from the HNS component.
Signed-off-by: Tatenda Zifudzi <tzifudzi@amazon.com>
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>