Commit Graph

209 Commits

Author SHA1 Message Date
Ben Reedy 5a57da53be
Replace deprecated log lib in remaining collectors
Some collectors were missed when migrating to the local
github.com/prometheus-community/windows_exporter/log library.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-06-12 11:57:40 +10:00
Ben Reedy 0fb7eec670
Remove hard-coded "Computer Queues" filter
msmq collector would only collect from a hard-coded "Computer Queues"
queue.
Removal of filter allows other queues to be queried with
the collector.msmq.msmq-where flag.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-05-16 14:53:54 +10:00
Ben Reedy a2c4bf6a2d
Add benchmark for each collector
Benchmarks will allow for easier identification of slow collectors.
Additionally, they increase test coverage of the collectors, with some
collectors now reaching 80-95% coverage with this change.

Collector benchmarks have been structed so that common functionality is
present in `collector/collector_test.go` as is done with non-test
functionality in `collector/collector.go`.
Test logic that is specific to individual collectors is present in the
collector test file (E.G. `collector/process_test.go` for the Process
collector).

Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-04-01 22:28:54 +10:00
Ben Ridley 33c6b2c6a5 Address GitHub feedback
- Defer registry close calls
- Ensure size parameter in GetComputerName is properly specified
- Clean up some comments to ensure correctness

Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-29 10:13:36 -07:00
Ben Ridley 05f0f6f688 Add idiomatic wrappers to be exposed publically, and hide low-level
WinAPI operations

Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
Ben Ridley d947d0f6db Refactor remaining sysinfoapi calls into header package
Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
Ben Ridley d063bc0842 Add correct scrape context to OS benchmark
Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
retryW dd473c4807 Fixed paging free bytes
moved

Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
retryW 7bd58abd27 Converted PagingFreeBytes to use perflib
Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
retryW 6f941044c7 Change Sprintf interpolation to use explicit types
Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
retryW 3da11645cf added os_test.go and removed wmi for testing
Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
retryW 048bff919e Converted most metrics to non-wmi
Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
retryW f76334213d Convert os time and timezone from WMI to native go
Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
Ben Ridley 71054ac429 Replace the CS collector with native WinAPI calls to sysinfoapi
Signed-off-by: Ben Ridley <benridley29@gmail.com>
2021-03-18 16:18:47 -07:00
Ben Reedy ce0513f69d
Move experimental warnings from init()
init() causes warnings to be emitted despite collectors not being enabled.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-02-20 09:03:42 +10:00
Ben Reedy ee146b3710
Merge pull request #726 from higels/cpu_info_collector
Add a cpu_info collector
2021-02-20 08:55:06 +10:00
Calle Pettersson d54aa033b1
Merge pull request #723 from breed808/cache_collector
Cache collector
2021-02-19 09:44:24 +01:00
Ben Reedy 3682c1b9af
Rewrite cache collector to use perflib
Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-02-19 18:29:37 +10:00
Ben Reedy 5af2a781cb
Merge pull request #693 from SuperQ/https
Add HTTPS configuration
2021-02-19 18:20:06 +10:00
Steffen Higel 7086e0f627 Add a cpu_info collector
The cpu_info collector exposes a single metric per socket with some
information on installed CPUs, somewhat like the node_cpu_info metric

Signed-off-by: Steffen Higel <higels@valvesoftware.com>
2021-02-15 17:13:58 -08:00
Bagdon, Bill c1fff498c6
Create cache collector
Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-02-12 18:13:01 +10:00
Ben Reedy e9abe4d5f5
Ensure dfsr collector metric names are unique
Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-02-08 09:38:29 +10:00
Ben Reedy 0af38ddbcf
Merge pull request #716 from jsturtevant/add-containerd-support
Set container collector prefix based on owner property
2021-02-05 07:39:51 +10:00
James Sturtevant b615301efc set prefix based on owner property
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2021-02-04 09:41:59 -08:00
Ben Reedy b9b60f1ea0
Merge pull request #710 from breed808/dfsr_descriptions
Add missing dfsr metric descriptions
2021-02-02 13:45:37 +10:00
Calle Pettersson c5a545540d Take over prometheus/common/log into local log package
Signed-off-by: Calle Pettersson <carlpett@users.noreply.github.com>
2021-01-30 11:53:51 +01:00
Ben Reedy e141e531ed
Remove unused dfsr meta metrics and function
Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-01-30 18:56:45 +10:00
Ben Reedy b44d855fe0
Add missing dfsr metric descriptions
Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-01-30 17:10:37 +10:00
Ben Reedy 556138189a
Remove "total" suffix from dns_memory_used_bytes
Metric is a gauge and therefore should not have the "total" suffix.
2021-01-27 07:24:23 +10:00
Ben Reedy 8407f4aeb8
Document version requirement for time collector
Windows Server 2016 or newer is required for the collector, as the
perflib counters were not exposed in previous versions.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2021-01-17 10:57:51 +10:00
Ben Reedy 59ba77b87f
Rename mssql instance label to mssql_instance
Instance label is conflicting with default Prometheus "instance" label
which is added when scraping targets.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-12-31 09:36:36 +10:00
Ben Reedy 9d03debcb6
Add experimental notice to dfsr collector
Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-12-20 12:10:38 +10:00
Ben Reedy 2837bdfb50
Add/move DFSR metric units to end of metric name
Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-12-09 19:55:14 +10:00
Ben Reedy a1a986f4d0
Reset mssql child failure counter on each scrape
Resolves issue where collector would always return a failure after an
inital failure, as the counter was not reset.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-12-09 19:55:14 +10:00
Ben Reedy 769b15eb86
Execute DFSR child collectors serially
Previous concurrent setup was not required due to speed of Perflib
collectors.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-12-09 19:55:13 +10:00
Ben Reedy b5ce53fdac
Merge mssql and dfsr expandEnabledCollectors func
Move to common collector.go and add function test.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-12-09 19:55:13 +10:00
Ben Reedy ccac306c2d
Rewrite DFSR collector to use sub collectors
DFSR collector now follow similar structure to the MSSQL collector,
where several 'child' collectors are run concurrently, depending on user
input from the `--collectors.dfsr.sources-enabled` flag.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-12-09 19:55:13 +10:00
Ben Reedy df0618e64d
Add DFSR collectors
Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-12-09 19:55:13 +10:00
Ben Reedy ec6b7210e3 Fix network collector metric names
Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-11-30 09:21:09 +10:00
Ben Reedy 704f6e2fe4 Fix ADFS collector metric names
Prometheus counters should have a '_total' suffix

Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-11-30 09:21:09 +10:00
Ben Reedy 23dafc93ed Add SMTP collector
Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-11-23 12:29:01 +10:00
Björn Fischer a4aef9b3c7
adds whitelist for exchange collectors (#642)
adds enable flag for exchange collectors

Signed-off-by: Björn Fischer <bfischer@inovex.de>
2020-11-01 18:26:14 +01:00
Ben Reedy cdfe3cf258 Add Windows Time Service collector
Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-10-26 19:09:25 +10:00
Calle Pettersson 24fe6813b2
Merge pull request #632 from prometheus-community/fix-hyperv-panic
Fix panic in HyperV collector on input format mismatch
2020-10-26 09:01:37 +01:00
Ben Reedy 7eab1fc411 Set mssql transactions_active to Gauge.
Change also renames metric to avoid confusion.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2020-10-23 06:42:48 +10:00
Calle Pettersson 49c082d594 Fix panic in HyperV collector on input format mismatch
Signed-off-by: Calle Pettersson <carlpett@users.noreply.github.com>
2020-10-19 18:02:51 +02:00
Michael Allen 94bda6aa79 Expose TCPv6 performance counters in the tcp collector
Signed-off-by: Michael Allen <MAllen@laserfiche.com>
2020-10-08 11:43:39 -07:00
Michael Allen 380eff24c9 Convert the tcp collector to use perflib instead of WMI
Using perflib is substantially faster and more reliable than using WMI to
retrieve Windows performance counter data.

Signed-off-by: Michael Allen <MAllen@laserfiche.com>
2020-10-07 22:25:58 -07:00
Michael Allen a3867b8dbf Correct a typo where "perflib" was misspelled in a struct field tag
Signed-off-by: Michael Allen <MAllen@laserfiche.com>
2020-09-06 18:26:02 -07:00
Michael Allen 3b2ef6287c Rename MSSQL metrics data structs for clarity
The old names were hard to read, but had to be named as such to work with
the WMI library. Now that raw performance counter data are used instead of
WMI, we are free to name the data structs freely.

Signed-off-by: Michael Allen <MAllen@laserfiche.com>
2020-09-03 17:38:55 -07:00