Compare commits

...

1101 Commits

Author SHA1 Message Date
Dominik Eisenberg
ec6f705410 os: rename install_time_timestamp to install_time_timestamp_seconds (#2315)
Co-authored-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
2026-02-04 13:23:28 +01:00
renovate[bot]
7119da5cf5 fix(deps): update golang.org/x/ (#2311)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 16:14:03 +00:00
renovate[bot]
856c108e7f fix(deps): update module github.com/bmatcuk/doublestar/v4 to v4.10.0 (#2312)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 16:10:39 +00:00
renovate[bot]
eaecea7797 chore(deps): update module github.com/coreos/go-systemd/v22 to v22.7.0 (#2310)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 17:07:14 +01:00
renovate[bot]
a95df3d6f2 chore(deps): update module github.com/golang-jwt/jwt/v5 to v5.3.1 (#2308)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 16:54:30 +01:00
renovate[bot]
3fcdaca34a chore(deps): update github actions (#2307)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 16:54:18 +01:00
Calle Pettersson
2a3f0ff9d9 Formalize retirement (#2303) 2026-01-27 12:05:07 +01:00
Jan-Otto Kröpke
7dcf0d3137 gpu: skip Microsoft Basic Render Driver metrics (#2275)
Co-authored-by: Elliot Nevills <elliotnev27@users.noreply.github.com>
2026-01-17 12:32:31 +01:00
renovate[bot]
b584539387 chore(deps): update actions/setup-go action to v6.2.0 (#2298)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 20:33:48 +01:00
renovate[bot]
7cec563af2 fix(deps): update module github.com/bmatcuk/doublestar/v4 to v4.9.2 (#2297)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 20:33:36 +01:00
renovate[bot]
f0d5fd9ba0 fix(deps): update module github.com/prometheus/exporter-toolkit to v0.15.1 (#2295)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-10 20:03:30 +01:00
renovate[bot]
2efe98d8ec fix(deps): update module github.com/prometheus/common to v0.67.5 (#2294)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-10 13:31:12 +01:00
Corporte Gadfly
5ab9019509 chore: Add sample dashboard (#2255) 2026-01-06 13:20:13 +00:00
renovate[bot]
2b4576ecd4 chore(deps): update github actions (major) (#2289)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-02 21:16:51 +01:00
Dominik Eisenberg
9a666ace81 cpu: add example query for Task Manager-style CPU utilization (#2286)
Co-authored-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
2025-12-30 16:00:24 +01:00
Dominik Eisenberg
27186f7e78 os: add system installation date to metrics (#2284)
Co-authored-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
2025-12-29 20:23:02 +01:00
PrometheusBot
0c1336b845 Synchronize common files from prometheus/prometheus (#2279) 2025-12-24 09:40:03 +00:00
PrometheusBot
f3e50f4db4 Synchronize common files from prometheus/prometheus (#2278) 2025-12-21 20:52:20 +00:00
renovate[bot]
04714a3fbd chore(deps): update docker/setup-buildx-action action to v3.12.0 (#2276)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-19 18:02:20 +01:00
renovate[bot]
43bd352cfd fix(deps): update golang.org/x/ (#2277)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-19 18:01:20 +01:00
renovate[bot]
6e831b0176 chore(deps): update module google.golang.org/protobuf to v1.36.11 (#2273)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-17 20:59:05 +01:00
renovate[bot]
84dc1977de chore(deps): update dependency golangci/golangci-lint to v2.7.2 (#2272)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-17 20:59:00 +01:00
renovate[bot]
a944cd02a8 chore(deps): update dependency golangci/golangci-lint to v2.7.1 (#2269)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-06 10:04:32 +01:00
renovate[bot]
65ac3585a3 chore(deps): update github actions (#2268)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-06 10:04:25 +01:00
renovate[bot]
0dbea50704 chore(deps): update docker/metadata-action action to v5.10.0 (#2264)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 18:27:51 +01:00
renovate[bot]
7585044277 chore(deps): update github actions (major) (#2265)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 18:27:40 +01:00
renovate[bot]
aaf22e7322 chore(deps): update module golang.org/x/oauth2 to v0.33.0 (#2262)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 15:34:20 +00:00
renovate[bot]
7671e42c70 fix(deps): update module github.com/prometheus/common to v0.67.4 (#2261)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 16:33:50 +01:00
renovate[bot]
1e16767afb chore(deps): update module golang.org/x/crypto to v0.45.0 [security] (#2257)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 16:30:00 +01:00
renovate[bot]
81ff006f08 chore(deps): update dependency golangci/golangci-lint to v2.6.2 (#2259)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 16:29:56 +01:00
renovate[bot]
7c586b204d chore(deps): update github actions (#2260)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 16:29:50 +01:00
buckleyGI
5351641287 docs: Fix metric name for Windows Disk Alerts (#2254) 2025-11-12 14:54:33 +01:00
renovate[bot]
462a495514 chore(deps): update docker/metadata-action action to v5.9.0 (#2253)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-07 18:59:17 +01:00
renovate[bot]
16ee024a1b chore(deps): update dependency golangci/golangci-lint to v2.6.1 (#2252)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-07 18:58:28 +01:00
PrometheusBot
afe1bfc29d Synchronize common files from prometheus/prometheus (#2251) 2025-11-06 18:35:21 +00:00
Szilard Parrag
ebbad8943b collector: fix race condition in Build() (#2250)
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-11-06 02:33:05 +00:00
renovate[bot]
3d0587d28c chore(deps): update dependency golangci/golangci-lint to v2.6.0 (#2246)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-11-02 19:41:27 +01:00
renovate[bot]
a523ef69fd chore(deps): update module github.com/prometheus/procfs to v0.19.2 (#2247)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 18:50:59 +01:00
Jan-Otto Kröpke
cd088325ef installer: remove repair option (#2243) 2025-11-02 17:40:39 +00:00
renovate[bot]
8fe118bff9 chore(deps): update github actions (major) (#2249)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 18:38:10 +01:00
Jan-Otto Kröpke
81051791e2 filetime: replace collector with file (#2244) 2025-11-02 18:38:01 +01:00
renovate[bot]
4fc7402985 chore(deps): update module golang.org/x/time to v0.14.0 (#2248)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 18:37:49 +01:00
renovate[bot]
52efb1c61c fix(deps): update module github.com/prometheus/common to v0.67.2 (#2245)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 18:37:38 +01:00
xieshujian
3a9e227bd9 file: add file collector to scrape file size and file modify time which can replace filetime collector (#2205)
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-11-02 18:27:34 +01:00
Johan Thomsen
ed11d8e8fa netframework: add process_id label to clrmemory (#2242) 2025-11-02 18:26:55 +01:00
renovate[bot]
402eb6ef4e chore(deps): update module github.com/prometheus/procfs to v0.18.0 (#2238)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-24 13:24:57 +00:00
renovate[bot]
767367edc4 fix(deps): update module github.com/prometheus/exporter-toolkit to v0.15.0 (#2239)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-24 15:20:30 +02:00
Jan-Otto Kröpke
370a42b79a Update documentation for collector update flags (#2235) 2025-10-17 22:46:45 +02:00
renovate[bot]
ccd977177c fix(deps): update module github.com/prometheus/common to v0.67.1 (#2228)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-10 15:34:29 +02:00
renovate[bot]
33fe157545 fix(deps): update golang.org/x/ (#2227)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-10 15:34:22 +02:00
renovate[bot]
9e32f62ca4 chore(deps): update dependency golangci/golangci-lint to v2.5.0 (#2220)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-10-06 03:30:11 +02:00
Jan-Otto Kröpke
c26c27a7f4 Fix collector flag names in documentation (#2225) 2025-10-05 15:26:29 +00:00
renovate[bot]
1f43ca4d8f chore(deps): update module google.golang.org/protobuf to v1.36.10 (#2223)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-05 17:01:42 +02:00
renovate[bot]
d818d96e07 chore(deps): update github actions (#2224) 2025-10-04 20:39:49 +02:00
Jan-Otto Kröpke
7c108ea5be thermalzone: deprecate collector (#2201) 2025-09-26 10:29:55 +00:00
Jan-Otto Kröpke
bbe0d1aba7 os: include installation type in Windows version retrieval (#2217) 2025-09-26 10:27:31 +00:00
Jan-Otto Kröpke
1394f2399d Update renovate.json (#2219) 2025-09-20 20:41:05 +02:00
PrometheusBot
f4d77803ea Synchronize common files from prometheus/prometheus (#2218) 2025-09-20 20:40:16 +02:00
renovate[bot]
a19af1b695 chore(deps): update github actions (major) (#2215)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-19 20:39:10 +02:00
renovate[bot]
95bf157049 fix(deps): update golang.org/x/ (#2214)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-19 20:39:02 +02:00
Jan-Otto Kröpke
9969618026 Update renovate.json (#2213) 2025-09-19 19:55:26 +02:00
PrometheusBot
f2e62c6f53 Synchronize common files from prometheus/prometheus (#2212) 2025-09-19 19:53:50 +02:00
renovate[bot]
a9b42ab3a4 fix(deps): update module github.com/prometheus/exporter-toolkit to v0.14.1 (#2210)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-19 14:23:10 +00:00
renovate[bot]
e778eea250 chore(deps): update actions/checkout action to v4.3.0 (#2211)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-19 14:22:56 +00:00
renovate[bot]
c0eb53812d chore(deps): update module google.golang.org/protobuf to v1.36.9 (#2209)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-19 16:19:18 +02:00
renovate[bot]
21d9fb057d chore(deps): update module go.yaml.in/yaml/v2 to v2.4.3 (#2208)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-19 16:19:10 +02:00
Jan-Otto Kröpke
f1772a742f pdh: added logging, if PDH CStatus is not valid (#2203) 2025-09-07 13:31:29 +02:00
renovate[bot]
fcf21bb600 fix(deps): update module github.com/prometheus/client_golang to v1.23.1 (#2199)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-05 21:37:06 +00:00
renovate[bot]
cd5f136079 chore(deps): update module google.golang.org/protobuf to v1.36.8 (#2198)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-05 18:52:32 +02:00
Jan-Otto Kröpke
4171ec17a5 chore: switch to go.yaml.in/yaml/v3 (#2196) 2025-09-04 23:50:27 +02:00
Karthik Panjaje
6289499dee docs: Fixed HTTP request metrics documentation (#2192) 2025-08-31 14:41:40 +00:00
Jan-Otto Kröpke
79917893d1 installer: set failureflag for Windows service (#2191) 2025-08-29 21:57:28 +02:00
Jan-Otto Kröpke
0b8a257b31 gpu: add device id label (#2186) 2025-08-28 06:36:10 +02:00
Jan-Otto Kröpke
71cedbc4d0 mi: remove callbacks (#2188) 2025-08-26 21:04:56 +02:00
Jan-Otto Kröpke
c8a4cb3806 mssql: expose correct patch level without restart (#2187) 2025-08-26 20:52:09 +02:00
Jan-Otto Kröpke
558629dff5 chore: update to go 1.25 (#2185) 2025-08-24 14:27:00 +02:00
Jan-Otto Kröpke
5a8ebf0c44 collector: support sub-second timeout values. (#2181) 2025-08-15 23:55:24 +02:00
PrometheusBot
acbabb926d Synchronize common files from prometheus/prometheus (#2180) 2025-08-15 20:34:45 +02:00
renovate[bot]
e37392c00b chore(deps): update dependency golangci/golangci-lint to v2.4.0 (#2179)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-15 16:43:04 +02:00
renovate[bot]
00d86ba792 chore(deps): update actions/checkout action to v4.3.0 (#2178)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-15 16:42:52 +02:00
renovate[bot]
691f64f5cc fix(deps): update golang.org/x/ (#2170)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-10 15:39:40 +02:00
renovate[bot]
19999dea49 chore(deps): update docker/login-action action to v3.5.0 (#2169)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-10 15:39:24 +02:00
renovate[bot]
c2df4d7514 chore(deps): update actions/download-artifact action to v5 (#2171)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-08 15:48:04 +02:00
renovate[bot]
8937a5ac91 chore(deps): update module google.golang.org/protobuf to v1.36.7 (#2168)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-08 15:30:46 +02:00
Jan-Otto Kröpke
930130f58a collector: Add disable flag (#2165)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-07 08:58:29 +02:00
Jan-Otto Kröpke
0e85959a4d installer: do not fail, if service can't be started. (#2163) 2025-08-03 20:11:57 +02:00
Jan-Otto Kröpke
6253bf812d process: Add flag to control the export of the process cmdline (#2153) 2025-08-03 20:09:03 +02:00
Jan-Otto Kröpke
6c2380bd04 installer: disable config file creation, if CONFIG_FILE is set to a non default location. (#2162) 2025-08-03 20:08:13 +02:00
Jan-Otto Kröpke
5266f9ebfe installer: add quote to avoid argument splitting (#2161) 2025-08-03 19:39:59 +02:00
renovate[bot]
6c9a5b66e2 chore(deps): update dependency golangci/golangci-lint to v2.3.1 (#2158)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-08-03 04:27:21 +02:00
renovate[bot]
c4ab8cb8a5 chore(deps): update docker/metadata-action action to v5.8.0 (#2159)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-01 21:01:20 +02:00
renovate[bot]
7bcaf81d26 fix(deps): update module github.com/prometheus/client_golang to v1.23.0 (#2160)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-01 20:49:03 +02:00
renovate[bot]
5f6ba2c6e7 fix(deps): update module github.com/bmatcuk/doublestar/v4 to v4.9.1 (#2157)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-01 15:47:11 +02:00
Jan-Otto Kröpke
75c85fbde1 docs: add note about property preferences (#2155) 2025-07-29 20:53:50 +02:00
Jan-Otto Kröpke
120c244313 docs: Update example_config.yml (#2152) 2025-07-28 22:53:13 +02:00
Jan-Otto Kröpke
0e2d78affe docs: allow backport PR title prefix. (#2142) 2025-07-20 02:30:42 +02:00
Jan-Otto Kröpke
f0591d85cd process: fix windows_process_start_time_seconds_timestamp return relative time on Windows Server 2019 (#2137) 2025-07-20 02:14:17 +02:00
Jan-Otto Kröpke
255b01f610 container: fix network metrics (#2136) 2025-07-17 21:07:55 +02:00
Jan-Otto Kröpke
ab7db07836 filetime: support windows paths (#2118) 2025-07-13 02:01:44 +02:00
Jan-Otto Kröpke
52056a5cd9 filetime: support case insensitive matching (#2132) 2025-07-12 23:51:40 +00:00
Jan-Otto Kröpke
524fea08c4 gpu: fix windows_gpu_info metric (#2130) 2025-07-13 01:05:59 +02:00
Jan-Otto Kröpke
6b8c895a68 container: fix memory leaks (#2129) 2025-07-11 20:10:45 +02:00
Jan-Otto Kröpke
eade0da514 config: fix lists (#2124) 2025-07-11 19:50:58 +02:00
renovate[bot]
b07e866b4a chore(deps): update dependency golangci/golangci-lint to v2.2.2 (#2126)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-11 19:50:19 +02:00
renovate[bot]
98618408ce fix(deps): update golang.org/x/ (#2127)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-11 18:33:04 +02:00
Jan-Otto Kröpke
56b9f7fd27 docs: strip readme to avoid dockerhub limitations (#2123) 2025-07-09 20:17:26 +02:00
Jan-Otto Kröpke
8d267336c1 Update README.md (#2121) 2025-07-08 18:17:07 +02:00
Jan-Otto Kröpke
fd7070354a cs: remove deprecated cs collector (#2115) 2025-07-05 15:47:57 +02:00
Jan-Otto Kröpke
373d741260 os: remove deprecated metrics (#2116) 2025-07-05 15:44:57 +02:00
Jan-Otto Kröpke
ed15b3c671 system: remove windows_system_boot_time_timestamp_seconds (#2112) 2025-07-05 15:40:09 +02:00
Jan-Otto Kröpke
f8805932b2 logon: remove logon collector. Use terminal_services instead. (#2114) 2025-07-05 15:34:04 +02:00
Jan-Otto Kröpke
4fd26fa0fa update: remove deprecated flags (#2113) 2025-07-05 15:32:59 +02:00
Jan-Otto Kröpke
bf722630d6 mssql: fix ratio based counter (#2096) 2025-07-05 00:20:28 +02:00
renovate[bot]
9320e992cc chore(deps): update dependency golangci/golangci-lint to v2.2.1 (#2110)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-07-05 00:08:07 +02:00
renovate[bot]
7a4e92a473 chore(deps): update module github.com/prometheus/procfs to v0.17.0 (#2111)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-04 21:51:47 +02:00
Szymon Sobocki
02b9ab4058 mssql: fix incorrect patch version in windows_mssql_instance_info (#2109) 2025-07-04 09:42:26 +00:00
Jan-Otto Kröpke
c3043693df fix: add missing concurrency lock (#2098) 2025-07-04 11:14:49 +02:00
Jan-Otto Kröpke
7377d48f07 iis: missing metrics if app-include is set. (#2103) 2025-07-02 16:32:29 +02:00
Jan-Otto Kröpke
d64f1316ca os: missing deprecated metric windows_os_processes (#2104) 2025-07-02 00:50:03 +02:00
Jan-Otto Kröpke
492f3af317 diskdrive: fix not exposing state "Pred Fail" (#2101) 2025-06-30 19:55:45 +02:00
nbav12
116203fd19 Update collector.mscluster.md (#2099) 2025-06-30 11:54:41 +02:00
Jan-Otto Kröpke
66751baef6 process: do not fail, if collector.process.iis is enabled and WMI WebAdministration is not present. (#2082) 2025-06-29 14:12:56 +02:00
renovate[bot]
b02bddd38e fix(deps): update module github.com/prometheus/common to v0.65.0 (#2095)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-27 15:30:59 +00:00
Jan-Otto Kröpke
3dbc19e18b docs: add note about Server 2012 (#2093) 2025-06-21 11:28:58 +02:00
renovate[bot]
be481e8776 chore(deps): update docker/setup-buildx-action action to v3.11.1 (#2088)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-20 15:40:55 +02:00
Jan-Otto Kröpke
aea5c5a2fb docs: Clearify Windows Server 2012R2 support (#2087) 2025-06-20 15:33:34 +02:00
Lapo Luchini
59ac3072b1 feat: increase time resolution when possible (collectors: os, system, time) (#2047) 2025-06-20 13:12:26 +02:00
Jan-Otto Kröpke
66cd489c4a dhcp: fix log level for dhcp server, if not present (#2086) 2025-06-20 10:15:14 +02:00
Jan-Otto Kröpke
4891e23d29 fix: added count checks (#2083) 2025-06-19 16:59:19 +02:00
Nic Jansma
f285c3d1e2 logical_disk: skip unmounted volumes (#2084) 2025-06-18 07:59:50 +02:00
Jan-Otto Kröpke
90dac66bf5 config: fix validation error with empty config files (#2080) 2025-06-16 19:53:14 +02:00
Jan-Otto Kröpke
34cfda306b logical_disk: add bitlocker status sub-collector (#2077) 2025-06-16 12:48:23 +02:00
Sanjeevi Subramani
3e8693f1e3 iis: Add HTTP Service Request Queues (#1948)
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-06-15 07:40:21 +02:00
renovate[bot]
036c858355 chore(deps): update golang.org/x/ (#2078)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-13 16:38:52 +02:00
Sam DeHaan
a69720ae1d docs: fix typo in dns docs subcollector name (#2073) 2025-06-05 01:14:51 +02:00
Jan-Otto Kröpke
55c877f536 gpu: add info metric about devices (#2070) 2025-06-04 22:49:59 +02:00
小荣
dcf85032ca gpu: add metrics collector and related types (#2052) (#2059) 2025-06-02 19:45:18 +02:00
Jan-Otto Kröpke
e673f192d2 process: add collector.process.counter-version CLI parameter (#2064) 2025-05-31 08:46:30 +02:00
Jan-Otto Kröpke
298d820bd6 time: expose clock source sync (#2058) 2025-05-30 19:52:27 +02:00
Jan-Otto Kröpke
89ac99e6a2 chore: Update renovate.json (#2069) 2025-05-29 22:09:05 +02:00
renovate[bot]
3e58d0e568 chore(deps): update docker/build-push-action action to v6.18.0 (#2067)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-29 22:05:57 +02:00
Jan-Otto Kröpke
5cf1f7e623 chore: Update renovate.json (#2068) 2025-05-29 22:05:47 +02:00
Jan-Otto Kröpke
0580b330a5 fix: Avoid COINIT_MULTITHREADED in CoInitializeEx (#2066) 2025-05-29 21:58:42 +02:00
PrometheusBot
25915bb289 Synchronize common files from prometheus/prometheus (#2061) 2025-05-26 22:23:17 +02:00
Jan-Otto Kröpke
5e1a802237 container: fix collector (#2057) 2025-05-24 11:29:52 +02:00
Jan-Otto Kröpke
6dd21a8e00 update: expose publish date of updates (#2050) 2025-05-23 21:18:29 +02:00
Jan-Otto Kröpke
92f213ca7c chore: fix test (#2055) 2025-05-23 08:12:25 +02:00
Jan-Otto Kröpke
ecd7dcfb0d service: report invalid parameter errors as debug (#2051) 2025-05-22 19:19:19 +02:00
Karl Persson
87d76b18e9 update: export properties so that they can be read from yaml file (#2053) 2025-05-22 16:22:06 +02:00
Jan-Otto Kröpke
068bcb7237 tcp: relax metrics collectos on error (#2041) 2025-05-20 15:37:01 +02:00
Jan-Otto Kröpke
898e16bcb1 container: support hostprocess containers and expose kubernetes labels (#1911) 2025-05-18 09:39:52 +02:00
Martin Costello
6b87441729 docs: Fix typo (#2042) 2025-05-18 07:50:31 +02:00
renovate[bot]
d31f21d5c6 fix(deps): update module github.com/microsoft/hcsshim to v0.13.0 (#2036)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-17 14:13:34 +02:00
renovate[bot]
c9fc0ee851 chore(deps): update github actions (#2034)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-17 14:10:45 +02:00
renovate[bot]
23894e0ac8 fix(deps): update golang.org/x/ (#2035)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-17 14:10:32 +02:00
renovate[bot]
36c68320e5 fix(deps): update module github.com/prometheus/common to v0.64.0 (#2037)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-17 14:10:24 +02:00
renovate[bot]
931754b39d chore(deps): update google.golang.org/genproto/googleapis/rpc digest to 5a2f75b (#2032)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-16 16:11:37 +00:00
renovate[bot]
c3739886d1 chore(deps): update module google.golang.org/grpc to v1.72.1 (#2033)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-16 18:03:01 +02:00
Jan-Otto Kröpke
9b41c805a5 docs: Remove CLI flag telemetry.max-requests and hardcoded to 1. (#2030) 2025-05-14 18:52:05 +00:00
Jan-Otto Kröpke
48d29d8563 terminal_services: Expose disconnected sessions agains (#2026) 2025-05-14 20:46:56 +02:00
Jan-Otto Kröpke
d899ae7e24 docs: add example about add cmdline to process metrics. (#2029) 2025-05-14 09:03:28 +00:00
renovate[bot]
bebc44c948 chore(config): migrate renovate config (#2027)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-13 23:12:46 +02:00
renovate[bot]
bd536e61cc chore(deps): update dependency golangci/golangci-lint to v2.1.6 (#2023)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-09 14:54:50 +02:00
renovate[bot]
ebc60503ae chore(deps): update google.golang.org/genproto/googleapis/rpc digest to f936aa4 (#2022)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-09 14:54:42 +02:00
renovate[bot]
055f4a56df chore(deps): update github actions (major) (#2017)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 09:23:36 +02:00
renovate[bot]
fd92bfc1c8 chore(deps): update google.golang.org/genproto/googleapis/rpc digest to 10db94c (#2012)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-01 22:27:18 +02:00
renovate[bot]
e584adaf7e chore(deps): update github actions (#2015)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-01 22:01:47 +02:00
renovate[bot]
2d31d604fb chore(deps): update dependency golangci/golangci-lint to v2.1.5 (#2013)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-01 22:01:40 +02:00
renovate[bot]
4d73502752 chore(deps): update module github.com/prometheus/procfs to v0.16.1 (#2014)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-01 22:01:30 +02:00
renovate[bot]
090eed2959 chore(deps): update module google.golang.org/grpc to v1.72.0 (#2016)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-01 22:01:15 +02:00
Jan-Otto Kröpke
769363d157 feat: Add config file validation (#2011) 2025-04-24 23:45:21 +02:00
Jan-Otto Kröpke
554607fee2 chore: Remove copyright dates (#2010) 2025-04-24 22:17:16 +02:00
Jan-Otto Kröpke
256399f25d service: fix inconsistent values for windows_service_start_mode (#2007) 2025-04-24 10:37:06 +02:00
renovate[bot]
4dcfb77587 chore(deps): update dependency golangci/golangci-lint to v2.1.2 (#2003)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-04-19 00:53:40 +02:00
rjb003
c47f32fb1f docs: fix metric name in example in collector.memory.md (#2004) 2025-04-18 20:20:44 +02:00
renovate[bot]
17f1f98179 chore(deps): update google.golang.org/genproto/googleapis/rpc digest to 207652e (#2002)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-18 18:32:15 +02:00
Matthew Wimpelberg
f0d5267874 dns: add enhanced metrics (#1999)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-04-18 13:25:05 +02:00
Jan-Otto Kröpke
85455bd04d exchange: fix The specified counter could not be found (#1994) 2025-04-14 17:34:20 +02:00
Jan-Otto Kröpke
f1f763bc79 docs: remove config.file.insecure-skip-verify (#1997) 2025-04-14 14:18:21 +02:00
renovate[bot]
c0af21eb1c fix(deps): update module github.com/prometheus/client_model to v0.6.2 (#1993)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-11 15:59:17 +02:00
renovate[bot]
eed95100ec chore(deps): update google.golang.org/genproto/googleapis/rpc digest to de1ac95 (#1992)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-11 15:58:49 +02:00
renovate[bot]
896c9439d5 fix(deps): update module github.com/prometheus/client_golang to v1.22.0 (#1988)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-10 01:04:51 +02:00
renovate[bot]
e00a3916b8 chore(deps): update module golang.org/x/net to v0.39.0 (#1987)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-10 01:04:40 +02:00
Melo
5294b61339 update: fix naming flags (renamed --collector.updates.* to --collector.update.*) (click PR number for more information) (#1986)
Signed-off-by: Melody Sofia Eroshevich <se@cloudeteer.de>
2025-04-10 00:38:52 +02:00
Melo
415c134f70 docs: Fix incorrect metric prefix in update collector documentation (#1985)
Signed-off-by: Melody Sofia Eroshevich <se@cloudeteer.de>
2025-04-09 16:49:40 +02:00
renovate[bot]
cb1769cacc chore(deps): update golang.org/x/ (#1982)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-06 21:51:45 +02:00
Jan-Otto Kröpke
ba605cffcc system: Metric windows_system_boot_time_timestamp returns a UNIX timestamp again. (#1967)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2025-04-06 11:57:14 +02:00
Jan-Otto Kröpke
bf56e99ad2 chore: Update Copyright (#1981)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-04-06 11:26:56 +02:00
Jan-Otto Kröpke
9db4318ea9 fix: windows_cpu_processor_utility_total is always 0 (#1966)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-04-05 22:20:07 +02:00
renovate[bot]
ef46cd1dbe fix(deps): update golang.org/x/ (#1980) 2025-04-05 20:54:52 +02:00
Yariv Amar
36b6afe4bb docs: update for #1964 (#1979)
Signed-off-by: Yariv Amar <yariv.amar@gmail.com>
2025-04-05 17:25:49 +02:00
renovate[bot]
6471f3985a chore(deps): update golangci/golangci-lint-action action to v7 (#1976)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-04-05 11:55:10 +02:00
Jan-Otto Kröpke
ecc805f0fa memory: fix panics if metrics does not exists (#1960)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-04-04 23:21:26 +02:00
renovate[bot]
88c929ac6f chore(deps): update module google.golang.org/protobuf to v1.36.6 (#1972)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-04 22:34:22 +02:00
renovate[bot]
c3dfd7f960 chore(deps): update google.golang.org/genproto/googleapis/rpc digest to ee84b53 (#1970)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-04 22:34:11 +02:00
renovate[bot]
a3e840f960 chore(deps): update module github.com/prometheus/procfs to v0.16.0 (#1973)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-04 22:33:43 +02:00
renovate[bot]
53849a3500 chore(deps): update github actions (#1969)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-04 22:33:25 +02:00
renovate[bot]
970976c61d chore(deps): update module google.golang.org/grpc to v1.71.1 (#1971)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-04 22:33:16 +02:00
renovate[bot]
26893d22df chore(deps): update module golang.org/x/net to v0.38.0 (#1974)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-04 22:33:06 +02:00
Jan-Otto Kröpke
5fcaa56a9c chore: Update renovate.json (#1968)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-04-04 20:59:58 +02:00
Jan-Otto Kröpke
0846c2805f logon: deprecate collector. Use terminal_services instead (#1957)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-04-04 20:20:08 +02:00
Jan-Otto Kröpke
fa8af098c8 mssql: support initial non default instances names (#1958) 2025-03-31 22:20:26 +02:00
Jan-Otto Kröpke
ad98d11326 net: expose operation status of nic (#1956)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-28 15:18:17 +01:00
Jan-Otto Kröpke
63efa92be7 service: fix windows.EnumServicesStatusEx reports buffer too small (#1954)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-27 07:26:51 +01:00
renovate[bot]
4c7df1ccaf chore(deps): update github actions (#1944)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-20 19:24:27 +01:00
PrometheusBot
19ccdc5731 Synchronize common files from prometheus/prometheus (#1949)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-03-20 18:04:26 +00:00
Jan-Otto Kröpke
2c548b8675 chore: Update question issue template (#1945)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-20 16:35:13 +01:00
Jan-Otto Kröpke
fdc79f675d chore: Add quay.io readme (#1946)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-20 16:33:15 +01:00
Jan-Otto Kröpke
041c2cd170 fix: return Windows 11 as product name, if build number is >= 22000 (#1935)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-19 22:50:54 +01:00
renovate[bot]
29307eb2b2 chore(deps): update dependency golangci/golangci-lint to v1.64.8 (#1943)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 20:46:10 +01:00
renovate[bot]
73ef2d9824 chore(deps): update github actions (#1942)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 20:11:56 +01:00
Jan-Otto Kröpke
d5112d7766 net: move net IP addresses from windows_net_nic_info to windows_net_nic_address_info and introduce mac addresses (#1940)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-15 13:27:19 +01:00
Jan-Otto Kröpke
bc1b40c679 hyperv: fix Windows Server 2016 compatibility (#1925)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-14 19:28:48 +01:00
Jan-Otto Kröpke
d58f8c59c6 chore: Update renovate.json (#1939)
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2025-03-14 12:02:33 +01:00
renovate[bot]
53a4e76a4b chore(deps): update docker/login-action digest to 74a5d14 (#1938)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-14 11:59:40 +01:00
Jan-Otto Kröpke
eecc6ce574 fix: buffer length panic (#1936)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-14 10:57:47 +01:00
Jan-Otto Kröpke
221cfec732 chore(deps): update dependency go to v1.24.1 (#1937)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-14 10:05:40 +01:00
Jan-Otto Kröpke
fce1e71cac chore: add quay.io registry (#1934)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-14 08:43:55 +01:00
renovate[bot]
2b96dd5c61 chore(deps): pin dependencies (#1930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-14 08:42:38 +01:00
renovate[bot]
a5cbfefc24 chore(deps): update dependency windows to v2022 (#1933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-14 08:40:40 +01:00
renovate[bot]
c14af0ab20 fix(deps): update module github.com/prometheus/common to v0.63.0 (#1932)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-14 08:39:36 +01:00
Jan-Otto Kröpke
4a67810832 chore: add renovate (#1928)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-14 08:31:23 +01:00
Jan-Otto Kröpke
eceec10237 config: remove remote config files (#1877)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2025-03-13 16:45:39 +01:00
Jan-Otto Kröpke
3f2633d0b0 fix: Support running as Windows Service within containers (#1907)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-12 08:46:41 +01:00
Jan-Otto Kröpke
5114a5466a process: rename windows_process_start_time -> windows_process_start_time_seconds_timestamp (#1858)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-12 08:45:40 +01:00
Jan-Otto Kröpke
d6196c5c6b time: windows_time_clock_frequency_adjustment_ppb_total -> windows_time_clock_frequency_adjustment_ppb and add windows_time_clock_frequency_adjustment metric for Win2016 (#1910)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2025-03-12 08:28:30 +01:00
Jan-Otto Kröpke
0c44a934f4 fix: update dependencies (#1920)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-11 10:46:14 +01:00
dependabot[bot]
d1151e91f3 chore(deps): bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 (#1919)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 15:52:45 +01:00
Jan-Otto Kröpke
cbe94c1ea5 netframework: fix metric names (re-add the collector sub-type to metrics) (#1908)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-03-01 17:22:59 +01:00
Jan-Otto Kröpke
b809f5a8ee docs: added examples for alternative installer dir (#1909)
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2025-03-01 00:17:48 +01:00
dependabot[bot]
756d9c160d chore(deps): bump github.com/prometheus/client_golang from 1.21.0-rc.0 to 1.21.0 (#1899)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 00:09:41 +01:00
Jan-Otto Kröpke
a0e132b30e terminal_services: fix panic in collect (#1906) 2025-02-28 07:53:23 +01:00
Jan-Otto Kröpke
d645e89be9 ci: fix checksum (#1905) 2025-02-28 07:53:10 +01:00
Jan-Otto Kröpke
a73a08d704 fix: log to the Windows temp directory if of service detection failures. (#1890) 2025-02-28 01:35:41 +01:00
Jan-Otto Kröpke
228164765b docs: fix physical_disk docs (#1897) 2025-02-22 08:29:52 +00:00
Jan-Otto Kröpke
4c9c78c599 time: fix panic if counters aren't present (#1898) 2025-02-22 09:29:02 +01:00
Jan-Otto Kröpke
4b3c154049 docs: add disk activity query. (#1889)
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2025-02-18 13:41:26 +01:00
Jan-Otto Kröpke
be0037eda5 ci: pin wix toolset version to avoid installing incompatible extensions (#1885)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-13 20:56:44 +01:00
Jan-Otto Kröpke
367fae95c4 mscluster: restore support for Windows Server 2016-2019 (#1882)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-12 21:03:24 +01:00
Jan-Otto Kröpke
96ffc3bf3f config: multiple web.listen-address args results into an error, if --config.file is defined. (#1876)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-12 20:30:12 +01:00
Jan-Otto Kröpke
285c4cc5ea feat: windows_exporter uses own event log source to correctly format messages. (#1873)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2025-02-10 18:57:31 +01:00
Jan-Otto Kröpke
f07aceb0dd cs: fix metric description (#1881)
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-10 18:23:35 +01:00
Jan-Otto Kröpke
dcacce4577 fix: sign binaries (#1878)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-09 22:34:55 +01:00
Jan-Otto Kröpke
fc5b3051fa feat: sign binaries (#1875)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-08 20:04:37 +01:00
Jan-Otto Kröpke
1b2958a7cc fix: slow stop if run as service (#1870)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-07 22:26:09 +01:00
Jan-Otto Kröpke
a20e1854d1 netframework: fix MI_RESULT_INVALID_QUERY (#1862)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-02 09:14:56 +01:00
Jan-Otto Kröpke
fe21cb44f6 installer: add validation for EXTRA_FLAGS (#1867)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-02-02 09:14:45 +01:00
Jan-Otto Kröpke
71ec0bd6a3 process: negative values with windows_process_start_time (#1857)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-30 20:30:08 +01:00
dependabot[bot]
8bff623393 chore(deps): bump actions/stale from 9.0.0 to 9.1.0 (#1860) 2025-01-27 20:14:42 +01:00
dependabot[bot]
3eabd0a00c chore(deps): bump github.com/bmatcuk/doublestar/v4 from 4.8.0 to 4.8.1 (#1859) 2025-01-27 20:14:07 +01:00
Jan-Otto Kröpke
73186cde48 installer: force close application on uninstall (#1854)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-23 16:43:36 +01:00
Jan-Otto Kröpke
25e04fc947 service: re-use buffer for return all services (#1853)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-23 16:43:17 +01:00
Jan-Otto Kröpke
6b7201856c fix: process priority setting (#1852)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-23 14:56:49 +01:00
Jan-Otto Kröpke
608b83cfd8 config: deprecate remote http configuration (#1849)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-21 08:59:08 +01:00
Hamed Mansouri
40a42ca457 docs: fix typo in README.md (#1844)
Signed-off-by: Hamed Mansouri <hamed0381@gmail.com>
2025-01-21 00:47:03 +01:00
dependabot[bot]
423c8a787e chore(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 (#1848)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 14:41:21 +00:00
dependabot[bot]
6cefbed7f7 chore(deps): bump github.com/bmatcuk/doublestar/v4 from 4.7.1 to 4.8.0 (#1846)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 15:35:43 +01:00
Jan-Otto Kröpke
5836a7dbf2 dhcp: add dhcp scope stats (#1840)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-20 12:03:03 +01:00
Jan-Otto Kröpke
d31ce0507c fix: Windows 11/Windows Server 2025 service compatibility (#1841)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-19 11:37:05 +01:00
Jan-Otto Kröpke
faa98d2708 Update LICENSE
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2025-01-19 11:21:40 +01:00
Jan-Otto Kröpke
f0f3d0d96e net: fix sanitize # on the nic label for windows_net_nic_address_info (#1839)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-17 13:34:21 +01:00
Jan-Otto Kröpke
f73a74b678 netframework: add --collector.netframework.enabled CLI flag (#1833)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-15 21:23:50 +01:00
Jan-Otto Kröpke
b6f89ad92f docs: add CONTRIBUTING.md docs (#1834)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-01-15 21:23:42 +01:00
Jan-Otto Kröpke
86e6d12518 performancecounter: Add the possibility to request formatted values (#1830) 2025-01-14 23:32:44 +01:00
dependabot[bot]
4cd9627ebf chore(deps): bump golang.org/x/sys from 0.28.0 to 0.29.0 (#1825)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-07 10:07:25 +01:00
Jan-Otto Kröpke
81ea4c6223 performancecounter: fix panic with counter names having brackets (#1822)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-12-27 22:12:23 +01:00
Jan-Otto Kröpke
78386557d4 iis: fix panic (#1820)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-12-22 13:13:25 +01:00
Jan-Otto Kröpke
a9f8b3b722 process: Use registry collector for V1 data (#1814)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-12-21 22:58:47 +01:00
dependabot[bot]
39c929eefe chore(deps): bump github.com/prometheus/exporter-toolkit from 0.13.1 to 0.13.2 (#1815)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 12:36:11 +01:00
Jan-Otto Kröpke
eea5a50d5c performancecounter: support yaml documents and tolerate collector errors (#1809)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-12-09 19:14:26 +01:00
dependabot[bot]
a9698e27bf chore(deps): bump golang.org/x/sys from 0.27.0 to 0.28.0 (#1811)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 15:22:17 +01:00
dependabot[bot]
fac83b3c74 chore(deps): bump github.com/prometheus/common from 0.60.1 to 0.61.0 (#1810)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 15:21:43 +01:00
Jan-Otto Kröpke
0fc926c0b0 Update collector.performancecounter.md
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-12-05 09:36:12 +01:00
Jan-Otto Kröpke
57a3e84cec process: fix metric labels for multiple process instances (#1804)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-12-03 18:31:41 +01:00
Jan-Otto Kröpke
2aebd5c2da process: fix metric labels for multiple process instances (#1803)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-12-03 12:07:03 +01:00
Jan-Otto Kröpke
109c34f572 chore: added tests (#1800)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-12-01 21:50:49 +01:00
Jan-Otto Kröpke
0ad8e01e0e mssql: add counter based on server version (#1799)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-12-01 18:20:44 +01:00
Jan-Otto Kröpke
3a3b50f898 chore: update deps (#1796)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-30 18:34:43 +01:00
Jan-Otto Kröpke
f5ff75ebc2 mssql: fix not collecting sql errors (#1793)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-30 13:10:11 +01:00
Jan-Otto Kröpke
71e5e5ec5f iis: Fix label for Default Web Site (#1792)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-30 13:02:00 +01:00
Jan-Otto Kröpke
40ff2f2e57 vmware: fix memory collector (#1791)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-30 12:13:35 +01:00
Jan-Otto Kröpke
9db94aa66a performancecounter: rename collector (#1787)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-30 11:24:01 +01:00
Jan-Otto Kröpke
a359acb3d1 logical_disk: fix volume access with limited permission (#1786)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-29 23:33:18 +01:00
Jan-Otto Kröpke
487de0c20b hyperv: Removed % Guest Idle Time performance counters (introduced in 0.30.0-beta.4) (#1785)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-29 22:19:22 +01:00
Jan-Otto Kröpke
aaa4ce07f6 system: BREAKING rename windows_system_system_up_time to windows_system_boot_time_timestamp_seconds (#1784)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-29 22:19:14 +01:00
Jan-Otto Kröpke
a2db81494e mssql: set windows_exporter_collector_success to 0, if errors occurs (#1777)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-27 00:14:53 +01:00
Jan-Otto Kröpke
64bf0a6551 collector: don't fail if perf counters are empty. (#1776)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-26 23:56:36 +01:00
Jan-Otto Kröpke
40b6f53479 textfile: set windows_exporter_collector_success to 0, if an errors occurs (#1775)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-26 23:47:23 +01:00
Jan-Otto Kröpke
ca04ad8fd2 fix: use log.file=eventlog as default value, if running as windows service (#1771)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-26 21:46:54 +01:00
Jan-Otto Kröpke
fd55ac4894 collector: refactor metrics handler (#1773)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-26 21:13:47 +01:00
Jan-Otto Kröpke
c8eeb595c0 feat: Support OpenMetrics (#1772)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-26 19:43:52 +01:00
Jan-Otto Kröpke
1a4c6c5ce7 feat: Tolerate collector failures (#1769)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-25 21:27:31 +01:00
dependabot[bot]
fd76be38e0 chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#1770)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 14:27:21 +01:00
Jan-Otto Kröpke
eff124250f chore: move exporter binary to cmd package (#1768)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-24 15:53:56 +01:00
Jan-Otto Kröpke
1badb34506 chore: fix copyright headers (#1767)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-24 14:11:14 +01:00
Jan-Otto Kröpke
f9e41294c3 mscluster: fix cluster and network sub collectors (#1759)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-24 13:57:19 +01:00
Jan-Otto Kröpke
86ace68978 msmq: Use Performance Counter instead WMI (#1766)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-24 13:38:24 +01:00
Jan-Otto Kröpke
e812584f27 smb: extend smb share metrics (#1765)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-24 13:18:14 +01:00
Jan-Otto Kröpke
1ecc340659 nps: refactor collector (#1764)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-24 11:38:36 +01:00
Jan-Otto Kröpke
4c0574536f collector: fix wrong perfdata instances (#1763)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-24 01:52:25 +01:00
Jan-Otto Kröpke
26d6dddf25 adfs: fix collector (#1761)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-24 00:39:38 +01:00
Jan-Otto Kröpke
75c6a4c182 collector: remove windows_exporter_perflib_snapshot_duration_seconds metric (#1760)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-22 21:10:00 +01:00
Jan-Otto Kröpke
a602d7be9d logical_disk: revert panic trigger on error (#1755)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-22 17:20:27 +01:00
Jan-Otto Kröpke
4534c2a6ae mssql: fix performance counter with additional server instance (#1753)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-21 22:52:30 +01:00
Jan-Otto Kröpke
3b378136f5 logical_disk: Get Volume ID for NTFS Volume Mounts (#1752)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-21 20:59:11 +01:00
Jan-Otto Kröpke
85845f4780 exchange: Extend Transport Queue metrics (#1749)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-20 02:05:31 +01:00
Jan-Otto Kröpke
fdee2d8613 hyperv: Refactor collector, added DataStore, Virtual SMB and Dynamic Memory Balancer metrics (click PR number for more information) (#1712)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-19 23:36:37 +01:00
Jan-Otto Kröpke
8c90961c10 mssql: expose server version info (#1741)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-19 23:35:55 +01:00
Jan-Otto Kröpke
2335fba18a logicaldisk: fix base counter values (#1747)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-19 21:35:32 +01:00
Jan-Otto Kröpke
c6ee794598 service: fixed buffer too low error (#1745)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-18 17:39:42 +01:00
Jan-Otto Kröpke
9f29fc8a9c service: parallelize api calls (#1744)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-18 02:07:03 +01:00
Jan-Otto Kröpke
e6a15d4ec4 chore: Remove registry based perfdata collector (#1742)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-17 21:51:12 +01:00
Jan-Otto Kröpke
6206b695c6 smb: refactor collector (#1740)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-15 21:27:28 +01:00
Jan-Otto Kröpke
b209ab6d6a smtp: refactor collector (#1739)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-15 20:39:56 +01:00
Jan-Otto Kröpke
78bd720e88 remote_fx: refactor collector (#1738)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-15 19:34:00 +01:00
Jan-Otto Kröpke
a4ec0a96f1 chore: use slog instead gokit for logging style (#1737)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-14 23:12:28 +01:00
Jan-Otto Kröpke
7a9a4e5831 pagefile: BREAKING: move paging metrics from os to dedicated collector (click PR for more information) (#1735)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-14 22:39:59 +01:00
Jan-Otto Kröpke
df8513ab8e Update README.md
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-11-14 22:32:25 +01:00
Jan-Otto Kröpke
1956330ac4 physical_disk: refactor collector (#1734)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-14 22:28:28 +01:00
Jan-Otto Kröpke
baa4dc16ae chore: disable quay.io push, since no credentials are available. (#1733)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-14 20:14:30 +01:00
Jan-Otto Kröpke
d13d726453 chore: Switch to hostprocess base image and add support for Windows Server 2025 on Kubernetes (click PR number for more information) (#1731)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-14 20:01:15 +01:00
Jan-Otto Kröpke
31bcf42473 system: refactor collector (#1730)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-11-14 00:06:22 +01:00
Jan-Otto Kröpke
f332361723 terminal_services: refactor collector (#1729) 2024-11-13 21:38:31 +01:00
Jan-Otto Kröpke
b4f50c542c time: refactor collector (#1728) 2024-11-13 19:26:47 +01:00
Jan-Otto Kröpke
b53f18bcc6 vmware: refactor collector (#1727) 2024-11-12 23:16:22 +01:00
Jan-Otto Kröpke
eeb7955f5e udp: Added UDP collector (#1725) 2024-11-11 17:17:19 +01:00
dependabot[bot]
55181f5bac chore(deps): bump golang.org/x/sys from 0.26.0 to 0.27.0 (#1724)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 13:01:20 +01:00
Jan-Otto Kröpke
e6c9253f15 feat: add perfcounter.engine CLI option as alternative to WINDOWS_EXPORTER_PERF_COUNTERS_ENGINE env (#1723) 2024-11-09 23:41:59 +01:00
Yang Zhao (he/him)
b26ae86992 docs: Update textfile collector defaults inclusion (#1722) 2024-11-08 21:22:46 +00:00
dependabot[bot]
004f8da0ef chore(deps): bump github.com/Microsoft/hcsshim from 0.12.8 to 0.12.9 (#1716)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 12:34:07 +01:00
dependabot[bot]
65f41b3582 chore(deps): bump github.com/prometheus/exporter-toolkit from 0.13.0 to 0.13.1 (#1717)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 12:33:58 +01:00
Jan-Otto Kröpke
be67d853aa cpu: implement int32 counter for PDH calls as well. (#1715) 2024-11-03 19:24:36 +01:00
Jan-Otto Kröpke
bf233ad3e3 mi: replace all WMI calls with MI calls (#1714) 2024-11-03 17:23:26 +01:00
Jan-Otto Kröpke
45d3eabab9 mi: Revert "replace all WMI calls with MI calls" (#1713) 2024-11-03 11:20:46 +01:00
Jan-Otto Kröpke
c4f5d58a3e mi: replace all WMI calls with MI calls (#1700) 2024-11-03 01:03:34 +01:00
dependabot[bot]
582d8dd29c chore(deps): bump github.com/Microsoft/hcsshim from 0.12.7 to 0.12.8 (#1707)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 13:53:32 +01:00
dependabot[bot]
abc5388cab chore(deps): bump github.com/prometheus/common from 0.60.0 to 0.60.1 (#1708)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 12:40:17 +01:00
dependabot[bot]
fd9eb6d877 chore(deps): bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (#1701)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-10-24 18:57:53 +02:00
poly
bad8ba225a docs: Add log.file argument to README (#1702) 2024-10-23 16:26:09 +02:00
Jan-Otto Kröpke
ce2df385a6 tcp: fix panic on collector (#1699) 2024-10-17 02:29:53 +02:00
Jan-Otto Kröpke
92b7e445e1 fix: fail, if unknown collector is defined in enabled list (#1693) 2024-10-17 01:17:57 +02:00
Jan-Otto Kröpke
332b0a8a1c update: rename updates collector to update (#1692) 2024-10-15 13:55:16 +02:00
Niko Ehrenfeuchter
73755b8bfe docs: add actual Windows Update service name (#1690) 2024-10-15 13:55:07 +02:00
dependabot[bot]
25d90212ce chore(deps): bump github.com/bmatcuk/doublestar/v4 from 4.6.1 to 4.7.1 (#1689)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 13:38:02 +02:00
Jan-Otto Kröpke
d1517d8398 logon: BREAKING: replace wmi query by Win32 API calls and expose detailed logon sessions. (click PR for more information) (#1687) 2024-10-13 10:19:41 +02:00
Jan-Otto Kröpke
7500ad6a83 *: Remove teradici_pcoip and vmware_blast collector (#1686) 2024-10-12 21:27:26 +02:00
Jan-Otto Kröpke
a0159b333e exchange: Use new collector interface (#1685) 2024-10-12 18:09:05 +02:00
Jan-Otto Kröpke
22fdb33b4c chore: optimize registry collector (#1683) 2024-10-11 00:18:36 +02:00
Jan-Otto Kröpke
f46f9082f9 memory: Implement perfdata collector (#1676) 2024-10-10 21:48:21 +02:00
Jan-Otto Kröpke
028f7aa823 *: don't exclude resources, if empty exclude is empty. (#1680) 2024-10-10 21:44:04 +02:00
Jan-Otto Kröpke
545bf77326 Update pr-check.yaml
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-10-10 21:06:37 +02:00
Niko Ehrenfeuchter
90ac0b269e chore(docs): fix link to update collector (#1682) 2024-10-10 17:35:36 +02:00
dependabot[bot]
72df5154fc chore(deps): bump github.com/prometheus/common from 0.59.2-0.20240918152650-14bac55a992f to 0.60.0 (#1674)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 14:51:50 +02:00
dependabot[bot]
4ee03c4528 chore(deps): bump golang.org/x/sys from 0.25.0 to 0.26.0 (#1675)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 14:51:29 +02:00
Jan-Otto Kröpke
2ef1a5fdf1 logical_disk: Implement Perfdata collector (#1673) 2024-10-07 00:15:54 +02:00
Jan-Otto Kröpke
efb20b1e31 dns: Implement Perfdata collector (#1672) 2024-10-06 00:22:58 +02:00
Jan-Otto Kröpke
ab33f3c49c dhcp: Use new collector interface (#1671) 2024-10-05 21:55:26 +02:00
Jan-Otto Kröpke
5952c51a39 *: Implement collector interface for registry perfdata (#1670) 2024-10-05 21:33:40 +02:00
Jan-Otto Kröpke
2a9a11bd01 process: fix fallback to V1 collector (#1667) 2024-10-03 23:44:36 +02:00
Jan-Otto Kröpke
79baf9921d process: Implement PDH collector and add support for Process V2 (#1666) 2024-10-03 21:24:17 +02:00
Jan-Otto Kröpke
7e9976efd3 chore: cleanup move private packages to internal (#1665) 2024-10-03 20:34:45 +02:00
Jan-Otto Kröpke
5d95610c84 chore: Move private packages to internal (#1664) 2024-10-03 20:23:56 +02:00
Jan-Otto Kröpke
bcfe6df24d dfsr: Implement PDH collector (#1663) 2024-10-03 19:23:20 +02:00
Jan-Otto Kröpke
70156cd106 cache: Implement PDH collector (#1662) 2024-10-03 14:31:44 +02:00
Jan-Otto Kröpke
e6ef2de40c ad: Implement PDH collector (#1660) 2024-10-03 11:59:10 +02:00
Jan-Otto Kröpke
0a78909cf6 *: replace --collectors.[name].* with --collector.[name].* flags (click PR number for more information) (#1659) 2024-10-02 13:24:58 +02:00
Jan-Otto Kröpke
2155d34779 net: expose network interfaces address (#1635) 2024-10-01 23:44:53 +02:00
astigmata
1caef5cc12 tcp: use GetExtendedTcpTable to display states Closed, Listening, SynSent, SynRcvd, CloseWait, TimeWait ... (#1638)
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <joe@cloudeteer.de>
2024-10-01 23:23:35 +02:00
Jan-Otto Kröpke
14910efd4f updates: add windows update collector (#1652)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-10-01 23:23:23 +02:00
Jan-Otto Kröpke
48e0e11063 cpu: add workaround for counter resets related to % Processor Utility metric (#1637) 2024-10-01 10:53:13 +02:00
Jan-Otto Kröpke
996080c1e9 adfs: Implement PDH collector (#1656) 2024-09-29 13:25:04 +02:00
Jan-Otto Kröpke
e6aaf91df1 initiate: close event log handle (#1654) 2024-09-28 21:23:05 +02:00
Jan-Otto Kröpke
b67b930ffc initiate: fix Cannot create another system semaphore error (#1653) 2024-09-28 19:53:12 +02:00
Jan-Otto Kröpke
a1defadf1e collector: add stack trace, if collector panics (#1650) 2024-09-28 15:57:56 +02:00
Jan-Otto Kröpke
01e809315c scheduled_task: fix memory leaks (#1649) 2024-09-28 15:15:15 +02:00
Jan-Otto Kröpke
798bf32dec adcs: Implement PDH collector (#1648) 2024-09-28 13:23:08 +02:00
Jan-Otto Kröpke
622813343f collector: change log level to info for succeeded (#1644) 2024-09-27 12:01:30 +02:00
Jan-Otto Kröpke
65d19f433e collector: fix flapping metrics if process is enabled. (#1643) 2024-09-27 11:09:17 +02:00
Jan-Otto Kröpke
2d334e4df0 installer: create config file, if config file location is customized (#1642) 2024-09-27 11:06:07 +02:00
Jan-Otto Kröpke
f442d6e22a filetime: add collector (#1639)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-09-24 23:34:39 +02:00
Jan-Otto Kröpke
d43f6ffdec docs: remove push to quay.io
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-09-22 11:38:12 +02:00
Jan-Otto Kröpke
9bea340c44 docs: remove old service.services-where CLI frag from docs (#1634) 2024-09-20 21:03:52 +02:00
Jan-Otto Kröpke
2635e5d8eb netframework: merge multiple collector into one (Click here for more information) (#1633) 2024-09-20 10:02:57 +02:00
Jan-Otto Kröpke
41ff5729df chore: Update github.com/prometheus/client_golang (#1631)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-09-19 23:15:02 +02:00
Jan-Otto Kröpke
6097432d87 chore: remove replace (#1628) 2024-09-14 21:44:08 +02:00
Jan-Otto Kröpke
5f36a81613 cpu: Fetch performance counter via PDH.dll via feature toggle. (off by default) (#1627) 2024-09-13 23:10:57 +02:00
Jan-Otto Kröpke
2e4ba9984d perfdata: fix incorrect collector log lines (#1626) 2024-09-13 22:12:10 +02:00
Jan-Otto Kröpke
fb275a06fe service: fix label name in windows_service_state (#1625) 2024-09-12 19:35:12 +02:00
Jan-Otto Kröpke
064ea74b6f installer: fix arm64 msi installer (#1623) 2024-09-12 15:02:21 +02:00
Jan-Otto Kröpke
25b642b584 chore: remove test push pipelines (#1621) 2024-09-11 14:19:14 +02:00
Jan-Otto Kröpke
f712c07c38 chore: release 0.29.0.rc0 (#1600) 2024-09-11 00:34:10 +02:00
Jan-Otto Kröpke
83b0aa8f62 container: do not fail hard, if single containers can't be scraped (#1561) 2024-09-07 20:26:22 +02:00
dependabot[bot]
9780a6aec6 chore(deps): bump github.com/prometheus/common from 0.55.0 to 0.57.0 (#1603)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-09-07 20:17:57 +02:00
Jan-Otto Kröpke
b3c0c58c17 installer: Add UI + Replace ADD_FIREWALL_EXCEPTION with ADDLOCAL=FirewallException (#1611) 2024-09-06 22:29:50 +02:00
Jan-Otto Kröpke
50687655bf chore(docs): firewall not enabled by default (#1610) 2024-09-05 13:01:18 +02:00
Jan-Otto Kröpke
26556950d0 Update pr-check.yaml
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-09-05 12:45:23 +02:00
Jan-Otto Kröpke
f72147c4df fix: firewall not enabled by default
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-09-05 12:42:51 +02:00
Jan-Otto Kröpke
2008dc5b23 collector: Skip collecting performance data if the enabled collectors don't request any. (#1604) 2024-09-03 10:11:58 +02:00
Jan-Otto Kröpke
37664cb19a dfsr: Fix DFS Replication Service Volumes collector (#1595) 2024-09-02 14:58:29 +02:00
Jan-Otto Kröpke
e6b74b690a chore: close stale issues (#1602) 2024-09-02 01:07:07 +02:00
PrometheusBot
7d2fc83abe Synchronize common files from prometheus/prometheus (#1601) 2024-09-01 20:23:24 +02:00
Jan-Otto Kröpke
9febf1e97c process: fix Access is denied errors (#1599) 2024-08-31 19:37:19 +02:00
Jan-Otto Kröpke
b53d91e048 cpu_info: Extend processor information (#1597) 2024-08-31 12:22:22 +02:00
Jan-Otto Kröpke
a5d1112fcd cache: fix windows_cache_copy_read_hits_total metric (#1591) 2024-08-31 08:25:37 +02:00
Jan-Otto Kröpke
d8f0665bdc process: introduce info metric; removed creating_process_id label from all process metric (click here for more information) (#1592) 2024-08-30 20:19:41 +02:00
Jan-Otto Kröpke
4f6e6e8b77 *: avoid using default wmi client. (#1590) 2024-08-30 00:26:15 +02:00
Jan-Otto Kröpke
3ce25ff1ef mscluster: merge multiple collector into one (Click here for more information) (#1585) 2024-08-29 22:03:05 +02:00
dependabot[bot]
c99ac2c5aa chore(deps): bump github.com/prometheus/client_golang (#1588)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 21:12:58 +02:00
dependabot[bot]
c9510e8c1d chore(deps): bump github.com/Microsoft/hcsshim from 0.12.5 to 0.12.6 (#1587)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 21:12:34 +02:00
Jan-Otto Kröpke
4484e96b66 Update bug_report.yaml
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-08-27 20:33:11 +02:00
Jan-Otto Kröpke
9705ff0a24 Update bug_report.yaml
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-08-27 20:32:05 +02:00
Jan-Otto Kröpke
89c832feb0 chore: pass context aware logger to collectors (#1582) 2024-08-24 19:14:38 +02:00
Jan-Otto Kröpke
fbead0fb79 terminal_services: remove old metric from docs (#1583) 2024-08-24 16:57:34 +02:00
Jan-Otto Kröpke
0f4ef8e781 chore: Update TEXTFILE_DIRS description in README (#1581) 2024-08-22 08:49:10 +02:00
Jan-Otto Kröpke
56709b9638 terminal_services: Avoid duplicate metrics by add session_id (#1576) 2024-08-20 19:24:08 +02:00
dependabot[bot]
2589e56f95 chore(deps): bump github.com/prometheus/client_golang from 1.19.1 to 1.20.0 (#1574)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 17:23:39 +02:00
Jan-Otto Kröpke
4e460bc24c exchange: enable all collectors as default (#1572) 2024-08-17 21:00:05 +02:00
Jan-Otto Kröpke
b5ceb27836 time: fix windows_time_computed_time_offset_seconds docs (#1571)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-08-17 20:07:25 +02:00
Jan-Otto Kröpke
f6965b10f4 mssql: fix nil panic, if YAML file is used a configuration (#1570) 2024-08-14 08:28:46 +02:00
dependabot[bot]
d7f052fb27 chore(deps): bump golang.org/x/sys from 0.23.0 to 0.24.0 (#1566)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 14:24:45 +02:00
Jan-Otto Kröpke
ca4ad46e2d scheduled_task: do not report windows_scheduled_task_last_result for task that never run before (#1562) 2024-08-11 15:47:59 +02:00
Jan-Otto Kröpke
dd956c986b chore: Refactor Config Collector API (#1558) 2024-08-11 13:28:39 +02:00
Jan-Otto Kröpke
7bb16d2f5b textfile: disable collector by default (#1560) 2024-08-11 12:57:14 +02:00
Jan-Otto Kröpke
e478843faa chore: deprecate teradici_pcoip and vmware_blast collector (#1559) 2024-08-11 11:32:01 +02:00
Jan-Otto Kröpke
9b02e4a0ea chore: enable more linter (#1557) 2024-08-10 22:05:33 +02:00
Jan-Otto Kröpke
27a3553dac *: cleanup collector API 3 (#1556) 2024-08-10 20:02:07 +02:00
Jan-Otto Kröpke
b2548e02bd installer: do not enable V1 counters by default (#1555) 2024-08-10 14:39:11 +02:00
Jan-Otto Kröpke
0ada09ee3c *: Collector API cleanup 2 (#1552) 2024-08-05 23:40:32 +02:00
Jan-Otto Kröpke
3c360c05f3 Update pr-check.yaml
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-08-05 20:01:59 +02:00
PrometheusBot
fe8e72e38f Synchronize common files from prometheus/prometheus (#1551) 2024-08-05 20:01:08 +02:00
dependabot[bot]
2d091c7187 chore(deps): bump golang.org/x/sys from 0.22.0 to 0.23.0 (#1549)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 15:57:18 +02:00
dependabot[bot]
b4999eda4b chore(deps): bump actions/checkout from 3 to 4 (#1550)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 15:57:10 +02:00
Jan-Otto Kröpke
d1e3a63f93 *: cleanup collector API 1 (#1547) 2024-08-05 15:50:41 +02:00
Jan-Otto Kröpke
dffc53eff8 terminal_services: Fix "The operation completed successfully." error (#1548) 2024-08-05 15:31:29 +02:00
Jan-Otto Kröpke
9026bc02ff Update pr-check.yaml
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-08-05 13:28:39 +02:00
Jan-Otto Kröpke
8f2a45d832 printer: expose config struct properties (#1545) 2024-07-31 18:02:21 +02:00
Jan-Otto Kröpke
6cecc735df logical_disk: Fix failed to get disk ID for dynamic volumes (#1544) 2024-07-31 15:02:29 +02:00
Jan-Otto Kröpke
4635be8c0c fix: CPU Collector % Cx Time mismatch (#1542) 2024-07-29 20:19:03 +02:00
dependabot[bot]
4cc7d108e3 chore(deps): bump actions/stale from 8 to 9 (#1541)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 18:11:13 +02:00
Jan-Otto Kröpke
d878423cb6 chore: Add label configuration (#1540) 2024-07-29 18:04:08 +02:00
Jan-Otto Kröpke
a93bbe4ac2 ci: disable hostimage image (#1539) 2024-07-29 09:28:44 +02:00
Jan-Otto Kröpke
33efbdfbcb try fix push by bump dependencies (#1537) 2024-07-24 16:24:01 +02:00
Jan-Otto Kröpke
8db705e67a fix push (#1536) 2024-07-24 16:01:22 +02:00
Jan-Otto Kröpke
7044b556c2 Add terminal service session info (#1525) 2024-07-24 11:18:08 +02:00
Jan-Otto Kröpke
fa8d28c181 license collector (#1524) 2024-07-23 13:02:25 +02:00
Jan-Otto Kröpke
64c8423e61 printer collector: Use ENUM pattern for printer status (#1500) 2024-07-23 13:02:09 +02:00
Jan-Otto Kröpke
e2e1141973 logical disk: Fix metrics for non drive letter disks (#1498) 2024-07-23 13:01:30 +02:00
Jan-Otto Kröpke
31bb6d03ee fix default value of collectors.dfsr.sources-enabled (#1506) 2024-07-22 15:21:19 +02:00
Jan-Otto Kröpke
caee5a05fe Add hostprocess image builds (#1507) 2024-07-22 15:21:05 +02:00
FRFlo
578b16b448 fix(README.md): Corrected image links (#1533) 2024-07-22 15:20:48 +02:00
dependabot[bot]
1da96a4f3c chore(deps): bump github.com/Microsoft/hcsshim from 0.12.4 to 0.12.5 (#1535)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 14:10:57 +02:00
jacbo0112
fddb92a9d5 Update collector.diskdrive.md (#1502) 2024-07-20 20:09:36 +02:00
jacbo0112
2cda7b3f4d Update README.md (#1516) 2024-07-20 18:25:14 +02:00
dependabot[bot]
b44b0413bb chore(deps): bump golang.org/x/sys from 0.21.0 to 0.22.0 (#1531)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 15:10:23 +02:00
dependabot[bot]
f4e360218f chore(deps): bump github.com/prometheus/common from 0.54.0 to 0.55.0 (#1530)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 14:54:05 +02:00
Andrey Burtasov
4efb502aab Add label user to process collector (#1472)
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-06-17 11:05:52 +02:00
Jan-Otto Kröpke
a4a5ac464a Service V2 collector (#1497) 2024-06-14 08:59:11 +02:00
Jan-Otto Kröpke
1b438cdb82 Fix timezone caching issues (#1499) 2024-06-14 08:58:58 +02:00
dependabot[bot]
f0d0545d34 chore(deps): bump github.com/prometheus/common from 0.53.0 to 0.54.0 (#1519)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 16:00:11 +02:00
dependabot[bot]
d05effdda5 chore(deps): bump github.com/Microsoft/hcsshim from 0.12.3 to 0.12.4 (#1518)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 15:33:55 +02:00
dependabot[bot]
2d29f0004b chore(deps): bump golang.org/x/sys from 0.20.0 to 0.21.0 (#1517)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 15:33:36 +02:00
jacbo0112
d94640b6f8 Update README.md (#1501) 2024-06-07 18:46:02 +02:00
PrometheusBot
26e05e9d07 Synchronize common files from prometheus/prometheus (#1513) 2024-06-06 20:15:23 +02:00
PrometheusBot
9eec34d2f1 Synchronize common files from prometheus/prometheus (#1512)
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-06-06 17:18:14 +02:00
Benjamin Nash
b8b164bfca Fix omission of RemoteFX Graphics metrics (#1511)
Co-authored-by: PrometheusBot <prometheus-team@googlegroups.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-06-06 16:30:24 +02:00
PrometheusBot
7775ef95e6 Synchronize common files from prometheus/prometheus (#1510) 2024-06-03 20:19:25 +02:00
Ben Reedy
eeaefba0d7 feat: allow setting of exporter process priority (#1488) 2024-05-17 22:51:33 +02:00
Jan-Otto Kröpke
b2ab542b6d Fix docker push on release (#1496) 2024-05-17 19:38:51 +02:00
Soheil Rahmat
f85866ce1e Add Printer Exporter (#1485) 2024-05-17 18:47:32 +02:00
jacbo0112
9e24ce8f74 Update collector.diskdrive.md (#1495) 2024-05-17 07:17:26 +02:00
Darin Truckenmiller
9c65b7464f Add new RemoteFX network metrics (#1489) 2024-05-15 23:13:02 +02:00
Jan-Otto Kröpke
c242fae84c Remove push to quay.io (#1490) 2024-05-15 02:38:01 +02:00
Ben Reedy
c85cfaadde Merge pull request #1487 from breed808/ci
Additional CI linters
2024-05-15 07:13:19 +10:00
Ben Reedy
d6c24d1500 feat(ci): enable useful golangci output
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-05-15 07:07:32 +10:00
Ben Reedy
8b515ba54a feat(ci): enable promlinter
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-05-15 06:19:44 +10:00
Ben Reedy
a2575b93a9 feat(ci): add unused linter
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-05-15 06:19:39 +10:00
Ben Reedy
965be334bc ci: reverse default linter logic
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-05-15 06:19:34 +10:00
Ben Reedy
1239fbf719 perf: run perfsprint fixes
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-05-15 06:19:29 +10:00
Ben Reedy
a49dee606b perf: pre-allocate slices
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-05-15 06:19:24 +10:00
Ben Reedy
c713bed4e3 chore(ci): update golangci-lint to latest version
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-05-15 06:19:19 +10:00
Ben Reedy
99b6d215a2 chore(ci): order linters alphabetically
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-05-15 06:19:14 +10:00
dependabot[bot]
6d91cdc9fc chore(deps): bump github.com/prometheus/client_golang from 1.19.0 to 1.19.1 (#1484)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 13:43:14 +02:00
PrometheusBot
c9ebc3e153 Synchronize common files from prometheus/prometheus (#1483) 2024-05-12 21:02:50 +02:00
Jan-Otto Kröpke
c99cf180d0 fix: makefile variable override (#1482) 2024-05-12 12:25:06 +02:00
Jan-Otto Kröpke
6e14d4e53f fix: release build again again (#1481) 2024-05-12 10:58:09 +02:00
PrometheusBot
48e7c34539 Synchronize common files from prometheus/prometheus (#1453)
Co-authored-by: Ben Kochie <superq@gmail.com>
2024-05-12 10:57:45 +02:00
Jan-Otto Kröpke
6497a1a5cc fix: release build again (#1480) 2024-05-12 10:04:33 +02:00
Jan-Otto Kröpke
4e1987686b fix: release build again (#1479) 2024-05-12 01:46:05 +02:00
Jan-Otto Kröpke
dc4bc8e163 fix: release build (#1478) 2024-05-12 01:27:54 +02:00
Jan-Otto Kröpke
b8747045ce Enable process V1 performance counters by default (#1477) 2024-05-12 00:24:52 +02:00
Jan-Otto Kröpke
00781dbbee scheduled_task: Move OLE connection to collect function (#1451) 2024-05-12 00:22:33 +02:00
Jan-Otto Kröpke
195cfa8d5c Add: push docker images to dockerhub and quay.io (#1469) 2024-05-11 23:06:22 +02:00
rob-scheepens
be25d79b71 Implementing smbclient collector (#1408)
Co-authored-by: Bob Allegretti <ballegre@gmail.com>
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-05-11 18:06:03 +02:00
Ben Reedy
9bf84fb10c Remove unused *prometheus.Desc return value from collectors collect() function (#1475) 2024-05-11 12:05:45 +02:00
Jan-Otto Kröpke
b977c8484b Remove landing page (#1471) 2024-05-11 09:41:59 +02:00
Jan-Otto Kröpke
13ebec0195 fix: release builds (#1474) 2024-05-09 15:32:26 +02:00
Jan-Otto Kröpke
cc89ae33a4 fix: release builds (#1468) 2024-05-07 13:23:43 +02:00
dependabot[bot]
215032a111 chore(deps): bump golang.org/x/sys from 0.19.0 to 0.20.0 (#1464)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 15:02:38 +02:00
Jan-Otto Kröpke
a2fe96fbc8 perflib: enrich error message (#1460) 2024-05-03 07:51:38 +02:00
Jan-Otto Kröpke
7d8cf59dac iis: Add IIS info metric (#1450) 2024-05-03 07:51:29 +02:00
Jan-Otto Kröpke
de8a1ebbfe Do not add "--web.listen-address" to service if default values are provided (#1452) 2024-05-03 07:30:48 +02:00
Jan-Otto Kröpke
5ff820cfd0 Ability to disable debug endpoints (#1448) 2024-05-03 07:30:40 +02:00
Jan-Otto Kröpke
8f6a1e3f07 Implement a Windows application manifest (#1445) 2024-05-03 07:30:31 +02:00
dependabot[bot]
f6b91e5cb0 chore(deps): bump github.com/prometheus/common from 0.52.3 to 0.53.0 (#1455)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 08:58:06 +02:00
Andrey Burtasov
f21c119c74 Add label volume_name to logical_disk collector (#1442) 2024-04-25 08:57:38 +02:00
Jan-Otto Kröpke
e7464d9fcf Merge pull request #1456 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.12.3 2024-04-23 09:46:52 +02:00
dependabot[bot]
87d1a59a57 chore(deps): bump github.com/Microsoft/hcsshim from 0.12.2 to 0.12.3
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.12.2 to 0.12.3.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.12.2...v0.12.3)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 11:56:02 +00:00
Jan-Otto Kröpke
b1c272a996 Merge pull request #1395 from webalexeu/feat/add_owner_node 2024-04-21 08:51:15 +02:00
Jan-Otto Kröpke
fdf6f33941 Merge branch 'master' into feat/add_owner_node 2024-04-21 08:47:43 +02:00
Jan-Otto Kröpke
72e7096110 Merge pull request #1447 from jkroepke/setup-no-firewall 2024-04-21 08:47:15 +02:00
Jan-Otto Kröpke
658fbd92ab Merge pull request #1446 from jkroepke/fix-windows2012 2024-04-21 08:46:44 +02:00
Jan-Otto Kröpke
d503ae05d4 Restore Windows 2012 support.
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-04-20 23:31:20 +02:00
Jan-Otto Kröpke
c8b06e86b0 installer: Disable Windows Firewall Exception by default. Can be re-enabled with ADD_FIREWALL_EXCEPTION=yes
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-04-20 23:30:48 +02:00
Jan-Otto Kröpke
21a64b1a62 Merge pull request #1392 from breed808/filtered_metrics 2024-04-20 21:35:48 +02:00
Jan-Otto Kröpke
6a15aff837 Merge pull request #1402 from simon04/patch-2 2024-04-20 21:26:01 +02:00
Jan-Otto Kröpke
802f0df07a Merge pull request #1401 from simon04/patch-1 2024-04-20 21:25:44 +02:00
Jan-Otto Kröpke
08c67def1e Merge pull request #1444 from prometheus-community/dependabot/go_modules/golang.org/x/net-0.23.0 2024-04-20 21:24:17 +02:00
dependabot[bot]
65c9009db6 chore(deps): bump golang.org/x/net from 0.22.0 to 0.23.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0.
- [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 13:26:58 +00:00
Ben Reedy
8e2e867b11 Merge pull request #1441 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.52.3
chore(deps): bump github.com/prometheus/common from 0.52.2 to 0.52.3
2024-04-16 14:16:20 +10:00
dependabot[bot]
7a201e0c16 chore(deps): bump github.com/prometheus/common from 0.52.2 to 0.52.3
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.52.2 to 0.52.3.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.52.2...v0.52.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-15 11:05:01 +00:00
Ben Reedy
0ebb2d36e8 Merge pull request #1436 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.12.2
chore(deps): bump github.com/Microsoft/hcsshim from 0.11.4 to 0.12.2
2024-04-10 06:35:49 +10:00
dependabot[bot]
3a2c61c19d chore(deps): bump github.com/Microsoft/hcsshim from 0.11.4 to 0.12.2
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.11.4 to 0.12.2.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.11.4...v0.12.2)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-09 20:32:11 +00:00
Ben Reedy
8a1972162a Merge pull request #1438 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_model-0.6.1
chore(deps): bump github.com/prometheus/client_model from 0.6.0 to 0.6.1
2024-04-10 06:31:15 +10:00
dependabot[bot]
032b1f5e88 chore(deps): bump github.com/prometheus/client_model from 0.6.0 to 0.6.1
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.6.0 to 0.6.1.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.6.0...v0.6.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-09 20:26:11 +00:00
Ben Reedy
1daaccceaf Merge pull request #1439 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.52.2
chore(deps): bump github.com/prometheus/common from 0.49.0 to 0.52.2
2024-04-10 06:25:20 +10:00
Ben Reedy
154dec5f4c chore(deps): bump github.com/prometheus/common from 0.49.0 to 0.52.2
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.49.0 to 0.52.2.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.49.0...v0.52.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-04-10 06:20:48 +10:00
Ben Reedy
dbb890c00f Merge pull request #1440 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.19.0
chore(deps): bump golang.org/x/sys from 0.17.0 to 0.19.0
2024-04-10 05:58:31 +10:00
dependabot[bot]
1515623618 chore(deps): bump golang.org/x/sys from 0.17.0 to 0.19.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.17.0 to 0.19.0.
- [Commits](https://github.com/golang/sys/compare/v0.17.0...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 11:12:03 +00:00
Jan-Otto Kröpke
96c1412a5b Merge pull request #1431 from prometheus-community/dependabot/go_modules/google.golang.org/protobuf-1.33.0 2024-03-18 19:06:12 +01:00
dependabot[bot]
e0bdc9828c chore(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0
Bumps google.golang.org/protobuf from 1.32.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-13 23:27:45 +00:00
Ben Reedy
6e9daff6ed fix: Apply query filter to metrics
Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-03-05 06:33:15 +10:00
Ben Reedy
91da7562e1 Merge pull request #1423 from prometheus-community/dependabot/go_modules/github.com/stretchr/testify-1.9.0
chore(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0
2024-03-05 06:32:09 +10:00
dependabot[bot]
c238bbcaf2 chore(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 20:28:09 +00:00
Ben Reedy
c382d0c217 Merge pull request #1422 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.49.0
chore(deps): bump github.com/prometheus/common from 0.48.0 to 0.49.0
2024-03-05 06:27:06 +10:00
dependabot[bot]
9d1c9fb012 chore(deps): bump github.com/prometheus/common from 0.48.0 to 0.49.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.48.0 to 0.49.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.48.0...v0.49.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 20:21:28 +00:00
Ben Reedy
f3ef7583fe Merge pull request #1421 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.19.0
chore(deps): bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0
2024-03-05 06:19:24 +10:00
dependabot[bot]
f37d4d7921 chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.18.0...v1.19.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 11:46:33 +00:00
Jan-Otto Kröpke
39ab9faa6a Merge pull request #1418 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.48.0 2024-02-26 13:09:25 +01:00
dependabot[bot]
ac7c98e57e chore(deps): bump github.com/prometheus/common from 0.47.0 to 0.48.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.47.0 to 0.48.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.47.0...v0.48.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 11:54:34 +00:00
Jan-Otto Kröpke
377fec7b55 Merge pull request #1416 from jaco-van-zyl-derivco/master 2024-02-22 13:20:56 +01:00
jaco-van-zyl-derivco
548b970288 Fix collector.process.iis flag
Signed-off-by: Jaco van Zyl <mail@jaco.vanzyl@derivco.co.im>

Signed-off-by: jaco-van-zyl-derivco <104196755+jaco-van-zyl-derivco@users.noreply.github.com>
2024-02-22 12:02:59 +00:00
Jan-Otto Kröpke
a02d0257b3 Merge pull request #1410 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.47.0 2024-02-19 22:26:22 +01:00
dependabot[bot]
477ec0df50 chore(deps): bump github.com/prometheus/common from 0.46.0 to 0.47.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.46.0 to 0.47.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.46.0...v0.47.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 13:58:07 +00:00
Jan-Otto Kröpke
2a88229a0e Merge pull request #1411 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_model-0.6.0 2024-02-19 14:57:26 +01:00
dependabot[bot]
3cbf5dc085 chore(deps): bump github.com/prometheus/client_model from 0.5.0 to 0.6.0
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 11:33:18 +00:00
Simon Legner
c4a4da07f8 Fix typo "Labelled"
Signed-off-by: Simon Legner <Simon.Legner@gmail.com>
2024-02-17 10:23:11 +01:00
Simon Legner
e2ea99fadd Fix typo "Privileged"
Signed-off-by: Simon Legner <Simon.Legner@gmail.com>
2024-02-17 10:23:03 +01:00
Jan-Otto Kröpke
6eebfcce57 Merge pull request #1409 from Winter-py/collector.mssql.md 2024-02-16 19:50:04 +01:00
Steven Owatemi
f97ac3fb66 Update collector.mssql.md
Signed-off-by: Steven Owatemi <isosteven@gmail.com>
2024-02-16 16:48:22 +00:00
webalexeu
7f7239f404 Merge branch 'prometheus-community:master' into feat/add_owner_node 2024-02-16 14:50:55 +01:00
Alexandre JARDON
8d1d552351 Create dedicated metric for owner_node
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:56:08 +01:00
Alexandre JARDON
233470cdf0 Add owner_node on resource and resourcegroup for mscluster
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:55:18 +01:00
dependabot[bot]
67fca296bf chore(deps): bump golang.org/x/sys from 0.16.0 to 0.17.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/sys/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Ben Reedy
143ab2247a Update README.md
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
Signed-off-by: Ben Reedy <breed808@users.noreply.github.com>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Ben Reedy
7635e6e094 docs!: Remove support for EOL Windows versions
Microsoft currently support Windows Server 2016 or newer, and Windows 10
and Windows 11 (21HR or later). Dropping support for end-of-life Windows
Server versions will reduce maintenance overhead for project
maintainers.

Signed-off-by: Ben Reedy <breed808@breed808.com>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
dependabot[bot]
9541560e43 chore(deps): bump github.com/yusufpapurcu/wmi from 1.2.3 to 1.2.4
Bumps [github.com/yusufpapurcu/wmi](https://github.com/yusufpapurcu/wmi) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/yusufpapurcu/wmi/releases)
- [Commits](https://github.com/yusufpapurcu/wmi/compare/v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: github.com/yusufpapurcu/wmi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
dinifarb
941019ebc9 fix(#1390): global kingpin instead of app var
Signed-off-by: dinifarb <andreas.vogt89@bluewin.ch>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Alexandre JARDON
5ef7c1f0e9 Adapat documentation based on new metric
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Alexandre JARDON
9b5568354c Create dedicated metric for owner_node
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Alexandre JARDON
eab87292c1 Add examples
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Alexandre JARDON
6ca67f7aa2 Add owner_node on resource and resourcegroup for mscluster
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
dependabot[bot]
688ea45e7e chore(deps): bump github.com/containerd/containerd from 1.7.0 to 1.7.11
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.0 to 1.7.11.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.0...v1.7.11)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
dependabot[bot]
4032b7f610 chore(deps): bump github.com/prometheus/common from 0.45.0 to 0.46.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.45.0 to 0.46.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.45.0...v0.46.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Dinifarb
e2ceb0d46d fix:(#1382): update TextfileDirFlag to TextfileDirsFlag
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Dinifarb
d07845ca08 fix:(#1382): rename TEXTFILE_DIR to TEXTFILE_DIRS
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
Signed-off-by: Alexandre JARDON <28548335+webalexeu@users.noreply.github.com>
2024-02-16 08:54:06 +01:00
Jan-Otto Kröpke
b5284aca85 Merge pull request #1405 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.17.0 2024-02-12 12:50:17 +01:00
dependabot[bot]
5c1f19d4bc chore(deps): bump golang.org/x/sys from 0.16.0 to 0.17.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/sys/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 11:15:08 +00:00
Ben Reedy
c83da9a2f0 Merge pull request #1396 from breed808/supported_operating_systems
docs!: Remove support for EOL Windows versions
2024-02-02 05:40:53 +10:00
Ben Reedy
b09b8a9c36 Update README.md
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
Signed-off-by: Ben Reedy <breed808@users.noreply.github.com>
2024-02-02 05:40:16 +10:00
Jan-Otto Kröpke
265c12b28e Merge pull request #1399 from prometheus-community/dependabot/go_modules/github.com/yusufpapurcu/wmi-1.2.4 2024-01-29 12:44:37 +01:00
dependabot[bot]
2be970e652 chore(deps): bump github.com/yusufpapurcu/wmi from 1.2.3 to 1.2.4
Bumps [github.com/yusufpapurcu/wmi](https://github.com/yusufpapurcu/wmi) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/yusufpapurcu/wmi/releases)
- [Commits](https://github.com/yusufpapurcu/wmi/compare/v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: github.com/yusufpapurcu/wmi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 11:04:27 +00:00
Ben Reedy
2103e7e1b5 Merge pull request #1397 from DiniFarb/issue_#1390
fix(#1390): global kingpin instead of app var
2024-01-29 17:35:12 +10:00
dinifarb
09c0e47fde fix(#1390): global kingpin instead of app var
Signed-off-by: dinifarb <andreas.vogt89@bluewin.ch>
2024-01-29 07:56:59 +01:00
Ben Reedy
e19b8959c4 docs!: Remove support for EOL Windows versions
Microsoft currently support Windows Server 2016 or newer, and Windows 10
and Windows 11 (21HR or later). Dropping support for end-of-life Windows
Server versions will reduce maintenance overhead for project
maintainers.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2024-01-27 08:37:14 +10:00
Ben Reedy
21a7beaee6 Merge pull request #1367 from prometheus-community/dependabot/go_modules/github.com/containerd/containerd-1.7.11
chore(deps): bump github.com/containerd/containerd from 1.7.0 to 1.7.11
2024-01-17 05:47:35 +10:00
dependabot[bot]
a32f83a6de chore(deps): bump github.com/containerd/containerd from 1.7.0 to 1.7.11
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.0 to 1.7.11.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.0...v1.7.11)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 11:15:19 +00:00
Jan-Otto Kröpke
f70fa009de Merge pull request #1387 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.46.0
chore(deps): bump github.com/prometheus/common from 0.45.0 to 0.46.0
2024-01-15 12:13:17 +01:00
dependabot[bot]
546e5de5e1 chore(deps): bump github.com/prometheus/common from 0.45.0 to 0.46.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.45.0 to 0.46.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.45.0...v0.46.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 11:08:47 +00:00
Jan-Otto Kröpke
415c72d457 Merge pull request #1384 from DiniFarb/issue_#1382 2024-01-13 14:13:03 +01:00
Dinifarb
bd7d7be6ea fix:(#1382): update TextfileDirFlag to TextfileDirsFlag
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2024-01-12 16:54:29 +01:00
Dinifarb
b4c0874ca4 fix:(#1382): rename TEXTFILE_DIR to TEXTFILE_DIRS
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2024-01-12 16:46:18 +01:00
Jan-Otto Kröpke
6ede10e29a Merge pull request #1380 from prometheus-community/docs/README 2024-01-10 08:21:50 +01:00
Jan-Otto Kröpke
69d2673e07 Update docs/README.md
Co-authored-by: Ben Reedy <breed808@users.noreply.github.com>
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-01-10 01:55:05 +01:00
Jan-Otto Kröpke
2eee8b33e7 Update docs/README.md
Add missing items in the collection

Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2024-01-09 21:01:45 +01:00
Jan-Otto Kröpke
f260a8f9fc Merge pull request #1377 from jkroepke/ci-exe 2024-01-09 20:53:02 +01:00
Jan-Otto Kröpke
969a0ce861 Merge pull request #1378 from jkroepke/remove/386 2024-01-09 20:52:50 +01:00
Jan-Otto Kröpke
5398e91752 Merge pull request #1379 from DiniFarb/win_srv_stop_error_2 2024-01-09 12:46:39 +01:00
DiniFarb
3868c97686 Update pkg/initiate/initiate.go
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
Signed-off-by: DiniFarb <andreas.vogt89@bluewin.ch>
2024-01-09 12:40:01 +01:00
Jan-Otto Kröpke
856389e107 Merge pull request #1376 from mattdurham/master 2024-01-09 09:02:13 +01:00
Dinifarb
44f4918219 fix(#1352): moving the stop signal after svc.Run()
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2024-01-08 21:23:35 +01:00
Jan-Otto Kröpke
fd20f6f16a Remove i386 builds
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-01-08 19:59:15 +01:00
Jan-Otto Kröpke
971cab5184 Merge pull request #1375 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.16.0 2024-01-08 19:26:04 +01:00
Jan-Otto Kröpke
22eec4cd73 CI: Provide binary builds from GH actions
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2024-01-08 19:25:33 +01:00
matt durham
f850a84140 add call to set perf counter query
Signed-off-by: matt durham <mattdurham@ppog.org>
2024-01-08 10:00:39 -05:00
dependabot[bot]
0be1708e06 chore(deps): bump golang.org/x/sys from 0.15.0 to 0.16.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.15.0 to 0.16.0.
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 11:23:09 +00:00
Ben Reedy
52b66bfb84 Merge pull request #1370 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.18.0
chore(deps): bump github.com/prometheus/client_golang from 1.17.0 to 1.18.0
2024-01-02 06:04:43 +10:00
dependabot[bot]
008786366c chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.17.0...v1.18.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 11:45:54 +00:00
Ben Reedy
504b506f46 Merge pull request #1369 from prometheus-community/repo_sync
Synchronize common files from prometheus/prometheus
2023-12-27 06:44:07 +10:00
prombot
f100ffe892 Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-12-26 17:49:04 +00:00
Jan-Otto Kröpke
7beb08f6c3 Merge pull request #1364 from prometheus-community/dependabot/go_modules/golang.org/x/crypto-0.17.0 2023-12-21 21:25:24 +01:00
Jan-Otto Kröpke
ac53f5227a Merge pull request #1365 from exgolden/docsLogic 2023-12-20 23:21:00 +01:00
Isai
1915d784bf metric name & useful query
Signed-off-by: Isai <isai_alejandro@outlook.com>
2023-12-18 23:24:19 -06:00
dependabot[bot]
760b6d299a chore(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 00:06:14 +00:00
Jan-Otto Kröpke
cb97e88b12 Merge pull request #1361 from exgolden/memoryMetric 2023-12-17 16:43:42 +01:00
Isai
aac09e1146 Update docs/collector.os.md
change in syntax suggested by jkroepke

Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
Signed-off-by: Isai <59813207+exgolden@users.noreply.github.com>
2023-12-17 08:36:19 -06:00
Isai
1e52be0f35 Added useful query for memory usage
Signed-off-by: Isai <isai_alejandro@outlook.com>
2023-12-17 00:47:27 -06:00
Jan-Otto Kröpke
a3fc99f3fd Merge pull request #1358 from prometheus-community/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.11.0 2023-12-11 12:11:23 +01:00
dependabot[bot]
9138f6c8a4 chore(deps): bump github.com/prometheus/exporter-toolkit
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 11:06:14 +00:00
Jan-Otto Kröpke
edceb96040 Merge pull request #1340 from aburtasov/feature/collector/smb 2023-12-09 18:17:10 +01:00
Jan-Otto Kröpke
df286798a7 Merge pull request #1357 from jkroepke/remove-old-reg 2023-12-07 22:07:17 +01:00
Jan-Otto Kröpke
e76b739e30 Remove old event source registry key
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-12-05 09:09:48 +01:00
Jan-Otto Kröpke
49d9097bf9 Remove old event source registry key
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-12-05 09:09:48 +01:00
Jan-Otto Kröpke
63e7fa3054 Remove old event source registry key
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-12-05 09:09:48 +01:00
Ben Reedy
48cb97d7d3 Merge pull request #1343 from breed808/arm64_msi
Add ARM64 MSI builds
2023-12-05 05:44:09 +10:00
Ben Reedy
7feafc1238 fix: Set default values for MSI web.listen-address
This prevents the exporter HTTP port from being omitted from the
firewall rule DisplayName.

I've tested this in the following four scenarios, and web.listen-address
is set correctly for each:

* Nothing set: 0.0.0.0:9182
* LISTEN_PORT=9184: 0.0.0.0:9184
* LISTEN_ADDR=127.0.0.1: 127.0.0.1:9182
* LISTEN_PORT=9184 LISTEN_ADDR=127.0.0.1: 127.0.0.1:9184

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-12-05 05:43:13 +10:00
Ben Reedy
d4b48e52e6 feat: Add ARM64 MSI builds
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-12-05 05:43:09 +10:00
Ben Reedy
f1b2b319f5 feat: Update WiX from v3 to v4
This change updates WiX to the latest major upstream version, which is a
prerequisite for ARM64 MSI builds.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-12-05 05:43:05 +10:00
Jan-Otto Kröpke
b22380ea06 Merge pull request #1355 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.15.0 2023-12-04 12:52:25 +01:00
dependabot[bot]
a78e4a1af6 chore(deps): bump golang.org/x/sys from 0.14.0 to 0.15.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.14.0 to 0.15.0.
- [Commits](https://github.com/golang/sys/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 11:29:52 +00:00
Andrey Burtasov
ce6c719a7a change desc about tree connect count
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-28 11:23:52 +03:00
Andrey Burtasov
73bfd00cbe add docs about smb collector
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-28 11:22:58 +03:00
Andrey Burtasov
f62077014f after testing i removed the unnecessary sub-collector
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-28 09:11:59 +03:00
Jan-Otto Kröpke
5a872a227c Merge pull request #1351 from mattdurham/check_settings 2023-11-27 19:09:36 +01:00
matt durham
9bed4826d6 Add check for enable worker process so it is properly set.
Signed-off-by: matt durham <mattdurham@ppog.org>
2023-11-27 12:22:38 -05:00
Jan-Otto Kröpke
470f5d5852 Merge pull request #1348 from dormancygrace/patch-1 2023-11-26 18:02:59 +01:00
Jan-Otto Kröpke
aa8453f9d6 CI: set operations-per-run to 500
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2023-11-24 18:02:25 +01:00
Andrey Burtasov
61ec692534 fix collectServerSession func
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-24 17:57:31 +03:00
Andrey Burtasov
8f177f03c3 Merge branch 'master' into feature/collector/smb 2023-11-24 12:27:41 +03:00
Jan-Otto Kröpke
53bbee75f0 CI: set operations-per-run to 100
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2023-11-23 20:28:21 +01:00
dormancygrace
1c75398d4b Update collector.exchange.md
Fix typo

Signed-off-by: dormancygrace <dormancygrace@gmail.com>
2023-11-22 22:28:43 +02:00
Andrey Burtasov
189ae539b5 Merge branch 'master' into feature/collector/smb 2023-11-21 17:54:52 +03:00
Ben Reedy
5d83b29a2e Merge pull request #1346 from prometheus-community/dependabot/go_modules/github.com/alecthomas/kingpin/v2-2.4.0
chore(deps): bump github.com/alecthomas/kingpin/v2 from 2.3.2 to 2.4.0
2023-11-21 05:52:23 +10:00
Ben Reedy
ac9303350a Merge pull request #1345 from breed808/readme_textfile
fix(docs): Add textfile to enabled_collectors
2023-11-21 05:51:07 +10:00
Jan-Otto Kröpke
e9feac83ef Merge pull request #1342 from jkroepke/action/stale 2023-11-20 19:30:00 +01:00
Jan-Otto Kröpke
caa2ae74f1 Merge branch 'master' into action/stale 2023-11-20 19:29:45 +01:00
dependabot[bot]
afab42ec5a chore(deps): bump github.com/alecthomas/kingpin/v2 from 2.3.2 to 2.4.0
Bumps [github.com/alecthomas/kingpin/v2](https://github.com/alecthomas/kingpin) from 2.3.2 to 2.4.0.
- [Release notes](https://github.com/alecthomas/kingpin/releases)
- [Commits](https://github.com/alecthomas/kingpin/compare/v2.3.2...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/kingpin/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 11:50:16 +00:00
Ben Reedy
aa1e4e8906 fix(docs): Add textfile to enabled_collectors
Omission of the collector implied that setting `TEXTFILE_DIR` was
sufficient to enable the collector, which is not true.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-11-20 20:01:39 +10:00
Jan-Otto Kröpke
8a33796bd3 Merge pull request #1338 from aburtasov/feature/collector/exchange 2023-11-19 13:09:59 +01:00
Jan-Otto Kröpke
52a360211e Add stale action
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-11-17 19:02:41 +01:00
Jan-Otto Kröpke
c6b6a239aa Merge pull request #1337 from jkroepke/remove-old-flags 2023-11-17 16:20:56 +01:00
Andrey Burtasov
13f2b3d083 fixed lists order
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-17 18:18:07 +03:00
Andrey Burtasov
32721b3f16 changed description for metrics
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-17 09:20:22 +03:00
Andrey Burtasov
268a47ff3d fixed collectServerShares func
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 19:30:24 +03:00
Andrey Burtasov
9922f1265a removed mstosec func
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 19:30:24 +03:00
Andrey Burtasov
39686130c6 fixed collectServerShare
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 19:30:24 +03:00
Andrey Burtasov
ff68ef102f added smb collector to map
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 19:30:24 +03:00
Andrey Burtasov
db9fc9fafe added smb to collectors and config
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 19:30:24 +03:00
Andrey Burtasov
038eede644 added smb collector
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 19:30:23 +03:00
Jan-Otto Kröpke
ab05f43716 Merge pull request #1339 from mattdurham/fix_unassigned_config
add sites to iss config constructor
2023-11-16 16:09:33 +01:00
matt durham
089acc5b88 add sites to iss config constructor
Signed-off-by: matt durham <mattdurham@ppog.org>
2023-11-16 09:13:56 -05:00
Andrey Burtasov
4d39014e33 Merge branch 'prometheus-community:master' into feature/collector/exchange 2023-11-16 13:35:35 +03:00
Andrey Burtasov
57973dbc38 change desc for c.ActiveUserCountMapiHttpEmsmdb
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 10:31:20 +03:00
Andrey Burtasov
a08394e089 added description of type perfMapiHttpEmsmdb
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 10:31:20 +03:00
Andrey
620dc84246 add MSExchange MapiHttp Emsmdb collector
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
2023-11-16 10:31:20 +03:00
Jan-Otto Kröpke
b7798918f4 Remove deprecated flags
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-11-15 19:16:56 +01:00
Jan-Otto Kröpke
1836cd1ad0 Merge pull request #1335 from mattdurham/nil_string_check 2023-11-15 16:38:17 +01:00
Jan-Otto Kröpke
84eadf5085 Merge pull request #1336 from kang-makes/fix/dont-abort-user-is-nil 2023-11-14 20:32:05 +01:00
Juan Manuel Perez
ffd59537e8 do not abort if we do not know which user is running the process
Signed-off-by: Juan Manuel Perez <jperezflorez@newrelic.com>
2023-11-14 17:15:51 +01:00
matt durham
e3a7fab98a Check for nil strings and include wrappers around each.
Signed-off-by: matt durham <mattdurham@ppog.org>
2023-11-14 10:43:14 -05:00
Jan-Otto Kröpke
5bb7e6086f Merge pull request #1333 from breed808/maintainer 2023-11-14 10:58:04 +01:00
Ben Reedy
91c07686bd Merge pull request #1332 from prometheus-community/dependabot/go_modules/github.com/stretchr/testify-1.8.4
chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.4
2023-11-14 18:44:42 +10:00
Ben Reedy
a8a28053ba feat: Add jkroepke to maintainers
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-11-14 18:42:29 +10:00
dependabot[bot]
9f982575ac chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.4
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.4)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 11:46:49 +00:00
Ben Reedy
7ea04d25c6 Merge pull request #1326 from jkroepke/dockerfile
Add cross OS Dockerfile
2023-11-13 14:01:48 +10:00
Ben Reedy
430fdb0aef Merge pull request #1324 from jkroepke/remove-globals
Refactor collectors
2023-11-13 14:00:54 +10:00
Jan-Otto Kröpke
78f5fb295c Update dhcp.go
Re-add DHCP perflib dependency

Fixes https://github.com/prometheus-community/windows_exporter/issues/1259

Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
2023-11-12 21:34:38 +01:00
Jan-Otto Kröpke
6824d3f799 bump go mod
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-11-12 14:05:26 +01:00
Jan-Otto Kröpke
552e9d8cd2 add collector.NewWithConfig
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-11-12 13:52:46 +01:00
Jan-Otto Kröpke
0711268d3c Refactor collectors
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-11-12 13:51:59 +01:00
Jan-Otto Kröpke
7331dc2394 Add cross OS Dockerfile
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-11-12 12:57:56 +01:00
Ben Reedy
569f5450cd Merge pull request #1317 from DiniFarb/os_rev_num
feat(#1300): add revision to windows_os_info
2023-11-12 14:45:51 +10:00
Dinifarb
a08474b4f9 feat(#1300): add revision to windows_os_info
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-11-11 07:11:13 +01:00
Ben Reedy
d3c54d4a01 Merge pull request #1328 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.14.0
chore(deps): bump golang.org/x/sys from 0.12.0 to 0.14.0
2023-11-11 13:34:02 +10:00
Ben Reedy
e041eec500 Merge pull request #1311 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.45.0
chore(deps): bump github.com/prometheus/common from 0.44.0 to 0.45.0
2023-11-11 13:33:34 +10:00
Ben Reedy
b64e00e778 Merge pull request #1327 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.11.4
chore(deps): bump github.com/Microsoft/hcsshim from 0.11.1 to 0.11.4
2023-11-11 13:23:45 +10:00
dependabot[bot]
3859a3eeb4 chore(deps): bump github.com/Microsoft/hcsshim from 0.11.1 to 0.11.4
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.11.1 to 0.11.4.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.11.1...v0.11.4)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-11 02:33:01 +00:00
Ben Reedy
f0d5026d7d Merge pull request #1316 from prometheus-community/dependabot/go_modules/google.golang.org/grpc-1.56.3
chore(deps): bump google.golang.org/grpc from 1.56.2 to 1.56.3
2023-11-11 12:23:20 +10:00
dependabot[bot]
b0d55b1d5f chore(deps): bump google.golang.org/grpc from 1.56.2 to 1.56.3
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.2 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.56.2...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-11 02:17:12 +00:00
dependabot[bot]
fa4bf71578 chore(deps): bump golang.org/x/sys from 0.12.0 to 0.14.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.12.0 to 0.14.0.
- [Commits](https://github.com/golang/sys/compare/v0.12.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-11 02:16:53 +00:00
dependabot[bot]
3187cbcc64 chore(deps): bump github.com/prometheus/common from 0.44.0 to 0.45.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.44.0 to 0.45.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.44.0...v0.45.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-11 02:16:53 +00:00
Ben Reedy
29521701bb Merge pull request #1307 from prometheus-community/dependabot/go_modules/golang.org/x/net-0.17.0
chore(deps): bump golang.org/x/net from 0.10.0 to 0.17.0
2023-11-11 12:15:56 +10:00
dependabot[bot]
1365aec747 chore(deps): bump golang.org/x/net from 0.10.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-11 02:09:16 +00:00
Ben Reedy
5c38ce78b2 Merge pull request #1304 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_model-0.5.0
chore(deps): bump github.com/prometheus/client_model from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0
2023-11-11 12:07:29 +10:00
dependabot[bot]
f316d27324 chore(deps): bump github.com/prometheus/client_model
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/commits/v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-11 12:02:28 +10:00
Ben Reedy
e9fdfdc1eb Merge pull request #1331 from breed808/service_spelling
fix: Fix spelling error in service collector
2023-11-11 11:51:03 +10:00
Ben Reedy
8de5ef0353 fix: Fix spelling error in service collector
Error was failing CI checks.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-11-11 11:46:37 +10:00
Ben Reedy
9c0be5fd48 Merge pull request #1302 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.17.0
chore(deps): bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
2023-10-04 16:14:35 +10:00
dependabot[bot]
d3254118de chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 11:39:40 +00:00
Ben Reedy
a41abdf22d Merge pull request #1062 from breed808/process_wmi
feat!: Disable IIS queries in `process` collector
2023-09-30 05:59:58 +10:00
Ben Reedy
6832fd7fd7 feat!: Disable IIS queries in process collector
IIS queries are disabled by default, and can be enabled with the
`--collector.process.iis=true` flag.

These WMI queries are suspected to be one source of virtual memory leaks
in the exporter.

These WMI queries are also responsible for timeouts on some hosts.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-09-30 05:52:06 +10:00
Ben Reedy
5e7462a70e Merge pull request #1292 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.11.1
chore(deps): bump github.com/Microsoft/hcsshim from 0.10.0 to 0.11.1
2023-09-26 18:47:33 +10:00
dependabot[bot]
e8864c766e chore(deps): bump github.com/Microsoft/hcsshim from 0.10.0 to 0.11.1
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.10.0 to 0.11.1.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.10.0...v0.11.1)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 12:00:50 +00:00
rob-scheepens
07fff6afc2 First implementation of physical_disk collector (#803)
* Added physical_disk collector.

Signed-off-by: Rob Scheepens <rob.scheepens@nutanix.com>
Signed-off-by: Brantley West <brantley@nutanix.com>

* exporter.go: Added physical_disk to defaultCollectors

Signed-off-by: Rob Scheepens <rob.scheepens@nutanix.com>
Signed-off-by: Brantley West <brantley@nutanix.com>

* Fix test cases for physicaldisk metrics

Signed-off-by: Rob Scheepens <rob.scheepens@nutanix.com>
Signed-off-by: Brantley West <brantley@nutanix.com>

* physical_disk.go: cleanup gofmt error

Signed-off-by: Brantley West <brantley@nutanix.com>

* physical_disk.go: populate physical disk 'number' label

Signed-off-by: Brantley West <brantley@nutanix.com>

* Added docs/collector.physical_disk.md.

Signed-off-by: Rob Scheepens <rob.scheepens@nutanix.com>

* physical_disk.go: change 'number' label to 'disk' to match node_exporter label

Signed-off-by: Brantley West <brantley@nutanix.com>

* physical_disk.go: adopt github.com/go-kit/log

Signed-off-by: Brantley West <brantley@nutanix.com>

* physical_disk.go: adopt include/exclude disk list

Signed-off-by: Brantley West <brantley@nutanix.com>

* fix: Add init config for physical_disk collector

Signed-off-by: Ben Reedy <breed808@breed808.com>

* chore: gofmt physical_disk collector

Signed-off-by: Ben Reedy <breed808@breed808.com>

---------

Signed-off-by: Rob Scheepens <rob.scheepens@nutanix.com>
Signed-off-by: Brantley West <brantley@nutanix.com>
Signed-off-by: Ben Reedy <breed808@breed808.com>
Co-authored-by: Brantley West <brantley@nutanix.com>
Co-authored-by: Ben Reedy <breed808@breed808.com>
2023-09-22 16:45:22 +10:00
Ben Reedy
083537a96a Merge pull request #1262 from DiniFarb/textfile_collector
Textfile collector: collect files from multiple paths
2023-09-22 06:36:23 +10:00
Ben Reedy
6aa0ac5706 Merge pull request #1283 from breed808/go_version_bump
chore(deps): Bump Go version to v1.21.1
2023-09-11 20:31:10 +10:00
Ben Reedy
7d2d7f3d1c chore(deps): Bump Go version to v1.21.1
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-09-11 20:25:58 +10:00
Ben Reedy
f8c298e038 Merge pull request #1279 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.12.0
chore(deps): bump golang.org/x/sys from 0.11.0 to 0.12.0
2023-09-05 06:14:28 +10:00
Ben Reedy
4e9fa4fd8e Merge pull request #1278 from MarkDordoy/md/add-new-counter
Add new counter LDAP Client Sessions
2023-09-05 06:13:58 +10:00
dependabot[bot]
d8524c505b chore(deps): bump golang.org/x/sys from 0.11.0 to 0.12.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.11.0 to 0.12.0.
- [Commits](https://github.com/golang/sys/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 11:09:55 +00:00
Mark Dordoy
ca6eb75685 add recommendation to prefix with ldap
Signed-off-by: Mark Dordoy <mdordoy@palantir.com>
2023-09-04 09:49:52 +01:00
Mark Dordoy
5631166075 Add description in docs
Signed-off-by: Mark Dordoy <mdordoy@palantir.com>
2023-09-04 09:49:52 +01:00
Mark Dordoy
1d027579d2 Add description, fix typo on type
Signed-off-by: Mark Dordoy <mdordoy@palantir.com>
2023-09-04 09:49:52 +01:00
Mark Dordoy
23e1a86aa7 Fix docs
Signed-off-by: Mark Dordoy <mdordoy@palantir.com>
2023-09-04 09:49:51 +01:00
Mark Dordoy
f8b8b2c546 Added docs, updated to gague. Signed-off-by: Mark Dordoy <mdordoy@palantir.com>
Signed-off-by: Mark Dordoy <mdordoy@palantir.com>
2023-09-04 09:49:51 +01:00
Mark Dordoy
d78230f67b Add new counter
Signed-off-by: Mark Dordoy <mdordoy@palantir.com>
2023-09-04 09:49:47 +01:00
Ben Reedy
f7426e9fad Merge pull request #1276 from DiniFarb/win_srv_stop_error
fix: Windows service can't stop without an error
2023-08-26 08:34:04 +10:00
Dinifarb
fdec95bc99 tie all loggers to global var
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-25 20:04:57 +02:00
Ben Reedy
75ae769b6e Merge pull request #1274 from prometheus-community/dependabot/go_modules/github.com/go-ole/go-ole-1.3.0
chore(deps): bump github.com/go-ole/go-ole from 1.2.6 to 1.3.0
2023-08-23 20:28:49 +10:00
Dinifarb
4add010b8d fix: Windows service can't stop without an error #1258
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-22 16:53:43 +02:00
Dinifarb
7530e7b400 fix: .hidden() for deprecated directory flag
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-21 19:29:19 +02:00
Dinifarb
9473265ffa readme & text changes
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-21 19:29:19 +02:00
Dinifarb
0ec4e9d90f fix: typo
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-21 19:29:19 +02:00
Dinifarb
7876a465ca fix: linter issue
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-21 19:29:19 +02:00
Dinifarb
f9361bb684 (#1236) textfile: more tests added
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-21 19:29:19 +02:00
Dinifarb
f5b9ba35d0 feat: (#1236) textfile: collect files from multiple path
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-21 19:29:19 +02:00
dependabot[bot]
7c178e5ced chore(deps): bump github.com/go-ole/go-ole from 1.2.6 to 1.3.0
Bumps [github.com/go-ole/go-ole](https://github.com/go-ole/go-ole) from 1.2.6 to 1.3.0.
- [Release notes](https://github.com/go-ole/go-ole/releases)
- [Changelog](https://github.com/go-ole/go-ole/blob/master/ChangeLog.md)
- [Commits](https://github.com/go-ole/go-ole/compare/v1.2.6...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/go-ole/go-ole
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 11:56:35 +00:00
Ben Reedy
134bae514d Merge pull request #1273 from breed808/tcp_reset_description
fix(docs): Set correct TCP reset description
2023-08-20 13:34:30 +10:00
Ben Reedy
a4beb4c187 fix(docs): Set correct TCP reset description
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-08-20 13:31:44 +10:00
Ben Reedy
884cac808a Merge pull request #1272 from breed808/adfs_documentation
fix(docs): Remove duplicate ADFS metrics
2023-08-20 11:07:36 +10:00
Ben Reedy
117ba941df fix(docs): Remove duplicate ADFS metrics
Remaining metrics had the correct prefix (windows_adfs_) added.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-08-20 11:05:16 +10:00
Ben Reedy
8d61595607 Merge pull request #1267 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.11.0
chore(deps): bump golang.org/x/sys from 0.10.0 to 0.11.0
2023-08-09 07:06:34 +10:00
Ben Reedy
68f5c61de8 Merge pull request #1220 from yuriyostapenko/hyperv-waittime
Add Hyper-V CPUWaitTimePerDispatch metrics
2023-08-09 06:30:52 +10:00
Yuriy Ostapenko
ca5124fdf9 Add _total suffix for counters
Signed-off-by: Yuriy Ostapenko <yuo@scalepoint.com>
2023-08-08 09:58:06 +02:00
Yuriy Ostapenko
e2b48497f4 Add Hyper-V CPUWaitTimePerDispatch collection
Signed-off-by: Yuriy Ostapenko <yuo@scalepoint.com>
2023-08-08 09:54:10 +02:00
dependabot[bot]
b1eaf00e74 chore(deps): bump golang.org/x/sys from 0.10.0 to 0.11.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/sys/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-07 11:05:12 +00:00
Ben Reedy
34da140f87 Merge pull request #1266 from bragi92/patch-1
fix: Create a monitoring namespace if it does not exist in windows exporter daemonset
2023-08-06 08:16:55 +10:00
Ben Reedy
7a3a978d79 Merge pull request #1264 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.10.0
chore(deps): bump github.com/Microsoft/hcsshim from 0.9.10 to 0.10.0
2023-08-06 08:12:36 +10:00
bragi92
e9b8f82b2c fix: Create a monitoring namespace if it does not exist in windows exporter daemonset
Signed-off-by: bragi92 <kadubey@microsoft.com>
2023-08-01 12:09:01 -07:00
Ben Reedy
b0a1a38829 Merge pull request #1265 from DiniFarb/fix_configfile
fix: config file CLI argument for relative paths -> v0.23.1
2023-08-01 20:56:52 +10:00
Dinifarb
f77bdcfa09 fix: include :// for better http/s recogitation
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-08-01 12:36:30 +02:00
Dinifarb
2fb5b89d92 fix: #1263
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
2023-07-31 18:22:07 +02:00
dependabot[bot]
65c8fa4304 chore(deps): bump github.com/Microsoft/hcsshim from 0.9.10 to 0.10.0
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.10 to 0.10.0.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.10...v0.10.0)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 11:22:33 +00:00
Ben Reedy
8f7031861a Merge pull request #1260 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.9.10
chore(deps): bump github.com/Microsoft/hcsshim from 0.9.8 to 0.9.10
2023-07-26 05:57:38 +10:00
dependabot[bot]
a78c707f47 chore(deps): bump github.com/Microsoft/hcsshim from 0.9.8 to 0.9.10
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.8 to 0.9.10.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.8...v0.9.10)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 11:02:40 +00:00
Ben Reedy
eb1b1ccb54 Merge pull request #1257 from breed808/fix_iis_site_include
fix: Remove default value from deprecated IIS flag
2023-07-22 09:29:12 +10:00
Ben Reedy
8447758db5 fix: Remove default value from deprecated IIS flag
Default value prevented use of the new `collector.iis.site-include`
flag.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-07-22 09:23:44 +10:00
Ben Reedy
05091643c6 Merge pull request #1256 from breed808/fix_msi_flag
fix: Set correct eventlog flag for MSI installer
2023-07-22 08:42:41 +10:00
Ben Reedy
76e73487e4 fix: Set correct eventlog flag for MSI installer
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-07-22 08:38:09 +10:00
Ben Reedy
9a2ec21278 Merge pull request #1255 from jkroepke/fix-eventlog
Fix panic with log.file=eventlog
2023-07-22 08:31:11 +10:00
Jan-Otto Kröpke
44b435e7d4 Fix panic with log.file=eventlog
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-21 20:18:15 +02:00
Ben Reedy
f068cf4523 Merge pull request #1218 from tzifudzi/bugfix/missing-container-metrics
Resolve issue preventing networking container stats from being sent to collector
2023-07-21 18:02:08 +10:00
Tatenda Zifudzi
9adefdceeb fix: Resolve missing container network metrics by querying from HNS
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>
2023-07-20 11:22:29 -07:00
Ben Reedy
be9d2872a5 Merge pull request #1241 from jkroepke/perflib
Integrate perflib
2023-07-19 19:32:44 +10:00
Ben Reedy
89cb5439b8 Merge pull request #1243 from DiniFarb/master
Load config file from URL
2023-07-17 20:26:34 +10:00
DiniFarb
b08ce0697c Update readme (flag part)
Signed-off-by: DiniFarb <andreas.vogt89@bluewin.ch>
2023-07-17 20:10:15 +10:00
DiniFarb
279a8fce89 Update readme: config file part
Signed-off-by: DiniFarb <andreas.vogt89@bluewin.ch>
2023-07-17 20:10:07 +10:00
DiniFarb
11ec45e710 feat: Skip TLS verify in loading config from url
Signed-off-by: DiniFarb <andreas.vogt89@bluewin.ch>
2023-07-17 20:09:58 +10:00
DiniFarb
6797126e78 update readme
Signed-off-by: DiniFarb <andreas.vogt89@bluewin.ch>
2023-07-17 20:09:49 +10:00
DiniFarb
19794ad2e0 feat: load config file from url (#1207)
Signed-off-by: DiniFarb <andreas.vogt89@bluewin.ch>
2023-07-17 20:09:39 +10:00
Jan-Otto Kröpke
9e59bf920f Post rebase issues
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 10:05:51 +02:00
Jan-Otto Kröpke
11218a95d0 Implement Lazy Loading of NameTable
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 10:01:46 +02:00
Jan-Otto Kröpke
9b5bc37a42 Re-add NameIndex
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 10:00:46 +02:00
Jan-Otto Kröpke
9ef897e07b Add LICENSE
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 10:00:46 +02:00
Jan-Otto Kröpke
3a61935273 Cleanup binaryReaderFrom
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 10:00:46 +02:00
Jan-Otto Kröpke
8b9c9a5bd2 Remove HelpNameTable
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 10:00:46 +02:00
Jan-Otto Kröpke
976e055252 move directory
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 10:00:43 +02:00
Jan-Otto Kröpke
9e368d49e7 add error handling
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 09:59:46 +02:00
Jan-Otto Kröpke
ad1ab35399 remove SortObjects
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 09:59:46 +02:00
Jan-Otto Kröpke
81745eeedf fix docs
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 09:59:46 +02:00
Jan-Otto Kröpke
fff737998d move global Name Tables
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 09:59:46 +02:00
Jan-Otto Kröpke
4ea61a2641 Remove unused nameTableLookuper
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 09:59:46 +02:00
Jan-Otto Kröpke
750225775b Integrate perflib
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-15 09:59:43 +02:00
Ben Reedy
80cf16efe8 Merge pull request #1245 from bragi92/master
fix: Update init container in windows exporter so that it works on both WS2019 and WS2022
2023-07-15 10:58:31 +10:00
Kaveesh Dubey
f96c6654be fix: Update init container in windows exporter so that it works on both WS2019 and WS2022
Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>
2023-07-14 17:17:53 -07:00
Ben Reedy
10e42d3583 Merge pull request #1188 from rebortg/master
NPS(feature): add nps collector
2023-07-11 06:28:40 +10:00
Ben Reedy
95f250ed39 feat: Update NPS collector for go-kit logging
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-07-11 06:23:10 +10:00
rebortg
7115c9dc22 add nps collector in init.go
Signed-off-by: rebortg <github@ghlr.de>
2023-07-11 06:04:19 +10:00
rebortg
478eaa91d9 delete init() and rename newNPSCollector function
Signed-off-by: rebortg <github@ghlr.de>
2023-07-11 06:04:15 +10:00
rebortg
217b670272 NPS(feature): add nps collector
Signed-off-by: rebortg <github@ghlr.de>
2023-07-11 06:04:12 +10:00
Ben Reedy
d5e8a0ed7e Merge pull request #1184 from peekjef72/update-terminal_services
fix Terminal Service duplicate session names under load.
2023-07-10 12:06:07 +10:00
Peekjef72
8b74c77663 remove known session name
Signed-off-by: Peekjef72 <67902897+peekjef72@users.noreply.github.com>
2023-07-10 12:00:40 +10:00
Ben Reedy
4077290659 Merge pull request #1192 from jkroepke/custom-logger
switch to go-kit logger
2023-07-10 11:57:32 +10:00
Jan-Otto Kröpke
014153a503 Use 0200 for write permissions
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-10 01:31:26 +02:00
Jan-Otto Kröpke
cfb0111d8c revert fix on newTimeCollector
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-10 00:44:30 +02:00
Jan-Otto Kröpke
5d96a42382 fix typo
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-10 00:44:23 +02:00
Jan-Otto Kröpke
6890f391d4 fix lint
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-09 22:42:00 +02:00
Jan-Otto Kröpke
4350587141 go mod tidy
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-09 22:37:58 +02:00
Jan-Otto Kröpke
8509bc69a6 switch to go-kit logger
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-07-09 22:37:27 +02:00
Ben Reedy
e0e31254e2 Merge pull request #1239 from breed808/pwsh_7.3
feat(doc): Document Powershell v7.3 argument parsing
2023-07-09 13:43:28 +10:00
Ben Reedy
c633aadc71 feat(doc): Document Powershell v7.3 argument parsing
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-07-09 13:42:24 +10:00
Ben Reedy
809424f851 Merge pull request #1238 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.10.0
chore(deps): bump golang.org/x/sys from 0.8.0 to 0.10.0
2023-07-09 08:13:32 +10:00
dependabot[bot]
88d518378c chore(deps): bump golang.org/x/sys from 0.8.0 to 0.10.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.8.0 to 0.10.0.
- [Commits](https://github.com/golang/sys/compare/v0.8.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-08 21:57:53 +00:00
Ben Reedy
8cfd6bbcf1 Merge pull request #1230 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.16.0
chore(deps): bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0
2023-07-09 07:56:54 +10:00
dependabot[bot]
4ba2fe7f22 chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.16.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.15.1...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-08 21:51:13 +00:00
Ben Reedy
a49a0fc612 Merge pull request #1225 from prometheus-community/dependabot/go_modules/github.com/leoluk/perflib_exporter-0.2.1
chore(deps): bump github.com/leoluk/perflib_exporter from 0.2.0 to 0.2.1
2023-07-09 07:50:25 +10:00
dependabot[bot]
23722ae792 chore(deps): bump github.com/leoluk/perflib_exporter from 0.2.0 to 0.2.1
Bumps [github.com/leoluk/perflib_exporter](https://github.com/leoluk/perflib_exporter) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/leoluk/perflib_exporter/releases)
- [Commits](https://github.com/leoluk/perflib_exporter/compare/v0.2.0...v0.2.1)

---
updated-dependencies:
- dependency-name: github.com/leoluk/perflib_exporter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-08 21:43:59 +00:00
Ben Reedy
731b996767 Merge pull request #1224 from prometheus-community/dependabot/go_modules/github.com/yusufpapurcu/wmi-1.2.3
chore(deps): bump github.com/yusufpapurcu/wmi from 1.2.2 to 1.2.3
2023-07-09 07:41:45 +10:00
dependabot[bot]
2fe869f1db chore(deps): bump github.com/yusufpapurcu/wmi from 1.2.2 to 1.2.3
Bumps [github.com/yusufpapurcu/wmi](https://github.com/yusufpapurcu/wmi) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/yusufpapurcu/wmi/releases)
- [Commits](https://github.com/yusufpapurcu/wmi/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: github.com/yusufpapurcu/wmi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 11:57:50 +00:00
Ben Reedy
6ba0297aa9 Merge pull request #1219 from prometheus-community/dependabot/go_modules/github.com/sirupsen/logrus-1.9.3
chore(deps): bump github.com/sirupsen/logrus from 1.9.0 to 1.9.3
2023-06-12 08:04:43 +10:00
dependabot[bot]
dc3e172056 chore(deps): bump github.com/sirupsen/logrus from 1.9.0 to 1.9.3
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.0 to 1.9.3.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.0...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-11 21:46:01 +00:00
Ben Reedy
4327eb386a Merge pull request #1212 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.44.0
chore(deps): bump github.com/prometheus/common from 0.42.0 to 0.44.0
2023-06-12 07:45:12 +10:00
dependabot[bot]
79f4cf5dec chore(deps): bump github.com/prometheus/common from 0.42.0 to 0.44.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.42.0 to 0.44.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.42.0...v0.44.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-11 21:39:44 +00:00
Ben Reedy
5aae5054e6 Merge pull request #1204 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.15.1
chore(deps): bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1
2023-06-12 07:38:55 +10:00
dependabot[bot]
e81231d403 chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.0 to 1.15.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.15.0...v1.15.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-11 21:22:52 +00:00
Ben Reedy
0e0d0f8fd8 Merge pull request #1202 from prometheus-community/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.10.0
chore(deps): bump github.com/prometheus/exporter-toolkit from 0.9.1 to 0.10.0
2023-06-12 07:21:32 +10:00
dependabot[bot]
c1e829dbd5 chore(deps): bump github.com/prometheus/exporter-toolkit
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.9.1 to 0.10.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.9.1...v0.10.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-11 21:15:04 +00:00
Ben Reedy
434788a90a Merge pull request #1205 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.8.0
chore(deps): bump golang.org/x/sys from 0.7.0 to 0.8.0
2023-06-12 07:13:17 +10:00
Ben Reedy
6c06beca1d Merge pull request #1206 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_model-0.4.0
chore(deps): bump github.com/prometheus/client_model from 0.3.0 to 0.4.0
2023-05-23 17:43:28 +10:00
dependabot[bot]
486b4319c7 chore(deps): bump github.com/prometheus/client_model from 0.3.0 to 0.4.0
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 12:07:52 +00:00
dependabot[bot]
88847204ff chore(deps): bump golang.org/x/sys from 0.7.0 to 0.8.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.7.0 to 0.8.0.
- [Commits](https://github.com/golang/sys/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 12:07:45 +00:00
Ben Reedy
79781c6d75 Merge pull request #1201 from ilyam8/fix_hyperv_vswitch_missing_sent_packets
fix: add missing vswitch packets_sent_total
2023-05-07 20:46:22 +10:00
Ben Reedy
4cd095798d Merge pull request #1133 from breed808/iis_duplicates
fix: Ignore duplicate IIS entries from Perflib
2023-05-07 20:17:25 +10:00
Ben Reedy
1d3af58305 fix: Ignore duplicate IIS entries from Perflib
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>
2023-05-07 20:12:32 +10:00
Ben Reedy
b431ff6ac3 Merge pull request #1195 from jkroepke/custom-collector
Move prometheus collector from main to collectors
2023-05-07 13:04:58 +10:00
ilyam8
579369dbf5 fix: add missing vswitch packets_sent_total
Signed-off-by: ilyam8 <ilya@netdata.cloud>
2023-05-04 19:25:17 +03:00
Ben Reedy
f19fa777c3 Merge pull request #1189 from vrapolinario/viniap-msft-ws2022
Add yaml for WS2022 nodes
2023-04-30 08:13:27 +10:00
vrapolinario
0db55044e8 Add yaml for WS2022 nodes
Signed-off-by: vrapolinario <viniap@microsoft.com>
2023-04-26 14:49:27 -07:00
Jan-Otto Kröpke
352492ea97 Move collector from main to separate package
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-04-23 15:25:41 +02:00
Ben Reedy
76c435d12c Merge pull request #1170 from breed808/include_exclude
feat!: Deprecate whitelist/blacklist flags
2023-04-19 09:15:30 +10:00
Ben Reedy
fab77d9d31 feat!: Deprecate whitelist/blacklist flags
Flags have been deprecated in favour of include/exclude terminology.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-04-19 06:11:23 +10:00
Ben Reedy
3627520559 Merge pull request #1186 from jkroepke/custom-kingpin
Remove fluent-style kingpin
2023-04-18 08:27:00 +10:00
Ben Reedy
b033ff71ff Merge pull request #1187 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.15.0
chore(deps): bump github.com/prometheus/client_golang from 1.14.0 to 1.15.0
2023-04-18 07:14:44 +10:00
dependabot[bot]
8d781cf540 chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.14.0...v1.15.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-17 11:58:31 +00:00
Jan-Otto Kröpke
da6898afc4 Remove fluent-style kingpin
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-04-17 13:22:36 +02:00
Ben Reedy
a105e088b3 Merge pull request #1181 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.7.0
chore(deps): bump golang.org/x/sys from 0.6.0 to 0.7.0
2023-04-15 05:31:59 +10:00
Ben Reedy
30955eae17 Merge pull request #1183 from Elpatii/master
Fix telemetry.addr deprecated since v0.21.0
2023-04-15 05:31:13 +10:00
Elpatii
d7b08d7ce0 Fix telemetry.addr deprecated since v0.21.0
Signed-off-by: Elpatii <4057711+Elpatii@users.noreply.github.com>
2023-04-12 14:52:55 +02:00
dependabot[bot]
05abe04d90 chore(deps): bump golang.org/x/sys from 0.6.0 to 0.7.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 11:57:37 +00:00
Ben Reedy
bacd040b17 Merge pull request #1174 from breed808/adfs_jwt
fix!: Fix jtw -> jwt ADFS spelling error
2023-04-04 06:15:29 +10:00
Ben Reedy
1df91ba769 fix!: Fix jtw -> jwt ADFS spelling error
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-04-04 05:49:39 +10:00
Ben Reedy
4e02053f13 Merge pull request #1171 from breed808/diskdrive_name
fix!: Set correct diskdrive collector/metric name
2023-04-04 05:48:05 +10:00
Ben Reedy
535f041423 fix!: Set correct diskdrive collector/metric name
Previous name did not match documentation and WMI class.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-04-03 06:17:15 +10:00
Ben Reedy
49afc93d93 Merge pull request #1112 from breed808/remove_init
Remove init functions from collectors
2023-04-01 18:17:27 +10:00
Ben Reedy
04257a1b25 chore: Ensure collector build funcs are private
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>
2023-04-01 17:54:41 +10:00
Ben Reedy
9214a87d0d feat: Remove init functions from collectors
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>
2023-04-01 17:54:40 +10:00
Ben Reedy
8132083892 Merge pull request #1167 from breed808/ci_deps
chore(ci): Update release workflow actions
2023-03-27 07:04:30 +10:00
Ben Reedy
890fac507e chore(ci): Update release workflow actions
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-03-27 07:03:01 +10:00
Ben Reedy
b29434c7c0 Merge pull request #1166 from breed808/net_output_queue_length
feat: Add output_queue_length metric to net collector
2023-03-26 06:55:02 +10:00
Ben Reedy
7e293a4230 feat: Add output_queue_length metric to net collector
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-03-26 06:48:39 +10:00
Ben Reedy
e21407c112 Merge pull request #1165 from prometheus-community/superq/landing_page
Use new landing page generator
2023-03-26 06:00:29 +10:00
SuperQ
bee042d9fa Use new landing page generator
Use the new exporter-toolkit landing page generator feature.
* Update Go to 1.20.
* Update promu to 0.14.0.

Signed-off-by: SuperQ <superq@gmail.com>
2023-03-25 10:41:48 +01:00
Ben Reedy
6efeace169 Merge pull request #1161 from breed808/default_metrics
feat: Allow default metrics to be disabled
2023-03-25 09:05:52 +10:00
Ben Reedy
a5b3926063 feat: Remove default metrics from e2e test
Metrics are provided by client library, and not the exporter, so
comparing them for differences does not provide much value.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-03-25 09:00:05 +10:00
Ben Reedy
6306973948 feat: Allow default metrics to be disabled
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-03-25 08:59:54 +10:00
Ben Reedy
84b6f15505 Merge pull request #1162 from Mak0tin/update-doc-mssql-iis
Update docs for mssql and iis
2023-03-24 15:49:34 +10:00
Manuel Hernandez
0a75d72610 Update collector.mssql.md
Update metric types from counter to gauge to match code

Signed-off-by: Manuel Hernandez <106690360+Mak0tin@users.noreply.github.com>
2023-03-21 15:49:32 +01:00
Manuel Hernandez
549c4d1098 Update collector.iis.md
Update metric types from counter to gauge to match code

Signed-off-by: Manuel Hernandez <106690360+Mak0tin@users.noreply.github.com>
2023-03-21 12:28:30 +01:00
Ben Reedy
ea2b446130 Merge pull request #1158 from mansikulkarni96/fix1157
fix: Build error with GOFLAGS=-mod=vendor
2023-03-21 07:14:12 +10:00
mansikulkarni96
6129a528c6 fix: Build error with GOFLAGS=-mod=vendor
This commit updates go version in go.mod to go1.17
to resolve build error when vendor flag is used.
Package x/sys/windows requires go1.17 or above
causing make build to fail.

Fixes: #1157
Signed-off-by: mansikulkarni96 <mankulka@redhat.com>
2023-03-20 16:29:10 -04:00
Ben Reedy
13c5bc5c95 Merge pull request #1160 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.9.8
chore(deps): bump github.com/Microsoft/hcsshim from 0.9.7 to 0.9.8
2023-03-21 05:35:54 +10:00
dependabot[bot]
78b11f9dc0 chore(deps): bump github.com/Microsoft/hcsshim from 0.9.7 to 0.9.8
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.7 to 0.9.8.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.7...v0.9.8)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 11:58:22 +00:00
Ben Reedy
0dc4acac00 Merge pull request #1144 from fuxingZhang/patch-1
docs: fix documentation error
2023-03-19 08:03:10 +10:00
zfx
931c3f78d9 docs: fix documentation errors
Fix the documentation and code inconsistencies caused by the following commit
> e9c594473c

Signed-off-by: zfx <fuxing.zhang@qq.com>
2023-03-13 15:46:36 +08:00
Ben Reedy
6a26df8069 Merge pull request #1148 from ankom2007/patch-1
Update collector.iis.md
2023-03-13 09:47:41 +10:00
Ben Reedy
a4404fa77a Merge pull request #1150 from prometheus-community/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.9.1
chore(deps): bump github.com/prometheus/exporter-toolkit from 0.8.2 to 0.9.1
2023-03-13 09:44:23 +10:00
dependabot[bot]
e19f80e5c7 chore(deps): bump github.com/prometheus/exporter-toolkit
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.8.2 to 0.9.1.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.8.2...v0.9.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 09:36:27 +10:00
Ben Reedy
416ccf1228 chore(deps): bump github.com/alecthomas/kingpin
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>
2023-03-13 09:36:23 +10:00
Ben Reedy
edbccbdad4 Merge pull request #1151 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.42.0
chore(deps): bump github.com/prometheus/common from 0.39.0 to 0.42.0
2023-03-12 18:34:16 +10:00
dependabot[bot]
aa66719b30 chore(deps): bump github.com/prometheus/common from 0.39.0 to 0.42.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.39.0 to 0.42.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.39.0...v0.42.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-12 08:11:20 +00:00
Ben Reedy
b1b8c34361 Merge pull request #1146 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.6.0
chore(deps): bump golang.org/x/sys from 0.4.0 to 0.6.0
2023-03-12 18:10:12 +10:00
dependabot[bot]
9c08c916e0 chore(deps): bump golang.org/x/sys from 0.4.0 to 0.6.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.4.0 to 0.6.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.4.0...v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-12 07:41:49 +00:00
Ben Reedy
b6c91bfe8c Merge pull request #1152 from breed808/wmi_upstream_change
chore(deps): Update wmi to v1.2.2
2023-03-12 17:41:01 +10:00
Ben Reedy
7886cf9e37 chore(deps): Update wmi to v1.2.2
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>
2023-03-12 17:34:34 +10:00
Ben Reedy
8d4c38b48e chore(ci): Update golangci-lint to v1.51.2
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-03-12 17:34:33 +10:00
Ben Reedy
0a26661b7d Merge pull request #1142 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.9.7
chore(deps): bump github.com/Microsoft/hcsshim from 0.9.6 to 0.9.7
2023-03-12 09:31:16 +10:00
Ankur Agarwal
864687daed Update collector.iis.md
Added the description of the metrics for "no documented yet"

Signed-off-by: Ankur Agarwal <75574195+ankom2007@users.noreply.github.com>
2023-03-08 18:16:41 +11:00
dependabot[bot]
c8c3cefecc chore(deps): bump github.com/Microsoft/hcsshim from 0.9.6 to 0.9.7
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.6 to 0.9.7.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.6...v0.9.7)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 11:59:24 +00:00
Ben Reedy
12e5422845 Merge pull request #1137 from DennisGaida/patch-1
Added quote information for absolute paths
2023-02-25 09:57:37 +10:00
Ben Reedy
a7960872bb Merge pull request #1136 from bck01215/patch-2
Remove Bad Comment
2023-02-18 11:17:07 +10:00
Dennis Gaida
94aff9fe73 Added quote information for absolute paths
This had me running in circles because `ioutil.ReadFile` did not read the local file for me when running as a service (i.e. `config.yml` in the same folder as the `windows_exporter.exe`). I had to use absolute paths and additionally quote them.

Signed-off-by: Dennis Gaida <2392217+DennisGaida@users.noreply.github.com>
2023-02-15 16:40:22 +01:00
Brandon Kauffman
9044097f2c Remove Bad Comment
Signed-off-by: Brandon Kauffman <bck01215@gmail.com>
2023-02-14 08:56:11 -05:00
Ben Reedy
a52ce30089 Merge pull request #1127 from tpowelldev/master
Add VDI Metrics collections
2023-02-12 09:44:35 +10:00
Tom Powell
846263afee Returning test functions to public
Signed-off-by: Tom Powell <t.powell@mwam.com>
2023-02-08 10:12:15 +00:00
Tom Powell
ba3cffdc79 Applying PR comments
Signed-off-by: Tom Powell <t.powell@mwam.com>
2023-02-08 09:30:36 +00:00
Tom Powell
dde839b66d Adding Teradici PCoIP session metrics collection
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>
2023-01-25 12:04:55 +00:00
Ben Reedy
ca15e2c70d Merge pull request #1121 from breed808/diskdrive_docs
Add labels to diskdrive docs
2023-01-15 09:53:27 +10:00
Ben Reedy
0ea3bfa5c9 chore(docs): Add labels to diskdrive docs
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-01-15 09:51:45 +10:00
Ben Reedy
5331909446 Merge pull request #1095 from 6fears7/master
Add Win32_DiskDrive Collector
2023-01-15 09:27:49 +10:00
Ben Reedy
e8eb77363e Merge pull request #1119 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.4.0
chore(deps): bump golang.org/x/sys from 0.3.0 to 0.4.0
2023-01-14 08:47:08 +10:00
pgibbs1
da2707c594 Removed placeholder text
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
pgibbs1
b0844b9118 Fixed linting md
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
pgibbs1
27977e3730 Added collector docs, entry to readme
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
sixfears7
f2f9f624b5 Updated naming convention, fixed metric type
Signed-off-by: sixfears7 <57415489+6fears7@users.noreply.github.com>
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
sixfears7
586152a4ad Updated code to add label to size and partition
Signed-off-by: sixfears7 <57415489+6fears7@users.noreply.github.com>
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
pgibbs1
9a2ef3fca8 Fixed blackslashes, replaced model with name
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
pgibbs1
6912c5b1e7 Removed commented benchmark
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
pgibbs1
f24fc07ac4 Fixed moved files
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
sixfears7
653182a90c Added diskdrive collector
To retrieve data from Win32_DiskDrive Object

Signed-off-by: sixfears7 <57415489+6fears7@users.noreply.github.com>
Signed-off-by: pgibbs1 <pgibbs1@liberty.edu>
2023-01-12 17:08:59 -05:00
dependabot[bot]
2958e0801d chore(deps): bump golang.org/x/sys from 0.3.0 to 0.4.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 11:04:33 +00:00
Ben Reedy
f5a3cf7839 Merge pull request #1118 from breed808/ci_fix
Fix CI release issues
2023-01-06 07:47:25 +10:00
Ben Reedy
72995f4bb1 fix(ci): Disable ARM MSI builds
Version of Wix in use (3.11.0.1701) doesn't support ARM builds.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-01-06 07:44:53 +10:00
Ben Reedy
1db0dd909b fix(ci): Set correct download URL for promu tool
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-01-06 07:44:52 +10:00
Ben Reedy
cd23833ff2 Merge pull request #1117 from breed808/ci
Update deprecated Github Actions
2023-01-05 22:30:38 +10:00
Ben Reedy
20d7048478 chore(ci): Update deprecated Github Actions
checkout@v2 and go-setup@v2 both used a deprecated Node.js version (12)

See https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
for context

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-01-05 22:26:33 +10:00
Ben Reedy
a8fad055ac Merge pull request #1115 from breed808/ci
Split CI/CD configuration
2023-01-05 22:05:36 +10:00
Ben Reedy
484385d387 feat(ci): Download promu binaries
Compiling of promu tool unnecessarily extended CI duration.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-01-05 22:01:33 +10:00
Ben Reedy
bf181eee38 feat(ci): Split CI/CD configuration
`build` job was redundant for PRs and pushes to `master` branch, as `go build`
is run in the e2e job.

Linting jobs only need to be run for code changes, and were unnecessarily
extending CI duration for documentation changes.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-01-05 22:01:29 +10:00
Ben Reedy
260e34394a Merge pull request #1113 from tehseenshahab/tesh-logical-disk-collector-extension
Add Avg logical disk RW Queue metrics
2023-01-03 10:12:42 +10:00
Tehseen Shahab
d0c6d13e3b Update e2e output for new metrics
Signed-off-by: Tehseen Shahab <tehseen.shahab@gmail.com>
2023-01-02 11:02:45 +01:00
Tehseen Shahab
f10a06f908 Update metric type to gauge
Signed-off-by: Tehseen Shahab <tehseen.shahab@gmail.com>
2023-01-02 11:02:45 +01:00
Tehseen Shahab
7479946385 Update metric type to gauge
Signed-off-by: Tehseen Shahab <tehseen.shahab@gmail.com>
2023-01-02 11:02:45 +01:00
Tehseen Shahab
66a1e18c32 Add Avg logical disk RW Queue metrics
Signed-off-by: Tehseen Shahab <tehseen.shahab@gmail.com>
2023-01-02 11:02:44 +01:00
Ben Reedy
10078892c2 Merge pull request #1110 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.39.0
chore(deps): bump github.com/prometheus/common from 0.38.0 to 0.39.0
2023-01-02 07:04:47 +10:00
dependabot[bot]
f6912cc645 chore(deps): bump github.com/prometheus/common from 0.38.0 to 0.39.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.38.0 to 0.39.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.38.0...v0.39.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-02 06:54:18 +10:00
Ben Reedy
c791e5212c Merge pull request #1114 from breed808/scheduled_task_example
Add scheduled_task flag examples
2023-01-01 12:27:10 +10:00
Ben Reedy
09bc4e9e1b chore(docs): Add scheduled_task flag examples
Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-01-01 12:13:21 +10:00
Ben Reedy
015b7c0666 Merge pull request #1109 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.9.6
chore(deps): bump github.com/Microsoft/hcsshim from 0.9.4 to 0.9.6
2022-12-21 07:39:20 +10:00
dependabot[bot]
5dda46de98 chore(deps): bump github.com/Microsoft/hcsshim from 0.9.4 to 0.9.6
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.4 to 0.9.6.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.4...v0.9.6)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 11:06:46 +00:00
Ben Reedy
25c1449b91 Merge pull request #1108 from breed808/os_paging
fix: Continue os collection on missing page file
2022-12-17 16:59:01 +10:00
Ben Reedy
29086368ac fix: Continue os collection on missing page file
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-12-17 07:37:25 +10:00
Ben Reedy
1f9d29470c Merge pull request #1104 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.38.0
chore(deps): bump github.com/prometheus/common from 0.37.0 to 0.38.0
2022-12-16 22:28:38 +10:00
Ben Reedy
1493a20262 Merge pull request #1088 from higels/add_mperf_metric
Add cpu metrics based on newer and more accurate perflib sources
2022-12-16 21:51:01 +10:00
dependabot[bot]
f8c98e60db chore(deps): bump github.com/prometheus/common from 0.37.0 to 0.38.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.37.0 to 0.38.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.37.0...v0.38.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 11:03:13 +00:00
Steffen Higel
f32342400f Fixing up e2e tests for new CPU perf metrics
Signed-off-by: Steffen Higel <higels@valvesoftware.com>
2022-12-08 14:08:32 -08:00
Ben Reedy
9a73630b48 Merge pull request #1102 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.3.0
chore(deps): bump golang.org/x/sys from 0.2.0 to 0.3.0
2022-12-06 06:44:01 +10:00
dependabot[bot]
5da47255e2 chore(deps): bump golang.org/x/sys from 0.2.0 to 0.3.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 11:03:34 +00:00
Ben Reedy
eb102fd37f Merge pull request #1100 from knabben/dedup-listen-address
Cleaning up listen addresses flags before parsing config file
2022-12-04 13:04:32 +10:00
Amim Knabben
3aa409590f Cleaning up listen addresses flags before parsing config file
Signed-off-by: Amim Knabben <aknabben@vmware.com>
2022-12-03 21:03:58 -03:00
Ben Reedy
e8991095d4 Merge pull request #1099 from breed808/exporter_toolkit
chore(deps): bump github.com/prometheus/exporter-toolkit from 0.8.1 to 0.8.2
2022-11-30 19:24:37 +10:00
Ben Reedy
3dbb37deb5 chore(deps): bump github.com/prometheus/exporter-toolkit from 0.8.1 to 0.8.2
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-11-30 18:58:27 +10:00
Ben Reedy
53b6816612 Merge pull request #1096 from bck01215/patch-1
Compatibily with new flag web.listen-address
2022-11-23 19:14:18 +10:00
Ben Reedy
44b63dc23c Merge pull request #1093 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.14.0
chore(deps): bump github.com/prometheus/client_golang from 1.13.0 to 1.14.0
2022-11-23 18:29:54 +10:00
Ben Reedy
8b8fd2d3a6 Merge pull request #1094 from prometheus-community/dependabot/go_modules/golang.org/x/sys-0.2.0
chore(deps): bump golang.org/x/sys from 0.1.0 to 0.2.0
2022-11-23 18:27:57 +10:00
Brandon Kauffman
134f62511f Compatibily with ne flag web.listen-address
Signed-off-by: Brandon Kauffman <bck01215@gmail.com>
2022-11-18 20:02:42 -05:00
dependabot[bot]
09a83cf01f chore(deps): bump golang.org/x/sys from 0.1.0 to 0.2.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-14 11:03:46 +00:00
dependabot[bot]
46ed47c585 chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-14 11:03:36 +00:00
Steffen Higel
187dbfc4ae Add cpu metrics based on newer and more accurate perflib sources
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>
2022-11-02 14:34:04 -07:00
Ben Reedy
6ddab61fa5 Merge pull request #1084 from breed808/perflib
chore(deps): bump perflib to v0.2.0
2022-10-25 16:01:29 +10:00
Ben Reedy
e4b8b5718f chore(deps): bump perflib to v0.2.0
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-10-25 15:51:32 +10:00
Ben Reedy
86f12b9e55 Merge pull request #1082 from prometheus-community/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.8.1
chore(deps)!: bump github.com/prometheus/exporter-toolkit from 0.7.1 to 0.8.1
2022-10-25 11:50:28 +10:00
Ben Reedy
48cef00491 Merge pull request #1083 from vear959595/master
Add files via upload
2022-10-25 11:40:11 +10:00
Ben Reedy
e9c594473c chore(deps)!: bump github.com/prometheus/exporter-toolkit
Introduction of `web.listen-address` flag in upstream library
(bca43f192e)
has necessitated the removal of the `telemetry.addr` flag in favour of
the upstream flag.

Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.7.1 to 0.8.1.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.7.1...v0.8.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-10-25 11:38:50 +10:00
Ben Reedy
63fb570b23 Merge pull request #1081 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_model-0.3.0
chore(deps): bump github.com/prometheus/client_model from 0.2.0 to 0.3.0
2022-10-25 09:09:21 +10:00
dependabot[bot]
cff611b60c chore(deps): bump github.com/prometheus/client_model from 0.2.0 to 0.3.0
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 22:58:04 +00:00
Ben Reedy
9a262579ce Merge pull request #1080 from breed808/scheduled_task_memory
fix: Remove memory leaks in scheduled_task
2022-10-25 08:51:32 +10:00
Ben Reedy
25d23852d4 fix: Remove memory leaks in scheduled_task
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>
2022-10-25 08:36:36 +10:00
Ben Reedy
70dcd80f3d Merge pull request #1055 from breed808/arm64_builds
Add ARM64 builds to releases
2022-10-25 08:32:26 +10:00
vear959595
c3fa0039ba Add files via upload
adding 503 http error collector

Signed-off-by: vear959595 <69949561+vear959595@users.noreply.github.com>
2022-10-24 21:26:54 +07:00
Ben Reedy
7a6e2d7456 feat(ci): Add ARM64 builds to releases
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-10-24 21:21:43 +10:00
Ben Reedy
68f7efec32 Merge pull request #1077 from MarNicGit/patch-1
Update collector.process.md
2022-10-22 10:03:03 +10:00
Ben Reedy
15b8276cf3 Merge pull request #1078 from gillg/bump-x-sys
Try to bump /x/sys to the current stable version to fix IsWindowsService()
2022-10-19 21:18:07 +10:00
Guillaume Gill
e01dd5e334 Try to bump /x/sys to the current stable version to fix IsWindowsService()
Signed-off-by: Guillaume Gill <guillaume.gill@orangelogic.com>
2022-10-18 22:45:30 +02:00
MarNicGit
8f8369a356 Fixed spelling error
Signed-off-by: MarNicGit <47538428+MarNicGit@users.noreply.github.com>
2022-10-18 10:50:09 +02:00
MarNicGit
347759933f Update collector.process.md
Documented IIS worker process apppool matching.

Discovered this feature at [process.go:221](eb73859393/collector/process.go (L221)). This also solves issue #1074.

Signed-off-by: MarNicGit <47538428+MarNicGit@users.noreply.github.com>
2022-10-18 10:50:09 +02:00
Ben Reedy
eb73859393 Merge pull request #1075 from MarNicGit/patch-1
Update regex
2022-10-10 19:22:45 +10:00
MarNicGit
3e2357fd68 Update regex
Updated the regexp's to better working ones. `.+` does not match process names with no extension. Also used a neater regexp for the `|` example.

Signed-off-by: MarNicGit <47538428+MarNicGit@users.noreply.github.com>
2022-10-08 00:00:53 +02:00
Ben Reedy
677a7c8d67 Merge pull request #1065 from shivsepra/patch-1
Update collector.mssql.md
2022-09-24 06:59:04 +10:00
Shiva Prasad
8f05e77b0a Update collector.mssql.md
Corrected the buffer cache hit ratio PromQL

Signed-off-by: Shiva Prasad <sr7231@gmail.com>
2022-09-21 15:27:34 +05:30
Ben Reedy
8efca83ac4 Merge pull request #1059 from kaffarell/master
Added WebService uptime metric in iis collector
2022-09-14 07:19:51 +10:00
kaffarell
fb38512f38 Added WebService uptime metric in iis collector
Signed-off-by: kaffarell <gabrielgoller123@gmail.com>
2022-09-13 16:41:44 +02:00
Ben Reedy
63800b5c6a Merge pull request #1061 from kaffarell/patch-1
Update collector.logon.md
2022-09-13 06:31:47 +10:00
Gabriel Goller
c1b7ca42c5 Update collector.logon.md
Signed-off-by: Gabriel Goller <gabrielgoller123@gmail.com>
2022-09-10 12:34:19 +02:00
Ben Reedy
f8abca5292 Merge pull request #999 from trunov-ms/master
fix PercentTimeinGC metric
2022-09-10 10:55:25 +10:00
Max Trunov
2ef7c5604a gofmt netframework_clrmemory.go
Signed-off-by: Max Trunov <trunov_ms@taximaxim.ru>
2022-09-09 17:13:26 +05:00
Ben Reedy
a0a81c4a9f Merge pull request #1060 from kaffarell/iis-docs
Added documentation for iis collector
2022-09-09 20:23:42 +10:00
kaffarell
8e27a9983f Added documentation for iis collector
Signed-off-by: kaffarell <gabrielgoller123@gmail.com>
2022-09-09 12:08:33 +02:00
amdmax
6d506887cd Add comments to changes
Signed-off-by: Max Trunov <trunov_ms@taximaxim.ru>
2022-09-07 09:13:12 +05:00
Ben Reedy
15be1c1bd6 Merge pull request #1052 from breed808/os_version_docs
Document recent changes to os_build_info metric
2022-08-30 18:00:40 +10:00
Ben Reedy
7bd2ebc6d0 Document recent changes to os_build_info metric
Changes introduced in 46fa84f have exposed additional labels to the
os_build_info metric.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-08-30 17:50:15 +10:00
Ben Reedy
690fe8de86 Merge pull request #1051 from benridley/feature_version_info
Export extra version information
2022-08-30 16:47:26 +10:00
Ben Ridley
46fa84f9b0 Export extra version information
Adds major version, minor version, and build number as independent
labels when exporting OS info.

Signed-off-by: Ben Ridley <benridley29@gmail.com>
2022-08-29 22:02:00 -07:00
Ben Reedy
4b226cde40 Merge pull request #1047 from jammiemil/master
fix Windows Service timeout during high CPU (eg. post Windows Update)
2022-08-24 21:00:22 +10:00
Ben Reedy
cdeceaeca5 Merge pull request #1034 from gloyka/master
Add Hyper-V Hypervisor Logical Processor metrics
2022-08-24 19:11:18 +10:00
Jamie Milton
8061c4e5fa Additional Comments
Signed-off-by: Jamie Milton <jammiemil@hotmail.com>
2022-08-24 10:04:23 +01:00
Jamie Milton
981d687e60 Remove unused Const
Signed-off-by: Jamie Milton <jammiemil@hotmail.com>
2022-08-24 09:16:16 +01:00
Anton Akhmedzyanov
37ea988125 Added percent suffix for metric names
Signed-off-by: Anton Akhmedzyanov <gloin@gloin.ru>
2022-08-23 19:42:16 +03:00
Anton Akhmedzyanov
a722cee322 Add Hyper-V Hypervisor CPU utilization query.
Signed-off-by: Anton Akhmedzyanov <gloin@gloin.ru>
2022-08-23 19:42:16 +03:00
Anton Akhmedzyanov
b43978eeb4 Add Hyper-V Hypervisor Logical Processor metrics
Signed-off-by: Anton Akhmedzyanov <gloin@gloin.ru>
2022-08-23 19:42:16 +03:00
Jamie Milton
f02f51aceb Correct Channel Definition
Signed-off-by: Jamie Milton <jammiemil@hotmail.com>
2022-08-23 16:47:31 +01:00
Jamie Milton
a5f22ebb04 Move Service Initiate out to seperate package
Signed-off-by: Jamie Milton <jammiemil@hotmail.com>
2022-08-23 14:57:16 +01:00
Ben Reedy
1c199e6c0e Merge pull request #1036 from alvarocabanas/master
Fix Error "Service Access is denied" in service collector useApi
2022-08-23 07:38:08 +10:00
Ben Reedy
306197fe93 Merge pull request #1028 from prometheus-community/dependabot/go_modules/github.com/sirupsen/logrus-1.9.0
chore(deps): bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0
2022-08-21 18:38:11 +10:00
dependabot[bot]
45fac2a618 chore(deps): bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.8.1...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-21 08:28:00 +00:00
Ben Reedy
716707cd06 Merge pull request #1043 from breed808/ci_spellcheck
Fix broken Spellcheck CI job
2022-08-20 21:55:56 +10:00
Ben Reedy
4b0bcb46d0 Fix Exchange docs spelling error
Required to fix Github CI/CD

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-08-20 21:44:42 +10:00
Ben Reedy
55312ebdca Don't spellcheck Go dependency files
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-08-20 21:44:38 +10:00
Ben Reedy
3df660799c Merge pull request #1041 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.13.0
chore(deps): bump github.com/prometheus/client_golang from 1.12.2 to 1.13.0
2022-08-20 20:27:37 +10:00
dependabot[bot]
8ef590ee3a chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.2 to 1.13.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.12.2...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 11:13:15 +00:00
alvarocabanas
c9e28c4c00 Fix Service Access is denied in collector useApi
Signed-off-by: Alvaro Cabanas <albanas@gmail.com>
Signed-off-by: alvarocabanas <acabanas@newrelic.com>
2022-07-29 10:53:29 +02:00
Ben Reedy
c5ec339750 Merge pull request #1030 from prometheus-community/dependabot/go_modules/gopkg.in/yaml.v3-3.0.1
chore(deps): bump gopkg.in/yaml.v3 from 3.0.0 to 3.0.1
2022-07-27 19:51:10 +10:00
Ben Reedy
2602ca04f6 Merge pull request #1029 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.9.4
chore(deps): bump github.com/Microsoft/hcsshim from 0.9.3 to 0.9.4
2022-07-27 19:48:28 +10:00
dependabot[bot]
8fe8e85559 chore(deps): bump gopkg.in/yaml.v3 from 3.0.0 to 3.0.1
Bumps [gopkg.in/yaml.v3](https://github.com/go-yaml/yaml) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/go-yaml/yaml/releases)
- [Commits](https://github.com/go-yaml/yaml/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: gopkg.in/yaml.v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 11:25:10 +00:00
dependabot[bot]
38cfae3e66 chore(deps): bump github.com/Microsoft/hcsshim from 0.9.3 to 0.9.4
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.3 to 0.9.4.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.3...v0.9.4)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 11:25:06 +00:00
Ben Reedy
b2ed5f61b4 Merge pull request #997 from breed808/yaml_v3
Update gopkg.in/yaml_v2 to yaml_v3
2022-07-25 17:15:39 +10:00
Ben Reedy
752d467b12 Merge pull request #1026 from breed808/ci
Add content write permissions to GITHUB_TOKEN
2022-07-23 19:24:58 +10:00
Ben Reedy
1fab2621eb Add content write permissions to GITHUB_TOKEN
Write permissions are required to upload release artifacts.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-07-23 19:05:47 +10:00
Ben Reedy
739642bd6a Merge pull request #1015 from breed808/iis_log_noise
Skip missing IIS instances
2022-07-23 10:31:18 +10:00
Ben Reedy
a4cf96d94d Skip missing IIS instances
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>
2022-07-23 09:59:01 +10:00
Ben Reedy
1dd7b58bdf Merge pull request #1025 from alexwiedermann/mscluster-fix-wrong-metric
fix: remove UpdateDomain (mscluster-resourcegroup)
2022-07-23 09:57:03 +10:00
Ben Reedy
c696fb40cf Merge pull request #1021 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.37.0
chore(deps): bump github.com/prometheus/common from 0.35.0 to 0.37.0
2022-07-23 09:47:02 +10:00
Alex Wiedermann
ae4bc822e8 fix: remove UpdateDomain (mscluster-resourcegroup)
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>
2022-07-22 18:06:29 -03:00
dependabot[bot]
096949c682 chore(deps): bump github.com/prometheus/common from 0.35.0 to 0.37.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.35.0 to 0.37.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.35.0...v0.37.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 11:20:37 +00:00
Ben Reedy
da15c9659d Merge pull request #1020 from Woldelig/patch-1
Update collector.fsrmquota.md
2022-07-16 10:31:37 +10:00
Christoffer Wold
a12b3e0ea0 Update collector.fsrmquota.md
Fix table formatting

Signed-off-by: Christoffer Wold <christoffer.wold@gmail.com>
2022-07-15 10:33:35 +02:00
Ben Reedy
7e7bdc104f Merge pull request #1012 from gopihc/patch-1
Update kubernetes.md
2022-07-02 07:05:52 +10:00
Gopi Chinnappa
682e6967b0 Update kubernetes.md
Signed-off-by: Gopi Chinnappa <gopihc@gmail.com>
2022-06-28 17:29:56 +05:30
Ben Reedy
93dcdf95f7 Merge pull request #885 from sstorie/mscluster
Add support for MSCluster collectors
2022-06-23 19:25:48 +10:00
Ben Reedy
3619d14844 Merge pull request #1003 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.35.0
Bump github.com/prometheus/common from 0.34.0 to 0.35.0
2022-06-21 07:18:11 +10:00
dependabot[bot]
9712fa3bad Bump github.com/prometheus/common from 0.34.0 to 0.35.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.34.0 to 0.35.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-20 11:38:44 +00:00
Sam Storie
fe7730a51b chore: adding links to the doc pages in the README
Signed-off-by: Storie <Sam.Storie@Emerson.com>
2022-06-19 18:40:43 +10:00
Sam Storie
61ea9d049c chore: fix mis-spelling
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:42 +10:00
Sam Storie
a50fe95370 chore: adding/updating the documentation for mscluster_resourcegroup collector
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:41 +10:00
Sam Storie
33615c8b58 chore: updating the label list in the docs
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:40 +10:00
Sam Storie
313ffb73bd chore: Adding/updating the documentation for mscluster_resource collector
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:39 +10:00
Sam Storie
48e54e8513 chore: Adding/updating documentation for mscluster_node collector
The isolation or quarantine status of the node.

Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:39 +10:00
Sam Storie
bf5177ed12 chore: fixing a typo
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:38 +10:00
Sam Storie
00f79ebaf4 chore: Adding/updating documentation for mscluster_network collector
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:37 +10:00
Sam Storie
3d50cf4309 chore: Added/updated documentation for mscluster_cluster collector
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:36 +10:00
Sam Storie
c7cbc48afc chore: updated links to MS documentation for each struct
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:35 +10:00
Sam Storie
0f304413b5 chore: removing some errant comments about perflib
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:34 +10:00
Sam Storie
b6f12aeb9f feat: added the mscluster_resourcegroup collector functionality
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:33 +10:00
Sam Storie
af523f13bc feat: added the mscluster_resource collector functionality
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:32 +10:00
Sam Storie
8c7dd7fd5f feat: added the mscluster_cluster collector functionality
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:31 +10:00
Sam Storie
6a186f26f0 feat: added mscluster_network collector functionality
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:30 +10:00
Sam Storie
740e277cf6 feat: Adding mscluster_node collector functionality
Breaks out the metrics by the name specified by each node

Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:29 +10:00
Sam Storie
96e081c7d4 feat: adapting to support CimSession and alternative namespaces
Signed-off-by: Sam Storie <sam.storie@emerson.com>
2022-06-19 18:40:28 +10:00
Ben Reedy
3cf0fa347f Merge pull request #954 from breed808/os_paging
Continue OS collector on absent paging file
2022-06-12 09:27:19 +10:00
Ben Reedy
ebabddf558 Continue OS collector on absent paging file
Inactive or missing paging file should not be cause for OS collector to
fail.
Instead, log the error and continue with OS collection.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-06-12 09:13:21 +10:00
amdmax
4e76e6938a fix PercentTimeinGC metric
Signed-off-by: Max Trunov <trunov_ms@taximaxim.ru>
2022-06-10 14:45:45 +05:00
Ben Reedy
5f9759586e Update gopkg.in/yaml_v2 to yaml_v3
Previous version was vulnerable to CVE-2022-28948

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-05-29 10:46:09 +10:00
Ben Reedy
7f69cc0acf Merge pull request #995 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.9.3
Bump github.com/Microsoft/hcsshim from 0.9.2 to 0.9.3
2022-05-29 10:30:43 +10:00
dependabot[bot]
820c6bdb93 Bump github.com/Microsoft/hcsshim from 0.9.2 to 0.9.3
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.2 to 0.9.3.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.2...v0.9.3)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-23 11:13:54 +00:00
Ben Reedy
6042ea3e51 Merge pull request #990 from prometheus-community/dependabot/go_modules/github.com/go-kit/log-0.2.1
Bump github.com/go-kit/log from 0.2.0 to 0.2.1
2022-05-17 09:25:51 +10:00
dependabot[bot]
641f3222c7 Bump github.com/go-kit/log from 0.2.0 to 0.2.1
Bumps [github.com/go-kit/log](https://github.com/go-kit/log) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/go-kit/log/releases)
- [Commits](https://github.com/go-kit/log/compare/v0.2.0...v0.2.1)

---
updated-dependencies:
- dependency-name: github.com/go-kit/log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-16 23:12:38 +00:00
Ben Reedy
9241df5528 Merge pull request #989 from prometheus-community/dependabot/go_modules/github.com/go-ole/go-ole-1.2.6
Bump github.com/go-ole/go-ole from 1.2.5 to 1.2.6
2022-05-17 09:11:46 +10:00
dependabot[bot]
c443eafe2b Bump github.com/go-ole/go-ole from 1.2.5 to 1.2.6
Bumps [github.com/go-ole/go-ole](https://github.com/go-ole/go-ole) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/go-ole/go-ole/releases)
- [Changelog](https://github.com/go-ole/go-ole/blob/master/ChangeLog.md)
- [Commits](https://github.com/go-ole/go-ole/compare/v1.2.5...v1.2.6)

---
updated-dependencies:
- dependency-name: github.com/go-ole/go-ole
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-16 22:50:05 +00:00
Ben Reedy
0cd6fd3f3c Merge pull request #988 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.12.2
Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2
2022-05-17 08:49:13 +10:00
Ben Reedy
79a3a1ccec Adjust e2e output for client_golang-1.12.2
v1.12.2 removes some high cardinality metrics introduced in v1.12.0.
See https://github.com/prometheus/client_golang/issues/967 for context.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-05-17 08:04:25 +10:00
dependabot[bot]
603cb54e8f Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.1 to 1.12.2.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.12.1...v1.12.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-16 11:14:21 +00:00
Ben Reedy
329a96de44 Merge pull request #968 from breed808/textfile
Skip processing files with duplicates metrics
2022-05-16 18:46:23 +10:00
Ben Reedy
fd36eae54d Merge pull request #982 from yangliyl/fix/replace-functions
replace these deprecated functions
2022-05-15 13:13:53 +10:00
yangliyl
0dc32bf434 replace these deprecated functions
Signed-off-by: yangliyl <yangli_yl@qq.com>
2022-05-15 09:49:08 +08:00
Ben Reedy
306e63a240 Skip processing files with duplicates metrics
This change affects processing of single files with duplicate metrics.
Single files with duplicate metrics will be skipped, with no metrics being
collected and exposed by the exporter.

Previous duplicate metric processing across multiple files remains
unchanged (all files skipped, collector returns error).

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-05-15 08:56:23 +10:00
Ben Reedy
42c05df272 Merge pull request #969 from breed808/init_powershell
Use `powershell` image for firewall init container
2022-05-15 08:47:10 +10:00
Ben Reedy
f471cc0e4e Use powershell image for firewall init container
Previous `nanoserver` image did not have Powershell installed, causing
the init container to fail.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-05-15 08:38:31 +10:00
Calle Pettersson
3c4ae95a8d Merge pull request #821 from mousavian/master
Adding Scheduled Tasks Collector
2022-05-14 21:00:23 +02:00
Ben Reedy
21f4757b63 Merge pull request #971 from andbanman/ft_hyperv_vm_memory
Add Hyper-V VM Memory metrics
2022-05-13 07:43:16 +10:00
Ben Reedy
4aba3e1222 Add initial docs for hyperv memory metrics
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-05-13 07:14:55 +10:00
Andrew Banman
8f6204f960 Fix typo in vm_memory_pressure_minimum description
Signed-off-by: Andrew Banman <abanman@pnri.org>
2022-05-12 13:26:26 -07:00
Andrew Banman
dd494b11bb Add _total to hyper-v memory counter metrics
Signed-off-by: Andrew Banman <abanman@pnri.org>
2022-05-12 10:00:59 -07:00
Andrew Banman
9f384e3db1 Fix hyper-v collector memory metric names
Remove "memory", which is redundant with the module and breaks symmetry
with vm_memory_physical_guest_visible.

Signed-off-by: Andrew Banman <abanman@pnri.org>
2022-05-12 09:54:41 -07:00
Andrew Banman
68c338b479 Fix hyper-v collector memory metric descriptions
Signed-off-by: Andrew Banman <abanman@pnri.org>
2022-05-12 09:53:47 -07:00
Andrew Banman
a01f72a8b0 Fix Hyper-V VM memory metric types
Signed-off-by: Andrew Banman <abanman@pnri.org>
2022-05-12 09:49:31 -07:00
Andrew Banman
09ec6e68ad Add Hyper-V VM Memory metrics
Signed-off-by: Andrew Banman <abanman@pnri.org>
2022-05-12 09:49:31 -07:00
Rahman Mousavian
5dc10096f9 Dropping 0.0 value from float declaration
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 17:51:43 +10:00
Rahman Mousavian
1aa00ebca8 Handling errors to prevent panics
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 17:51:43 +10:00
Rahman Mousavian
fb11263c3e Initilizing once, upon app start
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 16:36:47 +10:00
Rahman Mousavian
9df59c75cd Using CoInitializeEx, Locking OLE calls to the OS thread
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 16:36:46 +10:00
Rahman Mousavian
e112446ce9 changing anonymous funcs to normal funcs
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 16:36:46 +10:00
Rahman Mousavian
4f82e02d8d Updated README.md
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 16:36:46 +10:00
Rahman Mousavian
c3ed036402 Added tests
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 16:36:46 +10:00
Rahman Mousavian
393546fe01 Added doc for Scheduled Task collector
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 16:36:46 +10:00
Rahman Mousavian
ca645edde1 Added Scheduled Task Collector
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
2022-05-12 16:36:42 +10:00
Ben Reedy
69d4043ce4 Merge pull request #977 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.34.0
Bump github.com/prometheus/common from 0.33.0 to 0.34.0
2022-05-04 08:58:25 +10:00
dependabot[bot]
fd5135f5ff Bump github.com/prometheus/common from 0.33.0 to 0.34.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.33.0 to 0.34.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.33.0...v0.34.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-03 22:42:53 +00:00
Ben Reedy
8f08f55cf2 Merge pull request #970 from breed808/ci
Resolve recent CI issues
2022-05-04 05:46:27 +10:00
Calle Pettersson
92d53d07b2 Merge pull request #913 from mjtrangoni/fix-memory-non-counter
Fix memory collector promtool metric issues
2022-05-01 19:15:15 +02:00
Ben Reedy
02e2e257c9 Use go install for build deps
Previous `go get` method of installation was causing issues with
`goversiontool`, preventing successful CI builds.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-04-07 09:13:16 +10:00
Ben Reedy
791df8009c Update golangci-lint CI action to latest version
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-04-07 09:13:10 +10:00
Ben Reedy
aaf202236d Merge pull request #965 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.33.0
Bump github.com/prometheus/common from 0.32.1 to 0.33.0
2022-04-06 20:24:58 +10:00
dependabot[bot]
e9ba751c82 Bump github.com/prometheus/common from 0.32.1 to 0.33.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.32.1 to 0.33.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.32.1...v0.33.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 11:15:41 +00:00
Calle Pettersson
ed83cb1c3e Merge pull request #963 from jsturtevant/fix-k8s-doc-formatting
Fix formatting for kubernetes documentation
2022-04-03 08:53:45 +02:00
James Sturtevant
ac447e5b15 Fix formatting
Signed-off-by: GitHub <noreply@github.com>
2022-04-01 23:34:10 +00:00
Ben Reedy
4d2a247e50 Merge pull request #948 from breed808/ci_tag_name
Fix image build issues
2022-02-27 18:51:06 +10:00
Ben Reedy
54f86001ad Merge pull request #949 from szediktam/fix/container-docs-typo
fix: typo of container docs
2022-02-27 18:50:07 +10:00
szediktam
bccb3b3296 fix: typo of container docs
Signed-off-by: szediktam <alianlianlianlian@gmail.com>
2022-02-27 16:32:45 +08:00
Ben Reedy
c6285cdf9d Fix VERSION env variable for image push
Powershell uses $Env: prefix for environment variables.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-02-27 17:28:51 +10:00
Ben Reedy
cde750f76d Replace invalid tag characters for master images
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-02-27 17:28:46 +10:00
Ben Reedy
dedd60f02b Merge pull request #943 from szediktam/feat/add_storage_metrics_for_container
feat: add storage metrics for container collector
2022-02-27 13:42:32 +10:00
szediktam
d0c9fc6dbb feat: add useful queries example for container docs
Signed-off-by: szediktam <alianlianlianlian@gmail.com>
2022-02-27 13:32:34 +10:00
szediktam
f728224ef2 feat: add storage metrics for container collector
Signed-off-by: szediktam <alianlianlianlian@gmail.com>
2022-02-27 13:32:23 +10:00
Ben Reedy
fba7682f01 Merge pull request #945 from breed808/ci_master_pushes
Run CI on pushes to master branch
2022-02-27 13:31:29 +10:00
Ben Reedy
79ecaf6a99 Check for listening exporter before querying
CI runs have exposed timing issues where promtool/e2e scripts query the
exporter, before exporter has begun listening.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-02-27 08:37:42 +10:00
Ben Reedy
6941ee7ab2 Run promtool windows_exporter on non-default port
Prevents conflicts when promtool & test jobs are run concurrently in
CI.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-02-26 20:43:25 +10:00
Ben Reedy
5a9711dc90 Run CI on pushes to master branch
Required to keep container image (with "latest" tag) up to date. Will
also ensure the master branch is healthy after PR merges.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-02-26 09:25:27 +10:00
Ben Reedy
5106b829c3 Merge pull request #907 from breed808/ci_promtool
Check default collector metrics with promtool
2022-02-08 18:47:09 +10:00
Ben Reedy
e1796c3d42 Upgrade promu build tool to v0.13.0
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-02-08 17:15:03 +10:00
Ben Reedy
14d3e4ea28 Check default collector metrics with promtool
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-02-08 17:14:39 +10:00
Ben Reedy
36f033ae57 Merge pull request #925 from breed808/cpu_docs
Ensure CPU time description matches `mode` flag
2022-02-08 08:09:18 +10:00
Ben Reedy
0de2fc4af7 Merge pull request #864 from jsturtevant/use-hostprocess
Add HostProcess Container Configuration for k8s
2022-02-08 08:07:24 +10:00
James Sturtevant
b450a50103 Add HostProcess Container Configuration for k8s
Co-authored-by: Brian Redmond <brianisrunning@gmail.com>
Signed-off-by: Brian Redmond <brianisrunning@gmail.com>
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2022-02-07 10:16:34 -08:00
Ben Reedy
e07b2053af Merge pull request #937 from breed808/iis_flags
Add missing whitelist/blacklist checks for IIS
2022-02-02 18:18:13 +10:00
Ben Reedy
7d3c0d3b76 Add missing whitelist/blacklist checks for IIS
Checks were removed in 82f17fd despite flags still being present.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-02-02 08:56:50 +10:00
Ben Reedy
27b2ca0b76 Merge pull request #921 from aymericDD/fix/903
fix: iis metrics greater than IIS v7
2022-01-31 18:53:59 +10:00
Aymeric Daurelle
803a0a9a70 fix: iis metrics greater than IIS v7
The IIS >= 8 metrics was updated two times by application and caused a fatal error. The purpose
of this fix is to update metrics one time by application.

Signed-off-by: Aymeric Daurelle <aymeric.daurelle@cdiscount.com>
2022-01-31 09:24:52 +01:00
Ben Reedy
4891acba2d Merge pull request #934 from prometheus-community/dependabot/go_modules/github.com/prometheus/client_golang-1.12.1
Bump github.com/prometheus/client_golang from 1.11.0 to 1.12.1
2022-01-30 15:46:21 +10:00
Ben Reedy
fa51270218 Add new client_golang metrics to e2e output
Introduced in github.com/prometheus/client_golang v1.12.0

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-01-30 15:31:53 +10:00
dependabot[bot]
a68e6af15a Bump github.com/prometheus/client_golang from 1.11.0 to 1.12.1
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.11.0 to 1.12.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.11.0...v1.12.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-30 04:49:07 +00:00
Ben Reedy
7ad9b6d74a Merge pull request #927 from prometheus-community/dependabot/go_modules/github.com/Microsoft/hcsshim-0.9.2
Bump github.com/Microsoft/hcsshim from 0.9.1 to 0.9.2
2022-01-30 14:48:21 +10:00
dependabot[bot]
9acd5e695e Bump github.com/Microsoft/hcsshim from 0.9.1 to 0.9.2
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.1 to 0.9.2.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.1...v0.9.2)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-30 04:38:23 +00:00
Ben Reedy
d4be3b9f31 Ensure CPU time description matches mode flag
Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-01-30 13:26:40 +10:00
Ben Reedy
277f141587 Merge pull request #924 from breed808/e2e_fix
Don't upgrade dependencies when installing tools
2022-01-30 12:12:45 +10:00
Ben Reedy
2a5c51a236 Don't upgrade dependencies when installing tools
Dependency upgrade has resulted in github.com/prometheus/client_golang
being upgraded from v1.11.0 to v1.12.0 prior to end-to-end test.
This new release introduces new `go_*` metrics, causing the test to
fail on the unexpected output.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-01-23 09:19:06 +10:00
Ben Reedy
ce205d4c4d Merge pull request #909 from akrauza/more-adfs-metrics-again
Add more ADFS metrics from `AD FS` CounterSet
2022-01-11 09:10:28 +10:00
Austin D. Krauza
2ed0ae837c Add more ADFS metrics from AD FS CounterSet
Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>

Reformat adfsCollector struct

Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>

Add metrics to ADFS collector documentation

Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>

Update ADFS collector with useful queries and links to documentation

Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>

Remove bad table formatter

Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>

Reformat ADFS collector using gofmt

Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>

Fix ADFS Config and Artifact DB Query time metrics

Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>

Update ADFS collector for Config and Artifact DB Query time from gauge to counter

Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>

Update ADFS collector for Config and Artifact DB Query time from gauge to counter

Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>
2022-01-10 17:27:34 -05:00
Mario Trangoni
57c7911c91 Fix memory collector promtool metric issues
See,
```
windows_memory_demand_zero_faults_total non-counter metrics should not have "_total" suffix
windows_memory_cache_faults_total non-counter metrics should not have "_total" suffix
windows_memory_page_faults_total non-counter metrics should not have "_total" suffix
windows_memory_pool_nonpaged_allocs_total non-counter metrics should not have "_total" suffix
windows_memory_pool_nonpaged_bytes_total non-counter metrics should not have "_total" suffix
windows_memory_pool_paged_allocs_total non-counter metrics should not have "_total" suffix
windows_memory_swap_page_operations_total non-counter metrics should not have "_total" suffix
windows_memory_swap_page_reads_total non-counter metrics should not have "_total" suffix
windows_memory_swap_page_writes_total non-counter metrics should not have "_total" suffix
windows_memory_swap_pages_read_total non-counter metrics should not have "_total" suffix
windows_memory_swap_pages_written_total non-counter metrics should not have "_total" suffix
windows_memory_transition_faults_total non-counter metrics should not have "_total" suffix
windows_memory_transition_pages_repurposed_total non-counter metrics should not have "_total" suffix
windows_memory_write_copies_total non-counter metrics should not have "_total" suffix
```

Only `windows_memory_pool_nonpaged_bytes` is a gauge, all the other
metrics were counters.

Also added some missing documentation.

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2022-01-07 16:59:29 +01:00
Ben Reedy
a56ec9166b Merge pull request #912 from breed808/installer_port
Port should default to 9182 if not defined
2022-01-06 18:18:19 +10:00
Calle Pettersson
e03432a22d Merge pull request #901 from mjtrangoni/fix-some-promtool-warnings
Fix some promtool warnings
2022-01-06 09:12:55 +01:00
Ben Reedy
be004b8423 Port should default to 9182 if not defined
Resolves #911 which was introduced by 45e9357a.

This is due to the exporter only using the default port if no LISTEN_ADDR
**and** no LISTEN_PORT is defined.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2022-01-06 07:57:31 +10:00
Ben Reedy
e08a0411d6 Merge pull request #908 from akrauza/ADCS
Update repository readme with ADCS documentation link
2022-01-05 07:33:25 +10:00
Austin D. Krauza
3d7894049f Update repository readme with ADCS documentation link
Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>
2022-01-04 10:51:49 -05:00
Ben Reedy
de664d4b93 Merge pull request #905 from mjtrangoni/fix-counter-promtool-warnings
Fix counter metrics should have "_total" suffix issue
2022-01-03 08:06:01 +10:00
Ben Reedy
78e026b6ee Merge pull request #906 from mjtrangoni/fix-badge-gh-actions
README.md: Replace the AppVeyor badge with the GH Actions one
2022-01-03 08:04:26 +10:00
Ben Reedy
9eba8dd024 Merge pull request #896 from mjtrangoni/add-codespell
codespell: add GH Action for checking spelling issues
2022-01-03 08:03:05 +10:00
Mario Trangoni
01100d3e6e README.md: Replace the AppVeyor badge with the GH Actions one
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2022-01-02 18:59:32 +01:00
Mario Trangoni
0f1eb4a936 Fix counter metrics should have "_total" suffix issue
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2022-01-02 18:47:17 +01:00
Mario Trangoni
a8eefae123 codespell: add GH Action for checking spelling issues
After fixing all spelling issues in #892, this will prevent us for
adding new ones.

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2022-01-02 18:21:43 +01:00
Ben Reedy
746158d354 Merge pull request #895 from akrauza/ADCS
Add Collector for Active Directory Certificate Services (ADCS)
2022-01-02 19:43:47 +10:00
Austin D. Krauza
a89b53779d Initial commit for ADCS collector
Signed-off-by: Austin D. Krauza <krauza.austin@gmail.com>
2022-01-02 01:24:11 -05:00
Mario Trangoni
9d1628a329 promtool: Fix windows_time_ntp_client_time_source_count
Related to #659, this is a breaking change!

Fixes
```
windows_time_ntp_client_time_source_count non-histogram and non-summary metrics should not have "_count" suffix
```
for the time collector.

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2021-12-31 13:51:07 +01:00
Mario Trangoni
fc33fa320b promtool: Fix *_handle_count and *_thread_count
Related to #659, this is a breaking change!

Fixes

```
windows_process_handle_count non-histogram and non-summary metrics should not have "_count" suffix
windows_process_thread_count non-histogram and non-summary metrics should not have "_count" suffix
```

for process and terminal_services collectors.

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2021-12-31 13:51:07 +01:00
498 changed files with 60810 additions and 24682 deletions

19
.editorconfig Normal file
View File

@@ -0,0 +1,19 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
tab_width = 4
[*.{json,wxs,xml}]
indent_style = space
indent_size = 4
[renovate.json]
indent_size = 2
[*.{yml,yaml}]
indent_style = space
indent_size = 2

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
*.go text eol=lf
*.sh text eol=lf
Makefile text eol=lf

96
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@@ -0,0 +1,96 @@
name: 🐞 Bug
description: Something is not working as indended.
labels: [ 🐞 bug ]
body:
- type: markdown
attributes:
value: |-
> [!NOTE]
> Windows Server 2012 and Windows Server 2012 R2 are no longer supported by the windows_exporter project.
Thanks for taking the time to fill out this bug report!
- type: markdown
attributes:
value: |-
> [!NOTE]
> If you encounter "Counter not found" issues, try to re-build the performance counter first.
```
PS C:\WINDOWS\system32> cd c:\windows\system32
PS C:\windows\system32> lodctr /R
Error: Unable to rebuild performance counter setting from system backup store, error code is 2
PS C:\windows\system32> cd ..
PS C:\windows> cd syswow64
PS C:\windows\syswow64> lodctr /R
Info: Successfully rebuilt performance counter setting from system backup store
PS C:\windows\syswow64> winmgmt.exe /RESYNCPERF
```
----
- type: textarea
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
placeholder: |
When I do <X>, <Y> happens and I see the error message attached below:
```...```
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
placeholder: When I do <X>, <Z> should happen instead.
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
render: Markdown
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **windows_exporter Version**: 0.26
- **Windows Server Version**: 2019
value: |
- windows_exporter Version:
- Windows Server Version:
validations:
required: true
- type: textarea
attributes:
label: windows_exporter logs
description: |
Log of windows_exporter.
⚠️ Without proving logs, we unable to assist here. ⚠️
render: shell
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

41
.github/ISSUE_TEMPLATE/enhancement.yaml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: ✨ Enhancement / Feature / Task
description: Some feature is missing or incomplete.
labels: [ ✨ enhancement ]
body:
- type: textarea
attributes:
label: Problem Statement
description: Without specifying a solution, describe what the project is missing today.
placeholder: |
The rotating project logo has a fixed size and color.
There is no way to make it larger and more shiny.
validations:
required: false
- type: textarea
attributes:
label: Proposed Solution
description: Describe the proposed solution to the problem above.
placeholder: |
- Implement 2 new flags CLI: ```--logo-color=FFD700``` and ```--logo-size=100```
- Let these flags control the size of the rotating project logo.
validations:
required: false
- type: textarea
attributes:
label: Additional information
placeholder: |
We considered adjusting the logo size to the phase of the moon, but there was no
reliable data source in air-gapped environments.
validations:
required: false
- type: textarea
attributes:
label: Acceptance Criteria
placeholder: |
- [ ] As a user, I can control the size of the rotating logo using a CLI flag.
- [ ] As a user, I can control the color of the rotating logo using a CLI flag.
- [ ] Defaults are reasonably set.
- [ ] New settings are appropriately documented.
- [ ] No breaking change for current users of the rotating logo feature.
validations:
required: false

49
.github/ISSUE_TEMPLATE/question.yaml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: ❓ Question
description: Something is not clear.
labels: [ ❓ question ]
body:
- type: markdown
attributes:
value: |-
> [!NOTE]
> If you encounter "Counter not found" issues, try to re-build the performance counter first.
```
PS C:\WINDOWS\system32> cd c:\windows\system32
PS C:\windows\system32> lodctr /R
Error: Unable to rebuild performance counter setting from system backup store, error code is 2
PS C:\windows\system32> cd ..
PS C:\windows> cd syswow64
PS C:\windows\syswow64> lodctr /R
Info: Successfully rebuilt performance counter setting from system backup store
PS C:\windows\syswow64> winmgmt.exe /RESYNCPERF
```
----
- type: textarea
attributes:
label: Problem Statement
description: Without specifying a solution, describe what the project is missing today.
placeholder: |
The rotating project logo has a fixed size and color.
There is no way to make it larger and more shiny.
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **windows_exporter Version**: 0.26
- **Windows Server Version**: 2019
value: |
- windows_exporter Version:
- Windows Server Version:
validations:
required: true

40
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,40 @@
<!--
Please give your PR a title in the form "area: short description". For example "cpu: reduce usage by 95%" or "docs: fix typo in installation.md".
If your PR is to fix an issue, put "Fixes #issue-number" in the description.
Don't forget!
- Please sign CNCF's Developer Certificate of Origin and sign-off your commits by adding the -s / --signoff flag to `git commit`. See https://github.com/apps/dco for more information.
- If the PR adds or changes a behaviour or fixes a bug of an exported API it would need a unit/e2e test.
- Performance improvements would need a benchmark test to prove it.
- All comments should start with a capital letter and end with a full stop.
-->
#### What this PR does / why we need it
#### Which issue this PR fixes
*(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
- fixes #
#### Special notes for your reviewer
#### Particularly user-facing changes
#### Checklist
Complete these before marking the PR as `ready to review`:
<!-- [Place an '[x]' (no spaces) in all applicable fields.] -->
- [ ] [DCO](https://github.com/prometheus-community/helm-charts/blob/main/CONTRIBUTING.md#sign-off-your-work) signed
- [ ] The PR title has a summary of the changes and the area they affect
- [ ] The PR body has a summary to reflect any significant (and particularly user-facing) changes introduced by this PR

View File

@@ -1,6 +0,0 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"

23
.github/release.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
changelog:
exclude:
labels:
- chore
categories:
- title: 💥 Breaking Changes
labels:
- 💥 breaking-change
- title: ✨ Exciting New Features
labels:
- ✨ enhancement
- title: 🐞 Bug Fixes
labels:
- 🐞 bug
- title: 🛠️ Dependencies
labels:
- 🛠️ dependencies
- title: 📖 Documentation
labels:
- 📖 docs
- title: Other Changes
labels:
- "*"

View File

@@ -1,129 +0,0 @@
name: windows_exporter CI/CD
# Trigger on pull requests and releases
# Deployments will only occur for releases (see `if` clauses in the build job).
on:
pull_request:
branches:
- master
release:
types:
- published
- edited
jobs:
test:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.17.5'
- name: Test
run: make test
- name: Install e2e deps
run: |
go get -u github.com/prometheus/promu@v0.11.1
go get -u github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.2.0
# GOPATH\bin dir must be appended to PATH else the `promu` command won't be found
echo "$(go env GOPATH)\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: e2e Test
run: make e2e-test
lint:
runs-on: windows-2019
steps:
# `gofmt` linter run by golangci-lint fails on CRLF line endings (the default for Windows)
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.17.5'
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.43
args: "--timeout=5m"
# golangci-lint action doesn't always provide helpful output, so re-run without the action for
# better output of the problem.
# The cache from the golangci-lint step is re-used here, so this step should finish quickly.
- name: errors
if: ${{ failure() }}
run: golangci-lint run --timeout=5m -c .golangci.yaml
build:
runs-on: windows-2019
needs:
- test
- lint
steps:
- uses: actions/checkout@v2
with:
# fetch-depth required for gitversion in `Build` step
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: '^1.17.5'
- name: Install Build deps
run: |
go get -u github.com/prometheus/promu@v0.11.1
go get -u github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.2.0
# GOPATH\bin dir must be added to PATH else the `promu` and `goversioninfo` commands won't be found
echo "$(go env GOPATH)\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build
run: |
$ErrorActionPreference = "Stop"
gitversion /output json /showvariable FullSemVer | Set-Content VERSION -PassThru
$Version = Get-Content VERSION
# Windows versioninfo resources need the file version by parts (but product version is free text)
$VersionParts = ($Version -replace '^v?([0-9\.]+).*$','$1').Split(".")
goversioninfo.exe -ver-major $VersionParts[0] -ver-minor $VersionParts[1] -ver-patch $VersionParts[2] -product-version $Version -platform-specific
make crossbuild
# GH requires all files to have different names, so add version/arch to differentiate
foreach($Arch in "amd64","386") {
Move-Item output\$Arch\windows_exporter.exe output\windows_exporter-$Version-$Arch.exe
}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: windows_exporter_binaries
path: output\windows_exporter-*.exe
- name: Build Release Artifacts
if: startsWith(github.ref, 'refs/tags/')
run: |
$ErrorActionPreference = "Stop"
$BuildVersion = Get-Content VERSION
$TagName = $env:GITHUB_REF -replace 'refs/tags/', ''
# The MSI version is not semver compliant, so just take the numerical parts
$MSIVersion = $TagName -replace '^v?([0-9\.]+).*$','$1'
foreach($Arch in "amd64","386") {
Write-Verbose "Building windows_exporter $MSIVersion msi for $Arch"
.\installer\build.ps1 -PathToExecutable .\output\windows_exporter-$BuildVersion-$Arch.exe -Version $MSIVersion -Arch "$Arch"
Move-Item installer\Output\windows_exporter-$MSIVersion-$Arch.msi output\
}
promu checksum output\
- name: Release
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$TagName = $env:GITHUB_REF -replace 'refs/tags/', ''
Get-ChildItem -Path output\* -Include @('windows_exporter*.msi', 'windows_exporter*.exe', 'sha256sums.txt') | Foreach-Object {gh release upload $TagName $_}

View File

@@ -0,0 +1,61 @@
---
name: Push README to Docker Hub
on:
push:
paths:
- "README.md"
- "README-containers.md"
- ".github/workflows/container_description.yml"
branches: [ main, master ]
permissions:
contents: read
jobs:
PushDockerHubReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set docker hub repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to Dockerhub
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: dockerhub
short_description: ${{ env.DOCKER_REPO_NAME }}
# Empty string results in README-containers.md being pushed if it
# exists. Otherwise, README.md is pushed.
readme_file: ''
PushQuayIoReadme:
runs-on: ubuntu-latest
name: Push README to quay.io
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set quay.io org name
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
- name: Set quay.io repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to quay.io
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: quay
# Empty string results in README-containers.md being pushed if it
# exists. Otherwise, README.md is pushed.
readme_file: ''

95
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,95 @@
name: Linting
# Trigger on pull requests and pushes to master branch where Go-related files
# have been changed.
on:
push:
branches:
- master
- next
- main
- "0.*"
- "1.*"
pull_request:
env:
VERSION_PROMU: '0.14.0'
PROMTOOL_VER: '2.43.0'
jobs:
test:
runs-on: windows-2025
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: 'go.mod'
- name: Test
run: make test
- name: Install e2e deps
run: |
Invoke-WebRequest -Uri https://github.com/prometheus/promu/releases/download/v$($Env:VERSION_PROMU)/promu-$($Env:VERSION_PROMU).windows-amd64.zip -OutFile promu-$($Env:VERSION_PROMU).windows-amd64.zip
Expand-Archive -Path promu-$($Env:VERSION_PROMU).windows-amd64.zip -DestinationPath .
Copy-Item -Path promu-$($Env:VERSION_PROMU).windows-amd64\promu.exe -Destination "$(go env GOPATH)\bin"
# GOPATH\bin dir must be appended to PATH else the `promu` command won't be found
echo "$(go env GOPATH)\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: e2e Test
run: make e2e-test
promtool:
runs-on: windows-2025
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: 'go.mod'
- name: Install promtool
run: |
Invoke-WebRequest -Uri https://github.com/prometheus/prometheus/releases/download/v$($Env:PROMTOOL_VER)/prometheus-$($Env:PROMTOOL_VER).windows-amd64.zip -OutFile prometheus-$($Env:PROMTOOL_VER).windows-amd64.zip
Expand-Archive -Path prometheus-$($Env:PROMTOOL_VER).windows-amd64.zip -DestinationPath .
Copy-Item -Path prometheus-$($Env:PROMTOOL_VER).windows-amd64\promtool.exe -Destination "$(go env GOPATH)\bin"
Invoke-WebRequest -Uri https://github.com/prometheus/promu/releases/download/v$($Env:VERSION_PROMU)/promu-$($Env:VERSION_PROMU).windows-amd64.zip -OutFile promu-$($Env:VERSION_PROMU).windows-amd64.zip
Expand-Archive -Path promu-$($Env:VERSION_PROMU).windows-amd64.zip -DestinationPath .
Copy-Item -Path promu-$($Env:VERSION_PROMU).windows-amd64\promu.exe -Destination "$(go env GOPATH)\bin"
# GOPATH\bin dir must be appended to PATH else the `promu` command won't be found
echo "$(go env GOPATH)\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Promtool
run: make promtool
- name: Upload windows_exporter.exe
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: windows_exporter.amd64.exe
path: 'windows_exporter.exe'
retention-days: 7
if-no-files-found: error
lint:
runs-on: windows-2025
steps:
# `gofmt` linter run by golangci-lint fails on CRLF line endings (the default for Windows)
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
# renovate: github=golangci/golangci-lint
version: v2.7.2
args: "--max-same-issues=0"

48
.github/workflows/pr-check.yaml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Validate Pull Request
on:
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled
jobs:
required-labels-missing:
name: required labels missing
runs-on: ubuntu-latest
steps:
- name: check
if: >-
!contains(github.event.pull_request.labels.*.name, '💥 breaking-change')
&& !contains(github.event.pull_request.labels.*.name, '✨ enhancement')
&& !contains(github.event.pull_request.labels.*.name, '🐞 bug')
&& !contains(github.event.pull_request.labels.*.name, '📖 docs')
&& !contains(github.event.pull_request.labels.*.name, 'chore')
&& !contains(github.event.pull_request.labels.*.name, '🛠️ dependencies')
run: >-
echo One of the following labels is missing on this PR:
breaking-change
enhancement
bug
docs
chore
&& exit 1
title:
name: check title prefix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: check
run: |
PR_TITLE_PREFIX=$(echo "$PR_TITLE" | cut -d':' -f1)
if [[ -d "internal/collector/$PR_TITLE_PREFIX" ]] || [[ -d "internal/$PR_TITLE_PREFIX" ]] || [[ -d "pkg/$PR_TITLE_PREFIX" ]] || [[ -d "$PR_TITLE_PREFIX" ]] || [[ "$PR_TITLE_PREFIX" == "docs" ]] || [[ "$PR_TITLE_PREFIX" == "ci" ]] || [[ "$PR_TITLE_PREFIX" == "revert" ]] || [[ "$PR_TITLE_PREFIX" == "fix" ]] || [[ "$PR_TITLE_PREFIX" == "fix(deps)" ]] || [[ "$PR_TITLE_PREFIX" == "feat" ]] || [[ "$PR_TITLE_PREFIX" == "chore" ]] || [[ "$PR_TITLE_PREFIX" == "chore(docs)" ]] || [[ "$PR_TITLE_PREFIX" == "chore(deps)" ]] || [[ "$PR_TITLE_PREFIX" == "*" ]] || [[ "$PR_TITLE_PREFIX" == "Release"* ]] || [[ "$PR_TITLE_PREFIX" == "Synchronize common files from prometheus/prometheus" ]] || [[ "$PR_TITLE_PREFIX" == "[0."* ]] || [[ "$PR_TITLE_PREFIX" == "[1."* ]]; then
exit 0
fi
echo "PR title must start with an name of an collector package"
echo "Example: 'logical_disk: description'"
exit 1
env:
PR_TITLE: ${{ github.event.pull_request.title }}

244
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,244 @@
name: Releases
# Trigger on releases.
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
release:
types:
- published
- edited
permissions:
contents: write
packages: write
env:
VERSION_PROMU: '0.17.0'
jobs:
build:
runs-on: windows-2025
environment: build
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: '0'
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: 'go.mod'
- name: Install WiX
run: |
dotnet tool install --global wix --version 5.0.2
- name: Install WiX extensions
run: |
wix extension add -g WixToolset.Util.wixext/5.0.2
wix extension add -g WixToolset.Ui.wixext/5.0.2
wix extension add -g WixToolset.Firewall.wixext/5.0.2
- name: Install Build deps
run: |
Invoke-WebRequest -Uri https://github.com/prometheus/promu/releases/download/v$($Env:VERSION_PROMU)/promu-$($Env:VERSION_PROMU).windows-amd64.zip -OutFile promu-$($Env:VERSION_PROMU).windows-amd64.zip
Expand-Archive -Path promu-$($Env:VERSION_PROMU).windows-amd64.zip -DestinationPath .
Copy-Item -Path promu-$($Env:VERSION_PROMU).windows-amd64\promu.exe -Destination "$(go env GOPATH)\bin"
# GOPATH\bin dir must be added to PATH else the `promu` commands won't be found
echo "$(go env GOPATH)\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build
run: |
$ErrorActionPreference = "Stop"
$Version = git describe --tags --always
$Version = $Version -replace 'v', ''
# '+' symbols are invalid characters in image tags
$Version = $Version -replace '\+', '_'
$Version | Set-Content VERSION -PassThru
make build-all
# GH requires all files to have different names, so add version/arch to differentiate
foreach($Arch in "amd64", "arm64") {
Move-Item output\$Arch\windows_exporter.exe output\windows_exporter-$Version-$Arch.exe
}
Get-ChildItem -Path output
- name: Sign build artifacts
if: ${{ (github.event_name != 'pull_request' && github.repository == 'prometheus-community/windows_exporter') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'prometheus-community/windows_exporter') }}
run: |
$ErrorActionPreference = "Stop"
$Version = Get-Content VERSION
$b64 = $env:CODE_SIGN_KEY
$filename = 'windows_exporter_CodeSign.pfx'
$bytes = [Convert]::FromBase64String($b64)
[IO.File]::WriteAllBytes($filename, $bytes)
$basePath = "C:\Program Files (x86)\Windows Kits\10\bin"
$latestSigntool = Get-ChildItem -Path $basePath -Directory |
Where-Object { $_.Name -match "^\d+\.\d+\.\d+\.\d+$" } |
Sort-Object { [Version]$_.Name } -Descending |
Select-Object -First 1 |
ForEach-Object { Join-Path $_.FullName "x64\signtool.exe" }
if (Test-Path $latestSigntool) {
Write-Output $latestSigntool
} else {
Write-Output "signtool.exe not found"
}
foreach($Arch in "amd64", "arm64") {
& $latestSigntool sign /v /tr "http://timestamp.digicert.com" /d "Prometheus exporter for Windows machines" /td SHA256 /fd SHA256 /a /f "windows_exporter_CodeSign.pfx" /p $env:CODE_SIGN_PASSWORD "output\windows_exporter-$Version-$Arch.exe"
}
rm windows_exporter_CodeSign.pfx
env:
CODE_SIGN_KEY: ${{ secrets.CODE_SIGN_KEY }}
CODE_SIGN_PASSWORD: ${{ secrets.CODE_SIGN_PASSWORD }}
- name: Build Release Artifacts
run: |
$ErrorActionPreference = "Stop"
$Version = Get-Content VERSION
foreach($Arch in "amd64", "arm64") {
Write-Host "Building windows_exporter $Version msi for $Arch"
.\installer\build.ps1 -PathToExecutable .\output\windows_exporter-$Version-$Arch.exe -Version $Version -Arch "$Arch"
}
Move-Item installer\*.msi output\
Get-ChildItem -Path output\ g
- name: Sign installer artifacts
if: ${{ (github.event_name != 'pull_request' && github.repository == 'prometheus-community/windows_exporter') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'prometheus-community/windows_exporter') }}
run: |
$ErrorActionPreference = "Stop"
$Version = Get-Content VERSION
$b64 = $env:CODE_SIGN_KEY
$filename = 'windows_exporter_CodeSign.pfx'
$bytes = [Convert]::FromBase64String($b64)
[IO.File]::WriteAllBytes($filename, $bytes)
$basePath = "C:\Program Files (x86)\Windows Kits\10\bin"
$latestSigntool = Get-ChildItem -Path $basePath -Directory |
Where-Object { $_.Name -match "^\d+\.\d+\.\d+\.\d+$" } |
Sort-Object { [Version]$_.Name } -Descending |
Select-Object -First 1 |
ForEach-Object { Join-Path $_.FullName "x64\signtool.exe" }
if (Test-Path $latestSigntool) {
Write-Output $latestSigntool
} else {
Write-Output "signtool.exe not found"
}
foreach($Arch in "amd64", "arm64") {
& $latestSigntool sign /v /tr "http://timestamp.digicert.com" /d "Prometheus exporter for Windows machines" /td SHA256 /fd SHA256 /a /f "windows_exporter_CodeSign.pfx" /p $env:CODE_SIGN_PASSWORD "output\windows_exporter-$Version-$Arch.msi"
}
rm windows_exporter_CodeSign.pfx
env:
CODE_SIGN_KEY: ${{ secrets.CODE_SIGN_KEY }}
CODE_SIGN_PASSWORD: ${{ secrets.CODE_SIGN_PASSWORD }}
- name: Generate checksums
run: |
promu checksum output
cat output\sha256sums.txt
- name: Upload Artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: windows_exporter_binaries
path: |
output\windows_exporter-*.exe
output\windows_exporter-*.msi
- name: Release
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$TagName = $env:GITHUB_REF -replace 'refs/tags/', ''
Get-ChildItem -Path output\* -Include @('windows_exporter*.msi', 'windows_exporter*.exe', 'sha256sums.txt') | Foreach-Object {gh release upload $TagName $_}
docker:
name: Build docker images
runs-on: ubuntu-latest
needs:
- build
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: '0'
- name: Download Artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: windows_exporter_binaries
- name: Login to Docker Hub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
username: ${{ secrets.DOCKER_HUB_LOGIN }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Login to quay.io
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_LOGIN }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Login to GitHub container registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: |
ghcr.io/prometheus-community/windows-exporter
docker.io/prometheuscommunity/windows-exporter
quay.io/prometheuscommunity/windows-exporter
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr
labels: |
org.opencontainers.image.title=windows_exporter
org.opencontainers.image.description=A Prometheus exporter for Windows machines.
org.opencontainers.image.vendor=The Prometheus Community
org.opencontainers.image.licenses=MIT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Build and push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: windows/amd64
annotations: ${{ steps.meta.outputs.labels }}

26
.github/workflows/spelling.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Spell checking
# Trigger on pull requests, and pushes to master branch.
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
VERSION_PROMU: 'v0.14.0'
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
# When using this Action in other repos, the --skip option below can be removed
skip: ./.git,go.mod,go.sum
ignore_words_list: calle,Entires

29
.github/workflows/stale-close.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: 'Close stale issues and PRs'
on:
workflow_dispatch: {}
schedule:
- cron: '30 1 * * *'
permissions:
issues: write
pull-requests: write
jobs:
stale:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
runs-on: ubuntu-latest
steps:
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# opt out of defaults to avoid marking issues as stale and closing them
# https://github.com/actions/stale#days-before-close
# https://github.com/actions/stale#days-before-stale
days-before-stale: -1
days-before-close: -1
stale-pr-message: ''
stale-issue-message: 'This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.'
operations-per-run: 30
# override days-before-stale, for only marking the pull requests as stale
days-before-issue-stale: 90
days-before-issue-close: 30
stale-pr-label: stale
exempt-pr-labels: keepalive

31
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Stale Check
on:
workflow_dispatch: {}
schedule:
- cron: '16 22 * * *'
permissions:
issues: write
pull-requests: write
jobs:
stale:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
runs-on: ubuntu-latest
steps:
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# opt out of defaults to avoid marking issues as stale and closing them
# https://github.com/actions/stale#days-before-close
# https://github.com/actions/stale#days-before-stale
days-before-stale: -1
days-before-close: -1
# Setting it to empty string to skip comments.
# https://github.com/actions/stale#stale-pr-message
# https://github.com/actions/stale#stale-issue-message
stale-pr-message: ''
stale-issue-message: ''
operations-per-run: 30
# override days-before-stale, for only marking the pull requests as stale
days-before-pr-stale: 60
stale-pr-label: stale
exempt-pr-labels: keepalive

18
.gitignore vendored
View File

@@ -4,5 +4,21 @@ VERSION
*.un~ *.un~
output/ output/
.vscode .vscode
.idea
*.syso *.syso
installer/*.msi
installer/*.log
installer/*.wixpdb
local/
/.idea/*
!/.idea/inspectionProfiles/
/.idea/inspectionProfiles/*
!/.idea/inspectionProfiles/Project_Default.xml
!/.idea/dictionaries/
/.idea/dictionaries/*
!/.idea/dictionaries/project.xml
/.idea/copyright/*
!/.idea/copyright/profiles_settings.xml
!/.idea/copyright/windows_exporter.xml
!/.idea/vcs.xml
!/.idea/go.imports.xml

View File

@@ -1,25 +1,146 @@
version: "2"
linters: linters:
disable-all: true default: all
enable: disable:
- deadcode - cyclop
- errcheck - depguard
- revive - dogsled
- govet - dupl
- gofmt - err113
- ineffassign - exhaustive
- structcheck - exhaustruct
- unconvert - fatcontext
- varcheck - funcorder
- funlen
- gocognit
- goconst
- gocyclo
- godoclint
- godot
- lll
- maintidx
- mnd
- noinlineerr
- paralleltest
- tagliatelle
- testpackage
- unqueryvet
- varnamelen
- wrapcheck
- wsl
settings:
forbidigo:
forbid:
- pattern: ^(fmt\.Print(|f|ln)|print|println)$
- pattern: ^syscall\.(.{1,7}|.{7}[^N]|.{9,})$
msg: use golang.org/x/sys/windows instead of syscall
- pattern: ^windows\.NewLazyDLL$
msg: use NewLazySystemDLL instead NewLazyDLL
goheader:
values:
const:
COMPANY: The Prometheus Authors
template: |-
SPDX-License-Identifier: Apache-2.0
issues: Copyright {{ COMPANY }}
exclude: Licensed under the Apache License, Version 2.0 (the "License");
- don't use underscores in Go names you may not use this file except in compliance with the License.
- exported type .+ should have comment or be unexported You may obtain a copy of the License at
exclude-rules:
- # Golint has many capitalisation complaints on WMI class names http://www.apache.org/licenses/LICENSE-2.0
text: "`?\\w+`? should be `?\\w+`?"
linters: Unless required by applicable law or agreed to in writing, software
- revive distributed under the License is distributed on an "AS IS" BASIS,
- text: "don't use ALL_CAPS in Go names; use CamelCase" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
linters: See the License for the specific language governing permissions and
- revive limitations under the License.
gomoddirectives:
toolchain-forbidden: true
gosec:
excludes:
- G101
- G115
govet:
enable-all: true
disable:
- fieldalignment
- shadow
revive:
rules:
- name: var-naming
arguments:
- [ ] # AllowList - do not remove as args for the rule are positional and won't work without lists first
- [ ] # DenyList
- - skip-package-name-checks: true
sloglint:
no-mixed-args: true
kv-only: false
attr-only: true
no-global: all
context: scope
static-msg: false
no-raw-keys: false
key-naming-case: snake
forbidden-keys:
- time
- level
- msg
- source
args-on-sep-lines: true
staticcheck:
checks:
- -ST1003
- all
tagliatelle:
case:
rules:
json: camel
yaml: snake
use-field-name: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- revive
text: '`?\w+`? should be `?\w+`?'
- linters:
- revive
text: don't use ALL_CAPS in Go names; use CamelCase
- path: .+\.go$
text: don't use underscores in Go names
- path: .+\.go$
text: don't use an underscore in package name
- path: .+\.go$
text: exported type .+ should have comment or be unexported
- linters:
- staticcheck
text: "ST1003:"
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- prefix(github.com/prometheus-community/windows_exporter/internal/windowsservice)
- standard
- default
custom-order: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

11
.idea/copyright/profiles_settings.xml generated Normal file
View File

@@ -0,0 +1,11 @@
<component name="CopyrightManager">
<settings default="windows_exporter">
<module2copyright>
<element module="All Changed Files" copyright="windows_exporter" />
</module2copyright>
<LanguageOptions name="Go">
<option name="fileTypeOverride" value="3" />
<option name="block" value="false" />
</LanguageOptions>
</settings>
</component>

7
.idea/copyright/windows_exporter.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<component name="CopyrightManager">
<copyright>
<option name="keyword" value="The Prometheus Authors" />
<option name="notice" value="SPDX-License-Identifier: Apache-2.0&#10;&#10;Copyright The Prometheus Authors&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10;http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License." />
<option name="myName" value="windows_exporter" />
</copyright>
</component>

16
.idea/dictionaries/project.xml generated Normal file
View File

@@ -0,0 +1,16 @@
<component name="ProjectDictionaryState">
<dictionary name="project">
<words>
<w>containerd</w>
<w>endpointstats</w>
<w>gochecknoglobals</w>
<w>lpwstr</w>
<w>luid</w>
<w>operationoptions</w>
<w>setupapi</w>
<w>spdx</w>
<w>textfile</w>
<w>vmcompute</w>
</words>
</dictionary>
</component>

11
.idea/go.imports.xml generated Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GoImports">
<option name="excludedPackages">
<array>
<option value="github.com/pkg/errors" />
<option value="golang.org/x/net/context" />
</array>
</option>
</component>
</project>

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="GoLinter" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -1,18 +1,27 @@
go:
# Whenever the Go version is updated here,
# .github/workflows should also be updated.
version: 1.23
cgo: false
repository: repository:
path: github.com/prometheus-community/windows_exporter path: github.com/prometheus-community/windows_exporter
build: build:
binaries: binaries:
- name: windows_exporter - name: windows_exporter
ldflags: | path: ./cmd/windows_exporter
-X github.com/prometheus/common/version.Version={{.Version}} tags:
-X github.com/prometheus/common/version.Revision={{.Revision}} all:
-X github.com/prometheus/common/version.Branch={{.Branch}} - trimpath
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}} ldflags: |
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} -X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
tarball: tarball:
files: files:
- LICENSE - LICENSE
crossbuild: crossbuild:
platforms: platforms:
- windows/amd64 - windows/amd64
- windows/386 - windows/arm64

30
.run/all.run.xml Normal file
View File

@@ -0,0 +1,30 @@
<!--
~ SPDX-License-Identifier: Apache-2.0
~
~ Copyright The Prometheus Authors
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="all" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="run">
<module name="windows_exporter" />
<working_directory value="$PROJECT_DIR$" />
<parameters value="--web.listen-address=127.0.0.1:9182 --log.level=info --collectors.enabled=ad,adcs,adfs,cache,container,cpu,cpu_info,dfsr,dhcp,diskdrive,dns,exchange,file,fsrmquota,hyperv,iis,license,logical_disk,memory,mscluster,msmq,mssql,net,netframework,nps,os,pagefile,performancecounter,physical_disk,printer,process,remote_fx,scheduled_task,service,smb,smbclient,smtp,system,tcp,terminal_services,thermalzone,time,udp,update,vmware,performancecounter --debug.enabled --collector.performancecounter.objects='[{ &quot;name&quot;: &quot;memory&quot;, &quot;type&quot;: &quot;formatted&quot;, &quot;object&quot;: &quot;Memory&quot;, &quot;counters&quot;: [{ &quot;name&quot;:&quot;Cache Faults/sec&quot;, &quot;type&quot;:&quot;counter&quot; }]}]'" />
<sudo value="true" />
<kind value="PACKAGE" />
<package value="github.com/prometheus-community/windows_exporter/cmd/windows_exporter" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$/exporter.go" />
<method v="2" />
</configuration>
</component>

View File

@@ -1,3 +1,3 @@
## Prometheus Community Code of Conduct # Prometheus Community Code of Conduct
Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).

82
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,82 @@
# Contributing
windows_exporter uses GitHub to manage reviews of pull requests.
* If you are a new contributor see: [Steps to Contribute](#steps-to-contribute)
* If you have a trivial fix or improvement, go ahead and create a pull request,
addressing (with `@...`) a suitable maintainer of this repository (see
[MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request.
* If you plan to do something more involved, first discuss your ideas
as [github issue](https://github.com/prometheus-community/windows_exporter/issues).
This will avoid unnecessary work and surely give you and us a good deal
of inspiration. New collectors are unlikely to be accepted, since the
`performancecounter` collector is the preferred way to collect metrics.
* Relevant coding style guidelines are the [Go Code Review
Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments)
and the _Formatting and style_ section of Peter Bourgon's [Go: Best
Practices for Production
Environments](https://peter.bourgon.org/go-in-production/#formatting-and-style).
gofmt and [golangci-lint](https://github.com/golangci/golangci-lint) are your friends.
* Be sure to sign off on the [DCO](https://github.com/probot/dco#how-it-works).
## Steps to Contribute
Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on it. This is to prevent duplicated efforts from contributors on the same issue.
For quickly compiling and testing your changes do:
```bash
# For building.
go build -o windows_exporter.exe ./cmd/windows_exporter/
./windows_exporter.exe
# For testing.
make test # Make sure all the tests pass before you commit and push :)
```
To run a collection of Go linters through [`golangci-lint`](https://github.com/golangci/golangci-lint), do:
```bash
make lint
```
If it reports an issue and you think that the warning needs to be disregarded or is a false-positive, you can add a special comment `//nolint:linter1[,linter2,...]` before the offending line. Use this sparingly though, fixing the code to comply with the linter's recommendation is in general the preferred course of action. See [this section of the golangci-lint documentation](https://golangci-lint.run/usage/false-positives/#nolint-directive) for more information.
All our issues are regularly tagged so that you can also filter down the issues involving the components you want to work on. For our labeling policy refer [the wiki page](https://github.com/prometheus/prometheus/wiki/Label-Names-and-Descriptions).
## Pull Request Checklist
* Branch from the main branch and, if needed, rebase to the current main branch before submitting your pull request. If it doesn't merge cleanly with main you may be asked to rebase your changes.
* Commits should be as small as possible, while ensuring that each commit is correct independently (i.e., each commit should compile and pass tests).
* The PR title should be of the format: `subsystem: what this PR does` (for example, `cpu: Add support for thing` or `docs: fix typo`).
* If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment.
* Add tests relevant to the fixed bug or new feature.
## Dependency management
The Prometheus project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages.
To add or update a new dependency, use the `go get` command:
```bash
# Pick the latest tagged release.
go get example.com/some/module/pkg@latest
# Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z
```
Tidy up the `go.mod` and `go.sum` files:
```bash
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
GO111MODULE=on go mod tidy
```
You have to commit the changes to `go.mod` and `go.sum` before submitting the pull request.

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
# mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0
# Using this image as a base for HostProcess containers has a few advantages over using other base images for Windows containers including:
# - Smaller image size
# - OS compatibility (works on any Windows version that supports containers)
# This image MUST be built with docker buildx build (buildx) command on a Linux system.
# Ref: https://github.com/microsoft/windows-host-process-containers-base-image
ARG BASE="mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0"
FROM $BASE
COPY windows_exporter*-amd64.exe /windows_exporter.exe
ENTRYPOINT ["windows_exporter.exe"]

View File

@@ -1,6 +1,7 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2016 Martin Lindhe Copyright (c) 2016 Martin Lindhe
Copyright (c) 2021 The Prometheus Authors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,9 +1,11 @@
Maintainers in alphabetical order Maintainers in alphabetical order
* [Ben Reedy](https://github.com/breed808) - breed808@breed808.com * [Ben Reedy](https://github.com/breed808) - breed808@breed808.com
* [Calle Pettersson](https://github.com/carlpett) - calle@cape.nu * [Jan-Otto Kröpke](https://github.com/jkroepke) - github@jkroepke.de
Alumni Alumni
* [Brian Brazil](https://github.com/brian-brazil) * [Brian Brazil](https://github.com/brian-brazil)
* [Calle Pettersson](https://github.com/carlpett)
* [Martin Lindhe](https://github.com/martinlindhe) * [Martin Lindhe](https://github.com/martinlindhe)

View File

@@ -1,28 +1,84 @@
export GOOS=windows GOOS ?= windows
VERSION ?= $(shell cat VERSION)
DOCKER ?= docker
# DOCKER_REPO is the official image repository name at docker.io, quay.io.
DOCKER_REPO ?= prometheuscommunity
DOCKER_IMAGE_NAME ?= windows-exporter
# ALL_DOCKER_REPOS is the list of repositories to push the image to. ghcr.io requires that org name be the same as the image repo name.
ALL_DOCKER_REPOS ?= docker.io/$(DOCKER_REPO) ghcr.io/prometheus-community # quay.io/$(DOCKER_REPO)
# Image Variables for host process Container
# Windows image build is heavily influenced by https://github.com/kubernetes/kubernetes/blob/master/cluster/images/etcd/Makefile
OS ?= ltsc2019
ALL_OS ?= ltsc2019 ltsc2022
BASE_IMAGE ?= mcr.microsoft.com/windows/nanoserver
.PHONY: build .PHONY: build
build: windows_exporter.exe build: generate windows_exporter.exe
windows_exporter.exe: **/*.go
windows_exporter.exe: pkg/**/*.go
promu build -v promu build -v
.PHONY: generate
generate:
go generate ./...
test: test:
go test -v ./... go test -v ./...
bench: bench:
go test -v -bench='benchmark(cpu|logicaldisk|logon|memory|net|process|service|system|tcp|time)collector' ./... go test -v -bench='benchmarkcollector' ./internal/collectors/{cpu,logical_disk,physical_disk,memory,net,printer,process,service,system,tcp,time}
lint: lint:
golangci-lint -c .golangci.yaml run golangci-lint -c .golangci.yaml run
.PHONY: e2e-test .PHONY: e2e-test
e2e-test: windows_exporter.exe e2e-test: windows_exporter.exe
pwsh -NonInteractive -ExecutionPolicy Bypass -File .\tools\end-to-end-test.ps1 powershell -NonInteractive -ExecutionPolicy Bypass -File .\tools\end-to-end-test.ps1
.PHONY: promtool
promtool: windows_exporter.exe
pwsh -NonInteractive -ExecutionPolicy Bypass -File .\tools\promtool.ps1
fmt: fmt:
gofmt -l -w -s . gofmt -l -w -s .
crossbuild: crossbuild: generate
# The prometheus/golang-builder image for promu crossbuild doesn't exist # The prometheus/golang-builder image for promu crossbuild doesn't exist
# on Windows, so for now, we'll just build twice # on Windows, so for now, we'll just build twice
GOARCH=amd64 promu build --prefix=output/amd64 GOARCH=amd64 promu build --prefix=output/amd64
GOARCH=386 promu build --prefix=output/386 GOARCH=arm64 promu build --prefix=output/arm64
.PHONY: package
package: crossbuild
powershell -NonInteractive -ExecutionPolicy Bypass -File .\installer\build.ps1 -PathToExecutable .\output\amd64\windows_exporter.exe -Version $(shell git describe --tags --abbrev=0)
build-image: crossbuild
$(DOCKER) build --build-arg=BASE=$(BASE_IMAGE):$(OS) -f Dockerfile -t local/$(DOCKER_IMAGE_NAME):$(VERSION)-$(OS) .
build-hostprocess:
$(DOCKER) buildx build --build-arg=BASE=mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 -f Dockerfile -t local/$(DOCKER_IMAGE_NAME):$(VERSION)-hostprocess .
sub-build-%:
$(MAKE) OS=$* build-image
build-all: crossbuild
@for docker_repo in ${DOCKER_REPO}; do \
echo $(DOCKER) buildx build -f Dockerfile -t $${docker_repo}/$(DOCKER_IMAGE_NAME):$(VERSION) .; \
done
push:
@for docker_repo in ${DOCKER_REPO}; do \
echo $(DOCKER) buildx build --push -f Dockerfile -t $${docker_repo}/$(DOCKER_IMAGE_NAME):$(VERSION) .; \
done
.PHONY: push-all
push-all: build-all
$(MAKE) DOCKER_REPO="$(ALL_DOCKER_REPOS)" push
# Mandatory target for container description sync action
.PHONY: docker-repo-name
docker-repo-name:
@echo "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)"

245
README.md
View File

@@ -1,54 +1,64 @@
# windows_exporter # windows_exporter
[![Build status](https://ci.appveyor.com/api/projects/status/xoym3fftr7giasiw/branch/master?svg=true)](https://ci.appveyor.com/project/prometheus-community/windows-exporter) [![CI](https://github.com/prometheus-community/windows_exporter/actions/workflows/release.yml/badge.svg)](https://github.com/prometheus-community/windows_exporter)
[![Linting](https://github.com/prometheus-community/windows_exporter/actions/workflows/lint.yml/badge.svg)](https://github.com/prometheus-community/windows_exporter)
[![GitHub license](https://img.shields.io/github/license/prometheus-community/windows_exporter)](https://github.com/prometheus-community/windows_exporter/blob/master/LICENSE.txt)
[![Current Release](https://img.shields.io/github/release/prometheus-community/windows_exporter.svg?logo=github)](https://github.com/prometheus-community/windows_exporter/releases/latest)
[![GitHub Repo stars](https://img.shields.io/github/stars/prometheus-community/windows_exporter?style=flat&logo=github)](https://github.com/prometheus-community/windows_exporter/stargazers)
[![GitHub all releases](https://img.shields.io/github/downloads/prometheus-community/windows_exporter/total?logo=github)](https://github.com/prometheus-community/windows_exporter/releases/latest)
[![Go Report Card](https://goreportcard.com/badge/github.com/prometheus-community/windows_exporter)](https://goreportcard.com/report/github.com/prometheus-community/windows_exporter)
A Prometheus exporter for Windows machines. A Prometheus exporter for Windows machines.
## Collectors ## Collectors
Name | Description | Enabled by default | Name | Description | Enabled by default |
---------|-------------|-------------------- |------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
[ad](docs/collector.ad.md) | Active Directory Domain Services | | [ad](docs/collector.ad.md) | Active Directory Domain Services | |
[adfs](docs/collector.adfs.md) | Active Directory Federation Services | | [adcs](docs/collector.adcs.md) | Active Directory Certificate Services | |
[cache](docs/collector.cache.md) | Cache metrics | | [adfs](docs/collector.adfs.md) | Active Directory Federation Services | |
[cpu](docs/collector.cpu.md) | CPU usage | &#10003; | [cache](docs/collector.cache.md) | Cache metrics | |
[cpu_info](docs/collector.cpu_info.md) | CPU Information | | [cpu](docs/collector.cpu.md) | CPU usage | &#10003; |
[cs](docs/collector.cs.md) | "Computer System" metrics (system properties, num cpus/total memory) | &#10003; | [cpu_info](docs/collector.cpu_info.md) | CPU Information | |
[container](docs/collector.container.md) | Container metrics | | [container](docs/collector.container.md) | Container metrics | |
[dfsr](docs/collector.dfsr.md) | DFSR metrics | | [diskdrive](docs/collector.diskdrive.md) | Diskdrive metrics | |
[dhcp](docs/collector.dhcp.md) | DHCP Server | | [dfsr](docs/collector.dfsr.md) | DFSR metrics | |
[dns](docs/collector.dns.md) | DNS Server | | [dhcp](docs/collector.dhcp.md) | DHCP Server | |
[exchange](docs/collector.exchange.md) | Exchange metrics | | [dns](docs/collector.dns.md) | DNS Server | |
[fsrmquota](docs/collector.fsrmquota.md) | Microsoft File Server Resource Manager (FSRM) Quotas collector | | [exchange](docs/collector.exchange.md) | Exchange metrics | |
[hyperv](docs/collector.hyperv.md) | Hyper-V hosts | | [file](docs/collector.file.md) | File metrics | |
[iis](docs/collector.iis.md) | IIS sites and applications | | [fsrmquota](docs/collector.fsrmquota.md) | Microsoft File Server Resource Manager (FSRM) Quotas collector | |
[logical_disk](docs/collector.logical_disk.md) | Logical disks, disk I/O | &#10003; | [gpu](docs/collector.gpu.md) | GPU metrics | |
[logon](docs/collector.logon.md) | User logon sessions | | [hyperv](docs/collector.hyperv.md) | Hyper-V hosts | |
[memory](docs/collector.memory.md) | Memory usage metrics | | [iis](docs/collector.iis.md) | IIS sites and applications | |
[msmq](docs/collector.msmq.md) | MSMQ queues | | [license](docs/collector.license.md) | Windows license status | |
[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 | | [logical_disk](docs/collector.logical_disk.md) | Logical disks, disk I/O | &#10003; |
[netframework_clrexceptions](docs/collector.netframework_clrexceptions.md) | .NET Framework CLR Exceptions | | [memory](docs/collector.memory.md) | Memory usage metrics | &#10003; |
[netframework_clrinterop](docs/collector.netframework_clrinterop.md) | .NET Framework Interop Metrics | | [mscluster](docs/collector.mscluster.md) | MSCluster metrics | |
[netframework_clrjit](docs/collector.netframework_clrjit.md) | .NET Framework JIT metrics | | [msmq](docs/collector.msmq.md) | MSMQ queues | |
[netframework_clrloading](docs/collector.netframework_clrloading.md) | .NET Framework CLR Loading 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_clrlocksandthreads](docs/collector.netframework_clrlocksandthreads.md) | .NET Framework locks and metrics threads | | [netframework](docs/collector.netframework.md) | .NET Framework metrics | |
[netframework_clrmemory](docs/collector.netframework_clrmemory.md) | .NET Framework Memory metrics | | [net](docs/collector.net.md) | Network interface I/O | &#10003; |
[netframework_clrremoting](docs/collector.netframework_clrremoting.md) | .NET Framework Remoting metrics | | [os](docs/collector.os.md) | OS metrics (memory, processes, users) | &#10003; |
[netframework_clrsecurity](docs/collector.netframework_clrsecurity.md) | .NET Framework Security Check metrics | | [pagefile](docs/collector.pagefile.md) | pagefile metrics | |
[net](docs/collector.net.md) | Network interface I/O | &#10003; | [performancecounter](docs/collector.performancecounter.md) | Custom performance counter metrics | |
[os](docs/collector.os.md) | OS metrics (memory, processes, users) | &#10003; | [physical_disk](docs/collector.physical_disk.md) | physical disk metrics | &#10003; |
[process](docs/collector.process.md) | Per-process metrics | | [printer](docs/collector.printer.md) | Printer metrics | |
[remote_fx](docs/collector.remote_fx.md) | RemoteFX protocol (RDP) metrics | | [process](docs/collector.process.md) | Per-process metrics | |
[service](docs/collector.service.md) | Service state metrics | &#10003; | [remote_fx](docs/collector.remote_fx.md) | RemoteFX protocol (RDP) metrics | |
[smtp](docs/collector.smtp.md) | IIS SMTP Server | | [scheduled_task](docs/collector.scheduled_task.md) | Scheduled Tasks metrics | |
[system](docs/collector.system.md) | System calls | &#10003; | [service](docs/collector.service.md) | Service state metrics | &#10003; |
[tcp](docs/collector.tcp.md) | TCP connections | | [smb](docs/collector.smb.md) | SMB Server | |
[time](docs/collector.time.md) | Windows Time Service | | [smbclient](docs/collector.smbclient.md) | SMB Client | |
[thermalzone](docs/collector.thermalzone.md) | Thermal information | [smtp](docs/collector.smtp.md) | IIS SMTP Server | |
[terminal_services](docs/collector.terminal_services.md) | Terminal services (RDS) | [system](docs/collector.system.md) | System calls | &#10003; |
[textfile](docs/collector.textfile.md) | Read prometheus metrics from a text file | &#10003; | [tcp](docs/collector.tcp.md) | TCP connections | |
[vmware](docs/collector.vmware.md) | Performance counters installed by the Vmware Guest agent | | [terminal_services](docs/collector.terminal_services.md) | Terminal services (RDS) | |
| [textfile](docs/collector.textfile.md) | Read prometheus metrics from a text file | |
| [time](docs/collector.time.md) | Windows Time Service | |
| [udp](docs/collector.udp.md) | UDP connections | |
| [update](docs/collector.update.md) | Windows Update Service | |
| [vmware](docs/collector.vmware.md) | Performance counters installed by the Vmware Guest agent | |
See the linked documentation on each collector for more information on reported metrics, configuration settings and usage examples. See the linked documentation on each collector for more information on reported metrics, configuration settings and usage examples.
@@ -71,93 +81,144 @@ This can be useful for having different Prometheus servers collect specific metr
windows_exporter accepts flags to configure certain behaviours. The ones configuring the global behaviour of the exporter are listed below, while collector-specific ones are documented in the respective collector documentation above. windows_exporter accepts flags to configure certain behaviours. The ones configuring the global behaviour of the exporter are listed below, while collector-specific ones are documented in the respective collector documentation above.
Flag | Description | Default value | Flag | Description | Default value |
---------|-------------|-------------------- |---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
`--telemetry.addr` | host:port for exporter. | `:9182` | `--web.listen-address` | host:port for exporter. | `:9182` |
`--telemetry.path` | URL path for surfacing collected metrics. | `/metrics` | `--telemetry.path` | URL path for surfacing collected metrics. | `/metrics` |
`--telemetry.max-requests` | Maximum number of concurrent requests. 0 to disable. | `5` | `--collectors.enabled` | Comma-separated list of collectors to use. Use `[defaults]` as a placeholder which gets expanded containing all the collectors enabled by default. | `[defaults]` |
`--collectors.enabled` | Comma-separated list of collectors to use. Use `[defaults]` as a placeholder which gets expanded containing all the collectors enabled by default." | `[defaults]` | `--scrape.timeout-margin` | Seconds to subtract from the timeout allowed by the client. Tune to allow for overhead or high loads. | `0.5` |
`--collectors.print` | If true, print available collectors and exit. | | `--web.config.file` | A [web config][web_config] for setting up TLS and Auth | None |
`--scrape.timeout-margin` | Seconds to subtract from the timeout allowed by the client. Tune to allow for overhead or high loads. | `0.5` | `--config.file` | [Using a config file](#using-a-configuration-file) from path | None |
`--web.config.file` | A [web config][web_config] for setting up TLS and Auth | None | `--log.file` | Output file of log messages. One of [stdout, stderr, eventlog, \<path to log file>]<br>**NOTE:** The MSI installer will add a default argument to the installed service setting this to eventlog | stderr |
## Installation ## Installation
The latest release can be downloaded from the [releases page](https://github.com/prometheus-community/windows_exporter/releases). The latest release can be downloaded from the [releases page](https://github.com/prometheus-community/windows_exporter/releases).
All binaries and installation packages are signed with an self-signed certificate. The public key can be found [here](https://github.com/prometheus-community/windows_exporter/blob/master/installer/codesign.cer).
Once import into the trusted root certificate store, the binaries and installation packages will be trusted.
Each release provides a .msi installer. The installer will setup the windows_exporter as a Windows service, as well as create an exception in the Windows Firewall. Each release provides a .msi installer. The installer will setup the windows_exporter as a Windows service, as well as create an exception in the Windows Firewall.
If the installer is run without any parameters, the exporter will run with default settings for enabled collectors, ports, etc. The following parameters are available: If the installer is run without any parameters, the exporter will run with default settings for enabled collectors, ports, etc.
Name | Description The installer provides a configuration file to customize the exporter.
-----|------------
`ENABLED_COLLECTORS` | As the `--collectors.enabled` flag, provide a comma-separated list of enabled collectors
`LISTEN_ADDR` | The IP address to bind to. Defaults to 0.0.0.0
`LISTEN_PORT` | The port to bind to. Defaults to 9182.
`METRICS_PATH` | The path at which to serve metrics. Defaults to `/metrics`
`TEXTFILE_DIR` | As the `--collector.textfile.directory` flag, provide a directory to read text files with metrics from
`REMOTE_ADDR` | Allows setting comma separated remote IP addresses for the Windows Firewall exception (whitelist). Defaults to an empty string (any remote address).
`EXTRA_FLAGS` | Allows passing full CLI flags. Defaults to an empty string.
Parameters are sent to the installer via `msiexec`. Example invocations: The configuration file
* is located in the same directory as the exporter executable.
* has the YAML format and is provided with the `--config.file` parameter.
* can be used to enable or disable collectors, set collector-specific parameters, and set global parameters.
The following parameters are available:
| Name | Description |
|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ENABLED_COLLECTORS` | As the `--collectors.enabled` flag, provide a comma-separated list of enabled collectors |
| `CONFIG_FILE` | Use the `--config.file` flag to specify a config file. If empty, default config file at install dir will be used. If set, the config file must be exist before the installation is started. | |
| `LISTEN_ADDR` | The IP address to bind to. Defaults to an empty string. (any local address) |
| `LISTEN_PORT` | The port to bind to. Defaults to `9182`. |
| `METRICS_PATH` | The path at which to serve metrics. Defaults to `/metrics` |
| `TEXTFILE_DIRS` | Use the `--collector.textfile.directories` flag to specify one or more directories, separated by commas, where the collector should read text files containing metrics |
| `REMOTE_ADDR` | Allows setting comma separated remote IP addresses for the Windows Firewall exception (allow list). Defaults to an empty string (any remote address). |
| `EXTRA_FLAGS` | Allows passing full CLI flags. Defaults to an empty string. For `--collectors.enabled` and `--config.file`, use the specialized properties `ENABLED_COLLECTORS` and `CONFIG_FILE` |
| `ADDLOCAL` | Enables features within the windows_exporter installer. Supported values: `FirewallException` |
| `REMOVE` | Disables features within the windows_exporter installer. Supported values: `FirewallException` |
| `APPLICATIONFOLDER` | Directory to install windows_exporter. Defaults to `C:\Program Files\windows_exporter` |
> [!NOTE]
> The installer properties are always preferred over the values defined in the config file. If you prefer to configure via the config file, avoid using any of the properties listed above.
Parameters are sent to the installer via `msiexec`.
On PowerShell, the `--%` should be passed before defining properties.
Example invocations:
```powershell ```powershell
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,iis LISTEN_PORT=5000 msiexec /i <path-to-msi-file> --% ENABLED_COLLECTORS=os,iis LISTEN_PORT=5000
``` ```
Example service collector with a custom query. Example service collector with a custom query.
```powershell ```powershell
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,service --% EXTRA_FLAGS="--collector.service.services-where ""Name LIKE 'sql%'""" msiexec /i <path-to-msi-file> --% ENABLED_COLLECTORS=os,service EXTRA_FLAGS="--collectors.exchange.enabled=""ADAccessProcesses"""
``` ```
On some older versions of Windows you may need to surround parameter values with double quotes to get the install command parsing properly: Define a config file.
```powershell ```powershell
msiexec /i C:\Users\Administrator\Downloads\windows_exporter.msi ENABLED_COLLECTORS="ad,iis,logon,memory,process,tcp,thermalzone" TEXTFILE_DIR="C:\custom_metrics\" msiexec /i <path-to-msi-file> --% CONFIG_FILE="D:\config.yaml"
``` ```
Alternative install directory
```powershell
msiexec /i <path-to-msi-file> --% ADDLOCAL=FirewallException APPLICATIONFOLDER="F:\Program Files\windows_exporter"
```
On some older versions of Windows,
you may need to surround parameter values with double quotes to get the installation command parsing properly:
```powershell
msiexec /i C:\Users\Administrator\Downloads\windows_exporter.msi --% ENABLED_COLLECTORS="ad,iis,memory,process,tcp,textfile,thermalzone" TEXTFILE_DIRS="C:\custom_metrics\"
```
To install the exporter with creating a firewall exception, use the following command:
```powershell
msiexec /i <path-to-msi-file> --% ADDLOCAL=FirewallException
```
PowerShell versions 7.3 and above require [PSNativeCommandArgumentPassing](https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3) to be set to `Legacy` when using `--% EXTRA_FLAGS`:
```powershell
$PSNativeCommandArgumentPassing = 'Legacy'
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,service --% EXTRA_FLAGS="--collectors.exchange.enabled=""ADAccessProcesses"""
```
## Docker Implementation
The windows_exporter can be run as a Docker container. The Docker image is available on
* [Docker Hub](https://hub.docker.com/r/prometheuscommunity/windows-exporter): `docker.io/prometheuscommunity/windows-exporter`
* [GitHub Container Registry](https://github.com/prometheus-community/windows_exporter/pkgs/container/windows-exporter): `ghcr.io/prometheus-community/windows-exporter`
* [quay.io Registry](https://quay.io/repository/prometheuscommunity/windows-exporter): `quay.io/prometheuscommunity/windows-exporter`
### Tags
The Docker image is tagged with the version of the exporter. The `latest` tag is also available and points to the latest release.
## Kubernetes Implementation
See detailed steps to install on Windows Kubernetes [here](./kubernetes/kubernetes.md).
## Supported versions ## Supported versions
windows_exporter supports Windows Server versions 2008R2 and later, and desktop Windows version 7 and later. `windows_exporter` supports Windows Server versions 2016 and later, and desktop Windows version 10 and 11 (21H2 or later).
## Usage There are known compatibility issues with Windows Server 2012 R2 and earlier versions.
go get -u github.com/prometheus/promu ### HTTP Endpoints
go get -u github.com/prometheus-community/windows_exporter
cd $env:GOPATH/src/github.com/prometheus-community/windows_exporter
promu build -v
.\windows_exporter.exe
The prometheus metrics will be exposed on [localhost:9182](http://localhost:9182) windows_exporter provides the following HTTP endpoints:
## Examples * `/metrics`: Exposes metrics in the [Prometheus text format](https://prometheus.io/docs/instrumenting/exposition_formats/).
* `/health`: Returns 200 OK when the exporter is running.
### Enable only service collector and specify a custom query * `/debug/pprof/`: Exposes the [pprof](https://golang.org/pkg/net/http/pprof/) endpoints. Only, if `--debug.enabled` is set.
.\windows_exporter.exe --collectors.enabled "service" --collector.service.services-where "Name='windows_exporter'"
### Enable only process collector and specify a custom query
.\windows_exporter.exe --collectors.enabled "process" --collector.process.whitelist="firefox.+"
When there are multiple processes with the same name, WMI represents those after the first instance as `process-name#index`. So to get them all, rather than just the first one, the [regular expression](https://en.wikipedia.org/wiki/Regular_expression) must use `.+`. See [process](docs/collector.process.md) for more information.
### Using [defaults] with `--collectors.enabled` argument ### Using [defaults] with `--collectors.enabled` argument
Using `[defaults]` with `--collectors.enabled` argument which gets expanded with all default collectors. Using `[defaults]` with `--collectors.enabled` argument which gets expanded with all default collectors.
.\windows_exporter.exe --collectors.enabled "[defaults],process,container" .\windows_exporter.exe --collectors.enabled "[defaults],process,container"
This enables the additional process and container collectors on top of the defaults. This enables the additional process and container collectors on top of the defaults.
### Using a configuration file ### Using a configuration file
YAML configuration files can be specified with the `--config.file` flag. E.G. `.\windows_exporter.exe --config.file=config.yml` YAML configuration files can be specified with the `--config.file` flag. e.g. `.\windows_exporter.exe --config.file=config.yml`. If you are using the absolute path, make sure to quote the path, e.g. `.\windows_exporter.exe --config.file="C:\Program Files\windows_exporter\config.yml"`
```yaml ```yaml
collectors: collectors:
enabled: cpu,cs,net,service enabled: cpu,net,service
collector: collector:
service: service:
services-where: "Name='windows_exporter'" include: windows_exporter
log: log:
level: warn level: warn
``` ```
@@ -168,7 +229,7 @@ An example configuration file can be found [here](docs/example_config.yml).
Configuration file values can be mixed with CLI flags. E.G. Configuration file values can be mixed with CLI flags. E.G.
`.\windows_exporter.exe --collectors.enabled=cpu,logon` `.\windows_exporter.exe --collectors.enabled=cpu`
```yaml ```yaml
log: log:

View File

@@ -3,4 +3,4 @@
The Prometheus security policy, including how to report vulnerabilities, can be The Prometheus security policy, including how to report vulnerabilities, can be
found here: found here:
https://prometheus.io/docs/operating/security/ <https://prometheus.io/docs/operating/security/>

View File

@@ -0,0 +1,215 @@
// SPDX-License-Identifier: Apache-2.0
//
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build windows
package main
import (
"errors"
"fmt"
"os"
"strings"
"unsafe"
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/svc"
"golang.org/x/sys/windows/svc/eventlog"
)
const serviceName = "windows_exporter"
//nolint:gochecknoglobals
var (
// exitCodeCh is a channel to send an exit code from the main function to the service manager.
// Additionally, if there is an error in the IsService var declaration,
// the exit code is sent to the service manager as well.
exitCodeCh = make(chan int, 1)
// stopCh is a channel to send a signal to the service manager that the service is stopping.
stopCh = make(chan struct{})
// serviceManagerFinishedCh is a channel to send a signal to the main function that the service manager has stopped the service.
serviceManagerFinishedCh = make(chan struct{}, 1)
)
// IsService variable declaration allows initiating time-sensitive components like registering the Windows service
// as early as possible in the startup process.
// init functions are called in the order they are declared, so this package should be imported first.
//
// Ref: https://github.com/prometheus-community/windows_exporter/issues/551#issuecomment-1220774835
//
// Declare imports on this package should be avoided where possible.
// var declaration run before init function, so it guarantees that windows_exporter respond to service manager early
// and avoid timeout.
// The order of the var declaration and init functions depends on the filename as well. The filename should be 0_service.go
// Ref: https://medium.com/@markbates/go-init-order-dafa89fcef22
//
//nolint:gochecknoglobals
var IsService = func() bool {
var err error
isService, err := isWindowsService()
if err != nil {
logToFile(fmt.Sprintf("failed to detect service: %v", err))
return false
}
if !isService {
return false
}
defer func() {
go func() {
err := svc.Run(serviceName, &windowsExporterService{})
if err != nil {
// https://github.com/open-telemetry/opentelemetry-collector/pull/9042
if !errors.Is(err, windows.ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) {
if logErr := logToEventToLog(windows.EVENTLOG_ERROR_TYPE, fmt.Sprintf("failed to start service: %v", err)); logErr != nil {
logToFile(fmt.Sprintf("failed to start service: %v", err))
}
}
}
serviceManagerFinishedCh <- struct{}{}
}()
}()
if err := logToEventToLog(windows.EVENTLOG_INFORMATION_TYPE, "attempting to start exporter service"); err != nil {
logToFile(fmt.Sprintf("failed sent log to event log: %v", err))
exitCodeCh <- 2
}
return true
}()
type windowsExporterService struct{}
// Execute is the entry point for the Windows service manager.
func (s *windowsExporterService) Execute(_ []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (bool, uint32) {
changes <- svc.Status{State: svc.StartPending}
// Send a signal to the main function that the service is running.
changes <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop | svc.AcceptShutdown}
for {
select {
case exitCodeCh := <-exitCodeCh:
// Stop the service if an exit code from the main function is received.
changes <- svc.Status{State: svc.StopPending}
return true, uint32(exitCodeCh)
case c := <-r:
// Handle the service control request.
switch c.Cmd {
case svc.Interrogate:
changes <- c.CurrentStatus
case svc.Stop, svc.Shutdown:
// Stop the service if a stop or shutdown request is received.
_ = logToEventToLog(windows.EVENTLOG_INFORMATION_TYPE, "service stop received")
changes <- svc.Status{State: svc.StopPending}
// Send a signal to the main function to stop the service.
stopCh <- struct{}{}
// Wait for the main function to stop the service.
return false, uint32(<-exitCodeCh)
default:
_ = logToEventToLog(windows.EVENTLOG_ERROR_TYPE, fmt.Sprintf("unexpected control request #%d", c))
}
}
}
}
// logToEventToLog logs a message to the Windows event log.
func logToEventToLog(eType uint16, msg string) error {
eventLog, err := eventlog.Open(serviceName)
if err != nil {
return fmt.Errorf("failed to open event log: %w", err)
}
defer func(eventLog *eventlog.Log) {
_ = eventLog.Close()
}(eventLog)
switch eType {
case windows.EVENTLOG_ERROR_TYPE:
err = eventLog.Error(102, msg)
case windows.EVENTLOG_WARNING_TYPE:
err = eventLog.Warning(101, msg)
case windows.EVENTLOG_INFORMATION_TYPE:
err = eventLog.Info(100, msg)
}
if err != nil {
return fmt.Errorf("error report event: %w", err)
}
return nil
}
func logToFile(msg string) {
if file, err := os.CreateTemp("", "windows_exporter.service.error.log"); err == nil {
_, _ = file.WriteString(msg)
_ = file.Close()
}
}
// isWindowsService is a clone of "golang.org/x/sys/windows/svc:IsWindowsService", but with a fix
// for Windows containers.
// Go cloned the .NET implementation of this function, which has since
// been patched to support Windows containers, which don't use Session ID 0 for services.
// https://github.com/dotnet/runtime/pull/74188
// This function can be replaced with go's once go brings in the fix.
//
// Copyright 2023-present Datadog, Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// https://github.com/DataDog/datadog-agent/blob/46740e82ef40a04c4be545ed8c16a4b0d1f046cf/pkg/util/winutil/servicemain/servicemain.go#L128
func isWindowsService() (bool, error) {
var currentProcess windows.PROCESS_BASIC_INFORMATION
infoSize := uint32(unsafe.Sizeof(currentProcess))
err := windows.NtQueryInformationProcess(windows.CurrentProcess(), windows.ProcessBasicInformation, unsafe.Pointer(&currentProcess), infoSize, &infoSize)
if err != nil {
return false, err
}
var parentProcess *windows.SYSTEM_PROCESS_INFORMATION
for infoSize = uint32((unsafe.Sizeof(*parentProcess) + unsafe.Sizeof(uintptr(0))) * 1024); ; {
parentProcess = (*windows.SYSTEM_PROCESS_INFORMATION)(unsafe.Pointer(&make([]byte, infoSize)[0]))
err = windows.NtQuerySystemInformation(windows.SystemProcessInformation, unsafe.Pointer(parentProcess), infoSize, &infoSize)
if err == nil {
break
} else if !errors.Is(err, windows.STATUS_INFO_LENGTH_MISMATCH) {
return false, err
}
}
for ; ; parentProcess = (*windows.SYSTEM_PROCESS_INFORMATION)(unsafe.Pointer(uintptr(unsafe.Pointer(parentProcess)) + uintptr(parentProcess.NextEntryOffset))) {
if parentProcess.UniqueProcessID == currentProcess.InheritedFromUniqueProcessId {
return strings.EqualFold("services.exe", parentProcess.ImageName.String()), nil
}
if parentProcess.NextEntryOffset == 0 {
break
}
}
return false, nil
}

View File

@@ -0,0 +1,23 @@
// SPDX-License-Identifier: Apache-2.0
//
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
The main package for the windows_exporter executable.
usage: windows_exporter [<flags>]
A metrics collector for Windows.
*/
package main

View File

@@ -0,0 +1,329 @@
// SPDX-License-Identifier: Apache-2.0
//
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build windows
//go:generate go run github.com/tc-hib/go-winres@v0.3.3 make --product-version=git-tag --file-version=git-tag --arch=amd64,arm64
package main
import (
"context"
"errors"
"fmt"
"log/slog"
"net/http"
"net/http/pprof"
"os"
"os/signal"
"os/user"
"runtime"
"runtime/debug"
"slices"
"strings"
"time"
"github.com/alecthomas/kingpin/v2"
"github.com/prometheus-community/windows_exporter/internal/config"
"github.com/prometheus-community/windows_exporter/internal/httphandler"
"github.com/prometheus-community/windows_exporter/internal/log"
"github.com/prometheus-community/windows_exporter/internal/log/flag"
"github.com/prometheus-community/windows_exporter/internal/utils"
"github.com/prometheus-community/windows_exporter/pkg/collector"
"github.com/prometheus/common/version"
"github.com/prometheus/exporter-toolkit/web"
webflag "github.com/prometheus/exporter-toolkit/web/kingpinflag"
"golang.org/x/sys/windows"
)
func main() {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill)
exitCode := run(ctx, os.Args[1:])
stop()
// If we are running as a service, we need to signal the service control manager that we are done.
if !IsService {
os.Exit(exitCode)
}
exitCodeCh <- exitCode
// Wait for the service control manager to signal that we are done.
<-serviceManagerFinishedCh
}
func run(ctx context.Context, args []string) int {
startTime := time.Now()
app := kingpin.New("windows_exporter", "A metrics collector for Windows.")
var (
configFile = app.Flag(
"config.file",
"YAML configuration file to use. Values set in this file will be overridden by CLI flags.",
).String()
webConfig = webflag.AddFlags(app, ":9182")
metricsPath = app.Flag(
"telemetry.path",
"URL path for surfacing collected metrics.",
).Default("/metrics").String()
disableExporterMetrics = app.Flag(
"web.disable-exporter-metrics",
"Exclude metrics about the exporter itself (promhttp_*, process_*, go_*).",
).Bool()
enabledCollectors = app.Flag(
"collectors.enabled",
"Comma-separated list of collectors to use. Use '[defaults]' as a placeholder for all the collectors enabled by default.").
Default(collector.DefaultCollectors).String()
disabledCollectors = app.Flag(
"collectors.disabled",
"Comma-separated list of collectors to exclude. Can be used to disable collector from the defaults.").
Default("").String()
timeoutMargin = app.Flag(
"scrape.timeout-margin",
"Seconds to subtract from the timeout allowed by the client. Tune to allow for overhead or high loads.",
).Default("0.5").Float64()
debugEnabled = app.Flag(
"debug.enabled",
"If true, windows_exporter will expose debug endpoints under /debug/pprof.",
).Default("false").Bool()
processPriority = app.Flag(
"process.priority",
"Priority of the exporter process. Higher priorities may improve exporter responsiveness during periods of system load. Can be one of [\"realtime\", \"high\", \"abovenormal\", \"normal\", \"belownormal\", \"low\"]",
).Default("normal").String()
memoryLimit = app.Flag(
"process.memory-limit",
"Limit memory usage in bytes. This is a soft-limit and not guaranteed. 0 means no limit. Read more at https://pkg.go.dev/runtime/debug#SetMemoryLimit .",
).Default("200000000").Int64()
)
logFile := &log.AllowedFile{}
_ = logFile.Set("stdout")
if IsService {
_ = logFile.Set("eventlog")
}
logConfig := &log.Config{File: logFile}
flag.AddFlags(app, logConfig)
app.Version(version.Print("windows_exporter"))
app.HelpFlag.Short('h')
// Initialize collectors before loading and parsing CLI arguments
collectors := collector.NewWithFlags(app)
if err := config.Parse(app, args); err != nil {
//nolint:sloglint // we do not have an logger yet
slog.LogAttrs(ctx, slog.LevelError, "Failed to load configuration",
slog.Any("err", err),
)
return 1
}
debug.SetMemoryLimit(*memoryLimit)
logger, err := log.New(logConfig)
if err != nil {
logger.LogAttrs(ctx, slog.LevelError, "failed to create logger",
slog.Any("err", err),
)
return 1
}
logger.LogAttrs(ctx, slog.LevelDebug, "logging has Started")
if configFile != nil && *configFile != "" {
logger.LogAttrs(ctx, slog.LevelInfo, "using configuration file: "+*configFile)
}
if err = setPriorityWindows(ctx, logger, os.Getpid(), *processPriority); err != nil {
logger.LogAttrs(ctx, slog.LevelError, "failed to set process priority",
slog.Any("err", err),
)
return 1
}
enabledCollectorList := expandEnabledCollectors(*enabledCollectors)
if err := collectors.Enable(enabledCollectorList); err != nil {
logger.LogAttrs(ctx, slog.LevelError, "couldn't enable collectors",
slog.Any("err", err),
)
return 1
}
if *disabledCollectors != "" {
collectors.Disable(slices.Compact(strings.Split(*disabledCollectors, ",")))
}
// Initialize collectors before loading
if err = collectors.Build(ctx, logger); err != nil {
for _, err := range utils.SplitError(err) {
logger.LogAttrs(ctx, slog.LevelError, "couldn't initialize collector",
slog.Any("err", err),
)
return 1
}
}
logCurrentUser(ctx, logger)
logger.InfoContext(ctx, "Enabled collectors: "+strings.Join(enabledCollectorList, ", "))
mux := http.NewServeMux()
mux.Handle("GET /health", httphandler.NewHealthHandler())
mux.Handle("GET /version", httphandler.NewVersionHandler())
mux.Handle("GET "+*metricsPath, httphandler.New(logger, collectors, &httphandler.Options{
DisableExporterMetrics: *disableExporterMetrics,
TimeoutMargin: *timeoutMargin,
}))
if *debugEnabled {
mux.HandleFunc("GET /debug/pprof/", pprof.Index)
mux.HandleFunc("GET /debug/pprof/cmdline", pprof.Cmdline)
mux.HandleFunc("GET /debug/pprof/profile", pprof.Profile)
mux.HandleFunc("GET /debug/pprof/symbol", pprof.Symbol)
mux.HandleFunc("GET /debug/pprof/trace", pprof.Trace)
}
logger.LogAttrs(ctx, slog.LevelInfo, fmt.Sprintf("starting windows_exporter in %s", time.Since(startTime)),
slog.String("version", version.Version),
slog.String("branch", version.Branch),
slog.String("revision", version.GetRevision()),
slog.String("goversion", version.GoVersion),
slog.String("builddate", version.BuildDate),
slog.Int("maxprocs", runtime.GOMAXPROCS(0)),
)
server := &http.Server{
ReadHeaderTimeout: 5 * time.Second,
IdleTimeout: 60 * time.Second,
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Minute,
Handler: mux,
}
errCh := make(chan error, 1)
go func() {
if err := web.ListenAndServe(server, webConfig, logger); err != nil && !errors.Is(err, http.ErrServerClosed) {
errCh <- err
}
close(errCh)
}()
select {
case <-ctx.Done():
logger.LogAttrs(ctx, slog.LevelInfo, "Shutting down windows_exporter via kill signal")
case <-stopCh:
logger.LogAttrs(ctx, slog.LevelInfo, "Shutting down windows_exporter via service control")
case err := <-errCh:
if err != nil {
logger.LogAttrs(ctx, slog.LevelError, "Failed to start windows_exporter",
slog.Any("err", err),
)
return 1
}
}
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
//nolint:contextcheck // create a new context for server shutdown
if err = server.Shutdown(ctx); err != nil {
//nolint:contextcheck
logger.LogAttrs(ctx, slog.LevelError, "Failed to shutdown windows_exporter",
slog.Any("err", err),
)
} else {
//nolint:contextcheck
logger.LogAttrs(ctx, slog.LevelInfo, "windows_exporter has shut down")
}
return 0
}
func logCurrentUser(ctx context.Context, logger *slog.Logger) {
u, err := user.Current()
if err != nil {
logger.LogAttrs(ctx, slog.LevelWarn, "Unable to determine which user is running this exporter. More info: https://github.com/golang/go/issues/37348",
slog.Any("err", err),
)
return
}
logger.LogAttrs(ctx, slog.LevelInfo, "Running as "+u.Username)
if strings.Contains(u.Username, "ContainerAdministrator") || strings.Contains(u.Username, "ContainerUser") {
logger.LogAttrs(ctx, slog.LevelWarn, "Running as a preconfigured Windows Container user. This may mean you do not have Windows HostProcess containers configured correctly and some functionality will not work as expected.")
}
}
// setPriorityWindows sets the priority of the current process to the specified value.
func setPriorityWindows(ctx context.Context, logger *slog.Logger, pid int, priority string) error {
// Mapping of priority names to uin32 values required by windows.SetPriorityClass.
priorityStringToInt := map[string]uint32{
"realtime": windows.REALTIME_PRIORITY_CLASS,
"high": windows.HIGH_PRIORITY_CLASS,
"abovenormal": windows.ABOVE_NORMAL_PRIORITY_CLASS,
"normal": windows.NORMAL_PRIORITY_CLASS,
"belownormal": windows.BELOW_NORMAL_PRIORITY_CLASS,
"low": windows.IDLE_PRIORITY_CLASS,
}
winPriority, ok := priorityStringToInt[priority]
// Only set process priority if a non-default and valid value has been set
if !ok || winPriority == windows.NORMAL_PRIORITY_CLASS {
return nil
}
logger.LogAttrs(ctx, slog.LevelDebug, "setting process priority to "+priority)
// https://learn.microsoft.com/en-us/windows/win32/procthread/process-security-and-access-rights
handle, err := windows.OpenProcess(
windows.STANDARD_RIGHTS_REQUIRED|windows.SYNCHRONIZE|windows.SPECIFIC_RIGHTS_ALL,
false, uint32(pid),
)
if err != nil {
return fmt.Errorf("failed to open own process: %w", err)
}
if err = windows.SetPriorityClass(handle, winPriority); err != nil {
return fmt.Errorf("failed to set priority class: %w", err)
}
if err = windows.CloseHandle(handle); err != nil {
return fmt.Errorf("failed to close handle: %w", err)
}
return nil
}
func expandEnabledCollectors(enabled string) []string {
expanded := strings.ReplaceAll(enabled, "[defaults]", collector.DefaultCollectors)
return slices.Compact(strings.Split(expanded, ","))
}

View File

@@ -0,0 +1,199 @@
// SPDX-License-Identifier: Apache-2.0
//
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build windows
package main
import (
"context"
"errors"
"fmt"
"io"
"net"
"net/http"
"net/url"
"os"
"strings"
"testing"
"time"
"github.com/stretchr/testify/require"
"golang.org/x/sys/windows"
)
//nolint:tparallel
func TestRun(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
name string
args []string
config string
metricsEndpoint string
exitCode int
}{
{
name: "default",
args: []string{},
metricsEndpoint: "http://127.0.0.1:9182/metrics",
},
{
name: "web.listen-address",
args: []string{"--web.listen-address=127.0.0.1:8080"},
metricsEndpoint: "http://127.0.0.1:8080/metrics",
},
{
name: "web.listen-address",
args: []string{"--web.listen-address=127.0.0.1:8081", "--web.listen-address=[::1]:8081"},
metricsEndpoint: "http://[::1]:8081/metrics",
},
{
name: "config",
args: []string{"--config.file=config.yaml"},
config: `{"web":{"listen-address":"127.0.0.1:8082"}}`,
metricsEndpoint: "http://127.0.0.1:8082/metrics",
},
{
name: "web.listen-address with config",
args: []string{"--config.file=config.yaml", "--web.listen-address=127.0.0.1:8084"},
config: `{"web":{"listen-address":"127.0.0.1:8083"}}`,
metricsEndpoint: "http://127.0.0.1:8084/metrics",
},
} {
t.Run(tc.name, func(t *testing.T) {
ctx, cancel := context.WithCancel(t.Context())
defer cancel()
if tc.config != "" {
// Create a temporary config file.
tmpfile, err := os.CreateTemp(t.TempDir(), "config-*.yaml")
require.NoError(t, err)
t.Cleanup(func() {
require.NoError(t, tmpfile.Close())
})
_, err = tmpfile.WriteString(tc.config)
require.NoError(t, err)
for i, arg := range tc.args {
tc.args[i] = strings.ReplaceAll(arg, "config.yaml", tmpfile.Name())
}
}
exitCodeCh := make(chan int)
var stdout string
go func() {
stdout = captureOutput(t, func() {
// Simulate the service control manager signaling that we are done.
exitCodeCh <- run(ctx, tc.args)
})
}()
t.Cleanup(func() {
select {
case exitCode := <-exitCodeCh:
require.Equal(t, tc.exitCode, exitCode)
case <-time.After(2 * time.Second):
t.Fatalf("timed out waiting for exit code, want %d", tc.exitCode)
}
})
if tc.exitCode != 0 {
return
}
uri, err := url.Parse(tc.metricsEndpoint)
require.NoError(t, err)
err = waitUntilListening(t, "tcp", uri.Host)
require.NoError(t, err, "LOGS:\n%s", stdout)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, tc.metricsEndpoint, nil)
require.NoError(t, err)
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err, "LOGS:\n%s", stdout)
require.Equal(t, http.StatusOK, resp.StatusCode)
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
err = resp.Body.Close()
require.NoError(t, err)
require.NotEmpty(t, body)
require.Contains(t, string(body), "# HELP windows_exporter_build_info")
cancel()
})
}
}
func captureOutput(tb testing.TB, f func()) string {
tb.Helper()
orig := os.Stdout
r, w, _ := os.Pipe()
os.Stdout = w
f()
os.Stdout = orig
_ = w.Close()
out, _ := io.ReadAll(r)
return string(out)
}
func waitUntilListening(tb testing.TB, network, address string) error {
tb.Helper()
var (
conn net.Conn
err error
)
dialer := &net.Dialer{Timeout: 100 * time.Millisecond}
for range 20 {
conn, err = dialer.DialContext(tb.Context(), network, address)
if err == nil {
_ = conn.Close()
return nil
}
if errors.Is(err, windows.Errno(10061)) {
time.Sleep(50 * time.Millisecond)
continue
}
break
}
var winErr windows.Errno
if errors.As(err, &winErr) {
return fmt.Errorf("listener not listening: %w (#%d)", winErr, uint32(winErr))
}
return fmt.Errorf("listener not listening: %w", err)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,56 @@
{
"RT_GROUP_ICON": {
"APP": {
"0000": [
"icon.png"
]
}
},
"RT_MANIFEST": {
"#1": {
"0409": {
"description": "A Prometheus exporter for Windows machines.",
"minimum-os": "win7",
"execution-level": "as invoker",
"ui-access": false,
"auto-elevate": false,
"dpi-awareness": "system",
"disable-theming": false,
"disable-window-filtering": false,
"high-resolution-scrolling-aware": false,
"ultra-high-resolution-scrolling-aware": false,
"long-path-aware": false,
"printer-driver-isolation": false,
"gdi-scaling": false,
"segment-heap": false,
"use-common-controls-v6": false
}
}
},
"RT_VERSION": {
"#1": {
"0000": {
"fixed": {
"file_version": "0.0.0.0",
"product_version": "0.0.0.0"
},
"info": {
"0409": {
"Comments": "",
"CompanyName": "Prometheus Community",
"FileDescription": "A Prometheus exporter for Windows machines.",
"FileVersion": "",
"InternalName": "windows_exporter",
"LegalCopyright": "",
"LegalTrademarks": "",
"OriginalFilename": "",
"PrivateBuild": "",
"ProductName": "windows_exporter",
"ProductVersion": "",
"SpecialBuild": ""
}
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkADCollector(b *testing.B) {
benchmarkCollector(b, "ad", NewADCollector)
}

View File

@@ -1,189 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("adfs", newADFSCollector, "AD FS")
}
type adfsCollector struct {
adLoginConnectionFailures *prometheus.Desc
certificateAuthentications *prometheus.Desc
deviceAuthentications *prometheus.Desc
extranetAccountLockouts *prometheus.Desc
federatedAuthentications *prometheus.Desc
passportAuthentications *prometheus.Desc
passiveRequests *prometheus.Desc
passwordChangeFailed *prometheus.Desc
passwordChangeSucceeded *prometheus.Desc
tokenRequests *prometheus.Desc
windowsIntegratedAuthentications *prometheus.Desc
}
// newADFSCollector constructs a new adfsCollector
func newADFSCollector() (Collector, error) {
const subsystem = "adfs"
return &adfsCollector{
adLoginConnectionFailures: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "ad_login_connection_failures_total"),
"Total number of connection failures to an Active Directory domain controller",
nil,
nil,
),
certificateAuthentications: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "certificate_authentications_total"),
"Total number of User Certificate authentications",
nil,
nil,
),
deviceAuthentications: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "device_authentications_total"),
"Total number of Device authentications",
nil,
nil,
),
extranetAccountLockouts: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "extranet_account_lockouts_total"),
"Total number of Extranet Account Lockouts",
nil,
nil,
),
federatedAuthentications: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "federated_authentications_total"),
"Total number of authentications from a federated source",
nil,
nil,
),
passportAuthentications: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "passport_authentications_total"),
"Total number of Microsoft Passport SSO authentications",
nil,
nil,
),
passiveRequests: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "passive_requests_total"),
"Total number of passive (browser-based) requests",
nil,
nil,
),
passwordChangeFailed: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "password_change_failed_total"),
"Total number of failed password changes",
nil,
nil,
),
passwordChangeSucceeded: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "password_change_succeeded_total"),
"Total number of successful password changes",
nil,
nil,
),
tokenRequests: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "token_requests_total"),
"Total number of token requests",
nil,
nil,
),
windowsIntegratedAuthentications: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "windows_integrated_authentications_total"),
"Total number of Windows integrated authentications (Kerberos/NTLM)",
nil,
nil,
),
}, nil
}
type perflibADFS struct {
AdLoginConnectionFailures float64 `perflib:"AD login Connection Failures"`
CertificateAuthentications float64 `perflib:"Certificate Authentications"`
DeviceAuthentications float64 `perflib:"Device Authentications"`
ExtranetAccountLockouts float64 `perflib:"Extranet Account Lockouts"`
FederatedAuthentications float64 `perflib:"Federated Authentications"`
PassportAuthentications float64 `perflib:"Microsoft Passport Authentications"`
PassiveRequests float64 `perflib:"Passive Requests"`
PasswordChangeFailed float64 `perflib:"Password Change Failed Requests"`
PasswordChangeSucceeded float64 `perflib:"Password Change Successful Requests"`
TokenRequests float64 `perflib:"Token Requests"`
WindowsIntegratedAuthentications float64 `perflib:"Windows Integrated Authentications"`
}
func (c *adfsCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var adfsData []perflibADFS
err := unmarshalObject(ctx.perfObjects["AD FS"], &adfsData)
if err != nil {
return err
}
ch <- prometheus.MustNewConstMetric(
c.adLoginConnectionFailures,
prometheus.CounterValue,
adfsData[0].AdLoginConnectionFailures,
)
ch <- prometheus.MustNewConstMetric(
c.certificateAuthentications,
prometheus.CounterValue,
adfsData[0].CertificateAuthentications,
)
ch <- prometheus.MustNewConstMetric(
c.deviceAuthentications,
prometheus.CounterValue,
adfsData[0].DeviceAuthentications,
)
ch <- prometheus.MustNewConstMetric(
c.extranetAccountLockouts,
prometheus.CounterValue,
adfsData[0].ExtranetAccountLockouts,
)
ch <- prometheus.MustNewConstMetric(
c.federatedAuthentications,
prometheus.CounterValue,
adfsData[0].FederatedAuthentications,
)
ch <- prometheus.MustNewConstMetric(
c.passportAuthentications,
prometheus.CounterValue,
adfsData[0].PassportAuthentications,
)
ch <- prometheus.MustNewConstMetric(
c.passiveRequests,
prometheus.CounterValue,
adfsData[0].PassiveRequests,
)
ch <- prometheus.MustNewConstMetric(
c.passwordChangeFailed,
prometheus.CounterValue,
adfsData[0].PasswordChangeFailed,
)
ch <- prometheus.MustNewConstMetric(
c.passwordChangeSucceeded,
prometheus.CounterValue,
adfsData[0].PasswordChangeSucceeded,
)
ch <- prometheus.MustNewConstMetric(
c.tokenRequests,
prometheus.CounterValue,
adfsData[0].TokenRequests,
)
ch <- prometheus.MustNewConstMetric(
c.windowsIntegratedAuthentications,
prometheus.CounterValue,
adfsData[0].WindowsIntegratedAuthentications,
)
return nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkADFSCollector(b *testing.B) {
benchmarkCollector(b, "adfs", newADFSCollector)
}

View File

@@ -1,453 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("cache", newCacheCollector, "Cache")
}
// A CacheCollector is a Prometheus collector for Perflib Cache metrics
type CacheCollector struct {
AsyncCopyReadsTotal *prometheus.Desc
AsyncDataMapsTotal *prometheus.Desc
AsyncFastReadsTotal *prometheus.Desc
AsyncMDLReadsTotal *prometheus.Desc
AsyncPinReadsTotal *prometheus.Desc
CopyReadHitsTotal *prometheus.Desc
CopyReadsTotal *prometheus.Desc
DataFlushesTotal *prometheus.Desc
DataFlushPagesTotal *prometheus.Desc
DataMapHitsPercent *prometheus.Desc
DataMapPinsTotal *prometheus.Desc
DataMapsTotal *prometheus.Desc
DirtyPages *prometheus.Desc
DirtyPageThreshold *prometheus.Desc
FastReadNotPossiblesTotal *prometheus.Desc
FastReadResourceMissesTotal *prometheus.Desc
FastReadsTotal *prometheus.Desc
LazyWriteFlushesTotal *prometheus.Desc
LazyWritePagesTotal *prometheus.Desc
MDLReadHitsTotal *prometheus.Desc
MDLReadsTotal *prometheus.Desc
PinReadHitsTotal *prometheus.Desc
PinReadsTotal *prometheus.Desc
ReadAheadsTotal *prometheus.Desc
SyncCopyReadsTotal *prometheus.Desc
SyncDataMapsTotal *prometheus.Desc
SyncFastReadsTotal *prometheus.Desc
SyncMDLReadsTotal *prometheus.Desc
SyncPinReadsTotal *prometheus.Desc
}
// NewCacheCollector ...
func newCacheCollector() (Collector, error) {
const subsystem = "cache"
return &CacheCollector{
AsyncCopyReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "async_copy_reads_total"),
"(AsyncCopyReadsTotal)",
nil,
nil,
),
AsyncDataMapsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "async_data_maps_total"),
"(AsyncDataMapsTotal)",
nil,
nil,
),
AsyncFastReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "async_fast_reads_total"),
"(AsyncFastReadsTotal)",
nil,
nil,
),
AsyncMDLReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "async_mdl_reads_total"),
"(AsyncMDLReadsTotal)",
nil,
nil,
),
AsyncPinReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "async_pin_reads_total"),
"(AsyncPinReadsTotal)",
nil,
nil,
),
CopyReadHitsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "copy_read_hits_total"),
"(CopyReadHitsTotal)",
nil,
nil,
),
CopyReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "copy_reads_total"),
"(CopyReadsTotal)",
nil,
nil,
),
DataFlushesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "data_flushes_total"),
"(DataFlushesTotal)",
nil,
nil,
),
DataFlushPagesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "data_flush_pages_total"),
"(DataFlushPagesTotal)",
nil,
nil,
),
DataMapHitsPercent: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "data_map_hits_percent"),
"(DataMapHitsPercent)",
nil,
nil,
),
DataMapPinsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "data_map_pins_total"),
"(DataMapPinsTotal)",
nil,
nil,
),
DataMapsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "data_maps_total"),
"(DataMapsTotal)",
nil,
nil,
),
DirtyPages: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "dirty_pages"),
"(DirtyPages)",
nil,
nil,
),
DirtyPageThreshold: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "dirty_page_threshold"),
"(DirtyPageThreshold)",
nil,
nil,
),
FastReadNotPossiblesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "fast_read_not_possibles_total"),
"(FastReadNotPossiblesTotal)",
nil,
nil,
),
FastReadResourceMissesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "fast_read_resource_misses_total"),
"(FastReadResourceMissesTotal)",
nil,
nil,
),
FastReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "fast_reads_total"),
"(FastReadsTotal)",
nil,
nil,
),
LazyWriteFlushesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "lazy_write_flushes_total"),
"(LazyWriteFlushesTotal)",
nil,
nil,
),
LazyWritePagesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "lazy_write_pages_total"),
"(LazyWritePagesTotal)",
nil,
nil,
),
MDLReadHitsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "mdl_read_hits_total"),
"(MDLReadHitsTotal)",
nil,
nil,
),
MDLReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "mdl_reads_total"),
"(MDLReadsTotal)",
nil,
nil,
),
PinReadHitsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "pin_read_hits_total"),
"(PinReadHitsTotal)",
nil,
nil,
),
PinReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "pin_reads_total"),
"(PinReadsTotal)",
nil,
nil,
),
ReadAheadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "read_aheads_total"),
"(ReadAheadsTotal)",
nil,
nil,
),
SyncCopyReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "sync_copy_reads_total"),
"(SyncCopyReadsTotal)",
nil,
nil,
),
SyncDataMapsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "sync_data_maps_total"),
"(SyncDataMapsTotal)",
nil,
nil,
),
SyncFastReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "sync_fast_reads_total"),
"(SyncFastReadsTotal)",
nil,
nil,
),
SyncMDLReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "sync_mdl_reads_total"),
"(SyncMDLReadsTotal)",
nil,
nil,
),
SyncPinReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "sync_pin_reads_total"),
"(SyncPinReadsTotal)",
nil,
nil,
),
}, nil
}
// Collect implements the Collector interface
func (c *CacheCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ctx, ch); err != nil {
log.Error("failed collecting cache metrics:", desc, err)
return err
}
return nil
}
// Perflib "Cache":
// - https://docs.microsoft.com/en-us/previous-versions/aa394267(v=vs.85)
type perflibCache struct {
AsyncCopyReadsTotal float64 `perflib:"Async Copy Reads/sec"`
AsyncDataMapsTotal float64 `perflib:"Async Data Maps/sec"`
AsyncFastReadsTotal float64 `perflib:"Async Fast Reads/sec"`
AsyncMDLReadsTotal float64 `perflib:"Async MDL Reads/sec"`
AsyncPinReadsTotal float64 `perflib:"Async Pin Reads/sec"`
CopyReadHitsTotal float64 `perflib:"Copy Read Hits %"`
CopyReadsTotal float64 `perflib:"Copy Reads/sec"`
DataFlushesTotal float64 `perflib:"Data Flushes/sec"`
DataFlushPagesTotal float64 `perflib:"Data Flush Pages/sec"`
DataMapHitsPercent float64 `perflib:"Data Map Hits %"`
DataMapPinsTotal float64 `perflib:"Data Map Pins/sec"`
DataMapsTotal float64 `perflib:"Data Maps/sec"`
DirtyPages float64 `perflib:"Dirty Pages"`
DirtyPageThreshold float64 `perflib:"Dirty Page Threshold"`
FastReadNotPossiblesTotal float64 `perflib:"Fast Read Not Possibles/sec"`
FastReadResourceMissesTotal float64 `perflib:"Fast Read Resource Misses/sec"`
FastReadsTotal float64 `perflib:"Fast Reads/sec"`
LazyWriteFlushesTotal float64 `perflib:"Lazy Write Flushes/sec"`
LazyWritePagesTotal float64 `perflib:"Lazy Write Pages/sec"`
MDLReadHitsTotal float64 `perflib:"MDL Read Hits %"`
MDLReadsTotal float64 `perflib:"MDL Reads/sec"`
PinReadHitsTotal float64 `perflib:"Pin Read Hits %"`
PinReadsTotal float64 `perflib:"Pin Reads/sec"`
ReadAheadsTotal float64 `perflib:"Read Aheads/sec"`
SyncCopyReadsTotal float64 `perflib:"Sync Copy Reads/sec"`
SyncDataMapsTotal float64 `perflib:"Sync Data Maps/sec"`
SyncFastReadsTotal float64 `perflib:"Sync Fast Reads/sec"`
SyncMDLReadsTotal float64 `perflib:"Sync MDL Reads/sec"`
SyncPinReadsTotal float64 `perflib:"Sync Pin Reads/sec"`
}
func (c *CacheCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []perflibCache // Single-instance class, array is required but will have single entry.
if err := unmarshalObject(ctx.perfObjects["Cache"], &dst); err != nil {
return nil, err
}
ch <- prometheus.MustNewConstMetric(
c.AsyncCopyReadsTotal,
prometheus.CounterValue,
dst[0].AsyncCopyReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.AsyncDataMapsTotal,
prometheus.CounterValue,
dst[0].AsyncDataMapsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.AsyncFastReadsTotal,
prometheus.CounterValue,
dst[0].AsyncFastReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.AsyncMDLReadsTotal,
prometheus.CounterValue,
dst[0].AsyncMDLReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.AsyncPinReadsTotal,
prometheus.CounterValue,
dst[0].AsyncPinReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.CopyReadHitsTotal,
prometheus.GaugeValue,
dst[0].CopyReadHitsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.CopyReadsTotal,
prometheus.CounterValue,
dst[0].CopyReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.DataFlushesTotal,
prometheus.CounterValue,
dst[0].DataFlushesTotal,
)
ch <- prometheus.MustNewConstMetric(
c.DataFlushPagesTotal,
prometheus.CounterValue,
dst[0].DataFlushPagesTotal,
)
ch <- prometheus.MustNewConstMetric(
c.DataMapHitsPercent,
prometheus.GaugeValue,
dst[0].DataMapHitsPercent,
)
ch <- prometheus.MustNewConstMetric(
c.DataMapPinsTotal,
prometheus.CounterValue,
dst[0].DataMapPinsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.DataMapsTotal,
prometheus.CounterValue,
dst[0].DataMapsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.DirtyPages,
prometheus.GaugeValue,
dst[0].DirtyPages,
)
ch <- prometheus.MustNewConstMetric(
c.DirtyPageThreshold,
prometheus.GaugeValue,
dst[0].DirtyPageThreshold,
)
ch <- prometheus.MustNewConstMetric(
c.FastReadNotPossiblesTotal,
prometheus.CounterValue,
dst[0].FastReadNotPossiblesTotal,
)
ch <- prometheus.MustNewConstMetric(
c.FastReadResourceMissesTotal,
prometheus.CounterValue,
dst[0].FastReadResourceMissesTotal,
)
ch <- prometheus.MustNewConstMetric(
c.FastReadsTotal,
prometheus.CounterValue,
dst[0].FastReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.LazyWriteFlushesTotal,
prometheus.CounterValue,
dst[0].LazyWriteFlushesTotal,
)
ch <- prometheus.MustNewConstMetric(
c.LazyWritePagesTotal,
prometheus.CounterValue,
dst[0].LazyWritePagesTotal,
)
ch <- prometheus.MustNewConstMetric(
c.MDLReadHitsTotal,
prometheus.CounterValue,
dst[0].MDLReadHitsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.MDLReadsTotal,
prometheus.CounterValue,
dst[0].MDLReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.PinReadHitsTotal,
prometheus.CounterValue,
dst[0].PinReadHitsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.PinReadsTotal,
prometheus.CounterValue,
dst[0].PinReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.ReadAheadsTotal,
prometheus.CounterValue,
dst[0].ReadAheadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.SyncCopyReadsTotal,
prometheus.CounterValue,
dst[0].SyncCopyReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.SyncDataMapsTotal,
prometheus.CounterValue,
dst[0].SyncDataMapsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.SyncFastReadsTotal,
prometheus.CounterValue,
dst[0].SyncFastReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.SyncMDLReadsTotal,
prometheus.CounterValue,
dst[0].SyncMDLReadsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.SyncPinReadsTotal,
prometheus.CounterValue,
dst[0].SyncPinReadsTotal,
)
return nil, nil
}

View File

@@ -1,150 +0,0 @@
package collector
import (
"fmt"
"sort"
"strconv"
"strings"
"github.com/leoluk/perflib_exporter/perflib"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/windows/registry"
)
// ...
const (
// TODO: Make package-local
Namespace = "windows"
// Conversion factors
ticksToSecondsScaleFactor = 1 / 1e7
windowsEpoch = 116444736000000000
)
// getWindowsVersion reads the version number of the OS from the Registry
// See https://docs.microsoft.com/en-us/windows/desktop/sysinfo/operating-system-version
func getWindowsVersion() float64 {
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
if err != nil {
log.Warn("Couldn't open registry", err)
return 0
}
defer func() {
err = k.Close()
if err != nil {
log.Warnf("Failed to close registry key: %v", err)
}
}()
currentv, _, err := k.GetStringValue("CurrentVersion")
if err != nil {
log.Warn("Couldn't open registry to determine current Windows version:", err)
return 0
}
currentv_flt, err := strconv.ParseFloat(currentv, 64)
log.Debugf("Detected Windows version %f\n", currentv_flt)
return currentv_flt
}
type collectorBuilder func() (Collector, error)
var (
builders = make(map[string]collectorBuilder)
perfCounterDependencies = make(map[string]string)
)
func registerCollector(name string, builder collectorBuilder, perfCounterNames ...string) {
builders[name] = builder
addPerfCounterDependencies(name, perfCounterNames)
}
func addPerfCounterDependencies(name string, perfCounterNames []string) {
perfIndicies := make([]string, 0, len(perfCounterNames))
for _, cn := range perfCounterNames {
perfIndicies = append(perfIndicies, MapCounterToIndex(cn))
}
perfCounterDependencies[name] = strings.Join(perfIndicies, " ")
}
func Available() []string {
cs := make([]string, 0, len(builders))
for c := range builders {
cs = append(cs, c)
}
return cs
}
func Build(collector string) (Collector, error) {
builder, exists := builders[collector]
if !exists {
return nil, fmt.Errorf("Unknown collector %q", collector)
}
return builder()
}
func getPerfQuery(collectors []string) string {
parts := make([]string, 0, len(collectors))
for _, c := range collectors {
if p := perfCounterDependencies[c]; p != "" {
parts = append(parts, p)
}
}
return strings.Join(parts, " ")
}
// Collector is the interface a collector has to implement.
type Collector interface {
// Get new metrics and expose them via prometheus registry.
Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) (err error)
}
type ScrapeContext struct {
perfObjects map[string]*perflib.PerfObject
}
// PrepareScrapeContext creates a ScrapeContext to be used during a single scrape
func PrepareScrapeContext(collectors []string) (*ScrapeContext, error) {
q := getPerfQuery(collectors) // TODO: Memoize
objs, err := getPerflibSnapshot(q)
if err != nil {
return nil, err
}
return &ScrapeContext{objs}, nil
}
func boolToFloat(b bool) float64 {
if b {
return 1.0
}
return 0.0
}
func find(slice []string, val string) bool {
for _, item := range slice {
if item == val {
return true
}
}
return false
}
// Used by more complex collectors where user input specifies enabled child collectors.
// Splits provided child collectors and deduplicate.
func expandEnabledChildCollectors(enabled string) []string {
separated := strings.Split(enabled, ",")
unique := map[string]bool{}
for _, s := range separated {
if s != "" {
unique[s] = true
}
}
result := make([]string, 0, len(unique))
for s := range unique {
result = append(result, s)
}
// Ensure result is ordered, to prevent test failure
sort.Strings(result)
return result
}

View File

@@ -1,60 +0,0 @@
package collector
import (
"reflect"
"testing"
"github.com/prometheus/client_golang/prometheus"
)
func TestExpandChildCollectors(t *testing.T) {
cases := []struct {
name string
input string
expectedOutput []string
}{
{
name: "simple",
input: "testing1,testing2,testing3",
expectedOutput: []string{"testing1", "testing2", "testing3"},
},
{
name: "duplicate",
input: "testing1,testing2,testing2,testing3",
expectedOutput: []string{"testing1", "testing2", "testing3"},
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
output := expandEnabledChildCollectors(c.input)
if !reflect.DeepEqual(output, c.expectedOutput) {
t.Errorf("Output mismatch, expected %+v, got %+v", c.expectedOutput, output)
}
})
}
}
func benchmarkCollector(b *testing.B, name string, collectFunc func() (Collector, error)) {
// Create perflib scrape context. Some perflib collectors required a correct context,
// or will fail during benchmark.
scrapeContext, err := PrepareScrapeContext([]string{name})
if err != nil {
b.Error(err)
}
c, err := collectFunc()
if err != nil {
b.Error(err)
}
metrics := make(chan prometheus.Metric)
go func() {
for {
<-metrics
}
}()
for i := 0; i < b.N; i++ {
c.Collect(scrapeContext, metrics) //nolint:errcheck
}
}

View File

@@ -1,290 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/Microsoft/hcsshim"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("container", NewContainerMetricsCollector)
}
// A ContainerMetricsCollector is a Prometheus collector for containers metrics
type ContainerMetricsCollector struct {
// Presence
ContainerAvailable *prometheus.Desc
// Number of containers
ContainersCount *prometheus.Desc
// memory
UsageCommitBytes *prometheus.Desc
UsageCommitPeakBytes *prometheus.Desc
UsagePrivateWorkingSetBytes *prometheus.Desc
// CPU
RuntimeTotal *prometheus.Desc
RuntimeUser *prometheus.Desc
RuntimeKernel *prometheus.Desc
// Network
BytesReceived *prometheus.Desc
BytesSent *prometheus.Desc
PacketsReceived *prometheus.Desc
PacketsSent *prometheus.Desc
DroppedPacketsIncoming *prometheus.Desc
DroppedPacketsOutgoing *prometheus.Desc
}
// NewContainerMetricsCollector constructs a new ContainerMetricsCollector
func NewContainerMetricsCollector() (Collector, error) {
const subsystem = "container"
return &ContainerMetricsCollector{
ContainerAvailable: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "available"),
"Available",
[]string{"container_id"},
nil,
),
ContainersCount: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "count"),
"Number of containers",
nil,
nil,
),
UsageCommitBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "memory_usage_commit_bytes"),
"Memory Usage Commit Bytes",
[]string{"container_id"},
nil,
),
UsageCommitPeakBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "memory_usage_commit_peak_bytes"),
"Memory Usage Commit Peak Bytes",
[]string{"container_id"},
nil,
),
UsagePrivateWorkingSetBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "memory_usage_private_working_set_bytes"),
"Memory Usage Private Working Set Bytes",
[]string{"container_id"},
nil,
),
RuntimeTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "cpu_usage_seconds_total"),
"Total Run time in Seconds",
[]string{"container_id"},
nil,
),
RuntimeUser: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "cpu_usage_seconds_usermode"),
"Run Time in User mode in Seconds",
[]string{"container_id"},
nil,
),
RuntimeKernel: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "cpu_usage_seconds_kernelmode"),
"Run time in Kernel mode in Seconds",
[]string{"container_id"},
nil,
),
BytesReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "network_receive_bytes_total"),
"Bytes Received on Interface",
[]string{"container_id", "interface"},
nil,
),
BytesSent: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "network_transmit_bytes_total"),
"Bytes Sent on Interface",
[]string{"container_id", "interface"},
nil,
),
PacketsReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "network_receive_packets_total"),
"Packets Received on Interface",
[]string{"container_id", "interface"},
nil,
),
PacketsSent: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "network_transmit_packets_total"),
"Packets Sent on Interface",
[]string{"container_id", "interface"},
nil,
),
DroppedPacketsIncoming: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "network_receive_packets_dropped_total"),
"Dropped Incoming Packets on Interface",
[]string{"container_id", "interface"},
nil,
),
DroppedPacketsOutgoing: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "network_transmit_packets_dropped_total"),
"Dropped Outgoing Packets on Interface",
[]string{"container_id", "interface"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *ContainerMetricsCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting ContainerMetricsCollector metrics:", desc, err)
return err
}
return nil
}
// containerClose closes the container resource
func containerClose(c hcsshim.Container) {
err := c.Close()
if err != nil {
log.Error(err)
}
}
func (c *ContainerMetricsCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
// Types Container is passed to get the containers compute systems only
containers, err := hcsshim.GetContainers(hcsshim.ComputeSystemQuery{Types: []string{"Container"}})
if err != nil {
log.Error("Err in Getting containers:", err)
return nil, err
}
count := len(containers)
ch <- prometheus.MustNewConstMetric(
c.ContainersCount,
prometheus.GaugeValue,
float64(count),
)
if count == 0 {
return nil, nil
}
for _, containerDetails := range containers {
container, err := hcsshim.OpenContainer(containerDetails.ID)
if container != nil {
defer containerClose(container)
}
if err != nil {
log.Error("err in opening container: ", containerDetails.ID, err)
continue
}
cstats, err := container.Statistics()
if err != nil {
log.Error("err in fetching container Statistics: ", containerDetails.ID, err)
continue
}
containerIdWithPrefix := getContainerIdWithPrefix(containerDetails)
ch <- prometheus.MustNewConstMetric(
c.ContainerAvailable,
prometheus.CounterValue,
1,
containerIdWithPrefix,
)
ch <- prometheus.MustNewConstMetric(
c.UsageCommitBytes,
prometheus.GaugeValue,
float64(cstats.Memory.UsageCommitBytes),
containerIdWithPrefix,
)
ch <- prometheus.MustNewConstMetric(
c.UsageCommitPeakBytes,
prometheus.GaugeValue,
float64(cstats.Memory.UsageCommitPeakBytes),
containerIdWithPrefix,
)
ch <- prometheus.MustNewConstMetric(
c.UsagePrivateWorkingSetBytes,
prometheus.GaugeValue,
float64(cstats.Memory.UsagePrivateWorkingSetBytes),
containerIdWithPrefix,
)
ch <- prometheus.MustNewConstMetric(
c.RuntimeTotal,
prometheus.CounterValue,
float64(cstats.Processor.TotalRuntime100ns)*ticksToSecondsScaleFactor,
containerIdWithPrefix,
)
ch <- prometheus.MustNewConstMetric(
c.RuntimeUser,
prometheus.CounterValue,
float64(cstats.Processor.RuntimeUser100ns)*ticksToSecondsScaleFactor,
containerIdWithPrefix,
)
ch <- prometheus.MustNewConstMetric(
c.RuntimeKernel,
prometheus.CounterValue,
float64(cstats.Processor.RuntimeKernel100ns)*ticksToSecondsScaleFactor,
containerIdWithPrefix,
)
if len(cstats.Network) == 0 {
log.Info("No Network Stats for container: ", containerDetails.ID)
continue
}
networkStats := cstats.Network
for _, networkInterface := range networkStats {
ch <- prometheus.MustNewConstMetric(
c.BytesReceived,
prometheus.CounterValue,
float64(networkInterface.BytesReceived),
containerIdWithPrefix, networkInterface.EndpointId,
)
ch <- prometheus.MustNewConstMetric(
c.BytesSent,
prometheus.CounterValue,
float64(networkInterface.BytesSent),
containerIdWithPrefix, networkInterface.EndpointId,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsReceived,
prometheus.CounterValue,
float64(networkInterface.PacketsReceived),
containerIdWithPrefix, networkInterface.EndpointId,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsSent,
prometheus.CounterValue,
float64(networkInterface.PacketsSent),
containerIdWithPrefix, networkInterface.EndpointId,
)
ch <- prometheus.MustNewConstMetric(
c.DroppedPacketsIncoming,
prometheus.CounterValue,
float64(networkInterface.DroppedPacketsIncoming),
containerIdWithPrefix, networkInterface.EndpointId,
)
ch <- prometheus.MustNewConstMetric(
c.DroppedPacketsOutgoing,
prometheus.CounterValue,
float64(networkInterface.DroppedPacketsOutgoing),
containerIdWithPrefix, networkInterface.EndpointId,
)
break
}
}
return nil, nil
}
func getContainerIdWithPrefix(containerDetails hcsshim.ContainerProperties) string {
switch containerDetails.Owner {
case "containerd-shim-runhcs-v1.exe":
return "containerd://" + containerDetails.ID
default:
// default to docker or if owner is not set
return "docker://" + containerDetails.ID
}
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkContainerCollector(b *testing.B) {
benchmarkCollector(b, "container", NewContainerMetricsCollector)
}

View File

@@ -1,376 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"strings"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
var deps string
// See below for 6.05 magic value
if getWindowsVersion() > 6.05 {
deps = "Processor Information"
} else {
deps = "Processor"
}
registerCollector("cpu", newCPUCollector, deps)
}
type cpuCollectorBasic struct {
CStateSecondsTotal *prometheus.Desc
TimeTotal *prometheus.Desc
InterruptsTotal *prometheus.Desc
DPCsTotal *prometheus.Desc
}
type cpuCollectorFull struct {
CStateSecondsTotal *prometheus.Desc
TimeTotal *prometheus.Desc
InterruptsTotal *prometheus.Desc
DPCsTotal *prometheus.Desc
ClockInterruptsTotal *prometheus.Desc
IdleBreakEventsTotal *prometheus.Desc
ParkingStatus *prometheus.Desc
ProcessorFrequencyMHz *prometheus.Desc
ProcessorMaxFrequencyMHz *prometheus.Desc
ProcessorPerformance *prometheus.Desc
}
// newCPUCollector constructs a new cpuCollector, appropriate for the running OS
func newCPUCollector() (Collector, error) {
const subsystem = "cpu"
version := getWindowsVersion()
// For Windows 2008 (version 6.0) or earlier we only have the "Processor"
// class. As of Windows 2008 R2 (version 6.1) the more detailed
// "Processor Information" set is available (although some of the counters
// are added in later versions, so we aren't guaranteed to get all of
// them).
// Value 6.05 was selected to split between Windows versions.
if version < 6.05 {
return &cpuCollectorBasic{
CStateSecondsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "cstate_seconds_total"),
"Time spent in low-power idle state",
[]string{"core", "state"},
nil,
),
TimeTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "time_total"),
"Time that processor spent in different modes (idle, user, system, ...)",
[]string{"core", "mode"},
nil,
),
InterruptsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "interrupts_total"),
"Total number of received and serviced hardware interrupts",
[]string{"core"},
nil,
),
DPCsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "dpcs_total"),
"Total number of received and serviced deferred procedure calls (DPCs)",
[]string{"core"},
nil,
),
}, nil
}
return &cpuCollectorFull{
CStateSecondsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "cstate_seconds_total"),
"Time spent in low-power idle state",
[]string{"core", "state"},
nil,
),
TimeTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "time_total"),
"Time that processor spent in different modes (idle, user, system, ...)",
[]string{"core", "mode"},
nil,
),
InterruptsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "interrupts_total"),
"Total number of received and serviced hardware interrupts",
[]string{"core"},
nil,
),
DPCsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "dpcs_total"),
"Total number of received and serviced deferred procedure calls (DPCs)",
[]string{"core"},
nil,
),
ClockInterruptsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "clock_interrupts_total"),
"Total number of received and serviced clock tick interrupts",
[]string{"core"},
nil,
),
IdleBreakEventsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "idle_break_events_total"),
"Total number of time processor was woken from idle",
[]string{"core"},
nil,
),
ParkingStatus: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "parking_status"),
"Parking Status represents whether a processor is parked or not",
[]string{"core"},
nil,
),
ProcessorFrequencyMHz: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "core_frequency_mhz"),
"Core frequency in megahertz",
[]string{"core"},
nil,
),
ProcessorPerformance: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "processor_performance"),
"Processor Performance is the average performance of the processor while it is executing instructions, as a percentage of the nominal performance of the processor. On some processors, Processor Performance may exceed 100%",
[]string{"core"},
nil,
),
}, nil
}
type perflibProcessor struct {
Name string
C1Transitions float64 `perflib:"C1 Transitions/sec"`
C2Transitions float64 `perflib:"C2 Transitions/sec"`
C3Transitions float64 `perflib:"C3 Transitions/sec"`
DPCRate float64 `perflib:"DPC Rate"`
DPCsQueued float64 `perflib:"DPCs Queued/sec"`
Interrupts float64 `perflib:"Interrupts/sec"`
PercentC2Time float64 `perflib:"% C1 Time"`
PercentC3Time float64 `perflib:"% C2 Time"`
PercentC1Time float64 `perflib:"% C3 Time"`
PercentDPCTime float64 `perflib:"% DPC Time"`
PercentIdleTime float64 `perflib:"% Idle Time"`
PercentInterruptTime float64 `perflib:"% Interrupt Time"`
PercentPrivilegedTime float64 `perflib:"% Privileged Time"`
PercentProcessorTime float64 `perflib:"% Processor Time"`
PercentUserTime float64 `perflib:"% User Time"`
}
func (c *cpuCollectorBasic) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
data := make([]perflibProcessor, 0)
err := unmarshalObject(ctx.perfObjects["Processor"], &data)
if err != nil {
return err
}
for _, cpu := range data {
if strings.Contains(strings.ToLower(cpu.Name), "_total") {
continue
}
core := cpu.Name
ch <- prometheus.MustNewConstMetric(
c.CStateSecondsTotal,
prometheus.CounterValue,
cpu.PercentC1Time,
core, "c1",
)
ch <- prometheus.MustNewConstMetric(
c.CStateSecondsTotal,
prometheus.CounterValue,
cpu.PercentC2Time,
core, "c2",
)
ch <- prometheus.MustNewConstMetric(
c.CStateSecondsTotal,
prometheus.CounterValue,
cpu.PercentC3Time,
core, "c3",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.PercentIdleTime,
core, "idle",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.PercentInterruptTime,
core, "interrupt",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.PercentDPCTime,
core, "dpc",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.PercentPrivilegedTime,
core, "privileged",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.PercentUserTime,
core, "user",
)
ch <- prometheus.MustNewConstMetric(
c.InterruptsTotal,
prometheus.CounterValue,
cpu.Interrupts,
core,
)
ch <- prometheus.MustNewConstMetric(
c.DPCsTotal,
prometheus.CounterValue,
cpu.DPCsQueued,
core,
)
}
return nil
}
type perflibProcessorInformation struct {
Name string
C1TimeSeconds float64 `perflib:"% C1 Time"`
C2TimeSeconds float64 `perflib:"% C2 Time"`
C3TimeSeconds float64 `perflib:"% C3 Time"`
C1TransitionsTotal float64 `perflib:"C1 Transitions/sec"`
C2TransitionsTotal float64 `perflib:"C2 Transitions/sec"`
C3TransitionsTotal float64 `perflib:"C3 Transitions/sec"`
ClockInterruptsTotal float64 `perflib:"Clock Interrupts/sec"`
DPCsQueuedTotal float64 `perflib:"DPCs Queued/sec"`
DPCTimeSeconds float64 `perflib:"% DPC Time"`
IdleBreakEventsTotal float64 `perflib:"Idle Break Events/sec"`
IdleTimeSeconds float64 `perflib:"% Idle Time"`
InterruptsTotal float64 `perflib:"Interrupts/sec"`
InterruptTimeSeconds float64 `perflib:"% Interrupt Time"`
ParkingStatus float64 `perflib:"Parking Status"`
PerformanceLimitPercent float64 `perflib:"% Performance Limit"`
PriorityTimeSeconds float64 `perflib:"% Priority Time"`
PrivilegedTimeSeconds float64 `perflib:"% Privileged Time"`
PrivilegedUtilitySeconds float64 `perflib:"% Privileged Utility"`
ProcessorFrequencyMHz float64 `perflib:"Processor Frequency"`
ProcessorPerformance float64 `perflib:"% Processor Performance"`
ProcessorTimeSeconds float64 `perflib:"% Processor Time"`
ProcessorUtilityRate float64 `perflib:"% Processor Utility"`
UserTimeSeconds float64 `perflib:"% User Time"`
}
func (c *cpuCollectorFull) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
data := make([]perflibProcessorInformation, 0)
err := unmarshalObject(ctx.perfObjects["Processor Information"], &data)
if err != nil {
return err
}
for _, cpu := range data {
if strings.Contains(strings.ToLower(cpu.Name), "_total") {
continue
}
core := cpu.Name
ch <- prometheus.MustNewConstMetric(
c.CStateSecondsTotal,
prometheus.CounterValue,
cpu.C1TimeSeconds,
core, "c1",
)
ch <- prometheus.MustNewConstMetric(
c.CStateSecondsTotal,
prometheus.CounterValue,
cpu.C2TimeSeconds,
core, "c2",
)
ch <- prometheus.MustNewConstMetric(
c.CStateSecondsTotal,
prometheus.CounterValue,
cpu.C3TimeSeconds,
core, "c3",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.IdleTimeSeconds,
core, "idle",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.InterruptTimeSeconds,
core, "interrupt",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.DPCTimeSeconds,
core, "dpc",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.PrivilegedTimeSeconds,
core, "privileged",
)
ch <- prometheus.MustNewConstMetric(
c.TimeTotal,
prometheus.CounterValue,
cpu.UserTimeSeconds,
core, "user",
)
ch <- prometheus.MustNewConstMetric(
c.InterruptsTotal,
prometheus.CounterValue,
cpu.InterruptsTotal,
core,
)
ch <- prometheus.MustNewConstMetric(
c.DPCsTotal,
prometheus.CounterValue,
cpu.DPCsQueuedTotal,
core,
)
ch <- prometheus.MustNewConstMetric(
c.ClockInterruptsTotal,
prometheus.CounterValue,
cpu.ClockInterruptsTotal,
core,
)
ch <- prometheus.MustNewConstMetric(
c.IdleBreakEventsTotal,
prometheus.CounterValue,
cpu.IdleBreakEventsTotal,
core,
)
ch <- prometheus.MustNewConstMetric(
c.ParkingStatus,
prometheus.GaugeValue,
cpu.ParkingStatus,
core,
)
ch <- prometheus.MustNewConstMetric(
c.ProcessorFrequencyMHz,
prometheus.GaugeValue,
cpu.ProcessorFrequencyMHz,
core,
)
ch <- prometheus.MustNewConstMetric(
c.ProcessorPerformance,
prometheus.GaugeValue,
cpu.ProcessorPerformance,
core,
)
}
return nil
}

View File

@@ -1,97 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"errors"
"strconv"
"strings"
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("cpu_info", newCpuInfoCollector)
}
// If you are adding additional labels to the metric, make sure that they get added in here as well. See below for explanation.
const (
win32ProcessorQuery = "SELECT Architecture, DeviceId, Description, Family, L2CacheSize, L3CacheSize, Name FROM Win32_Processor"
)
// A CpuInfoCollector is a Prometheus collector for a few WMI metrics in Win32_Processor
type CpuInfoCollector struct {
CpuInfo *prometheus.Desc
}
func newCpuInfoCollector() (Collector, error) {
return &CpuInfoCollector{
CpuInfo: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "", "cpu_info"),
"Labeled CPU information as provided provided by Win32_Processor",
[]string{
"architecture",
"device_id",
"description",
"family",
"l2_cache_size",
"l3_cache_size",
"name"},
nil,
),
}, nil
}
type win32_Processor struct {
Architecture uint32
DeviceID string
Description string
Family uint16
L2CacheSize uint32
L3CacheSize uint32
Name string
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *CpuInfoCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting cpu_info metrics:", desc, err)
return err
}
return nil
}
func (c *CpuInfoCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []win32_Processor
// We use a static query here because the provided methods in wmi.go all issue a SELECT *;
// This results in the time consuming LoadPercentage field being read which seems to measure each CPU
// serially over a 1 second interval, so the scrape time is at least 1s * num_sockets
if err := wmi.Query(win32ProcessorQuery, &dst); err != nil {
return nil, err
}
if len(dst) == 0 {
return nil, errors.New("WMI query returned empty result set")
}
// Some CPUs end up exposing trailing spaces for certain strings, so clean them up
for _, processor := range dst {
ch <- prometheus.MustNewConstMetric(
c.CpuInfo,
prometheus.GaugeValue,
1.0,
strconv.Itoa(int(processor.Architecture)),
strings.TrimRight(processor.DeviceID, " "),
strings.TrimRight(processor.Description, " "),
strconv.Itoa(int(processor.Family)),
strconv.Itoa(int(processor.L2CacheSize)),
strconv.Itoa(int(processor.L3CacheSize)),
strings.TrimRight(processor.Name, " "),
)
}
return nil, nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkCPUCollector(b *testing.B) {
benchmarkCollector(b, "cpu", newCPUCollector)
}

View File

@@ -1,108 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/prometheus-community/windows_exporter/headers/sysinfoapi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("cs", NewCSCollector)
}
// A CSCollector is a Prometheus collector for WMI metrics
type CSCollector struct {
PhysicalMemoryBytes *prometheus.Desc
LogicalProcessors *prometheus.Desc
Hostname *prometheus.Desc
}
// NewCSCollector ...
func NewCSCollector() (Collector, error) {
const subsystem = "cs"
return &CSCollector{
LogicalProcessors: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "logical_processors"),
"ComputerSystem.NumberOfLogicalProcessors",
nil,
nil,
),
PhysicalMemoryBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "physical_memory_bytes"),
"ComputerSystem.TotalPhysicalMemory",
nil,
nil,
),
Hostname: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "hostname"),
"Labeled system hostname information as provided by ComputerSystem.DNSHostName and ComputerSystem.Domain",
[]string{
"hostname",
"domain",
"fqdn"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *CSCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting cs metrics:", desc, err)
return err
}
return nil
}
func (c *CSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
// Get systeminfo for number of processors
systemInfo := sysinfoapi.GetSystemInfo()
// Get memory status for physical memory
mem, err := sysinfoapi.GlobalMemoryStatusEx()
if err != nil {
return nil, err
}
ch <- prometheus.MustNewConstMetric(
c.LogicalProcessors,
prometheus.GaugeValue,
float64(systemInfo.NumberOfProcessors),
)
ch <- prometheus.MustNewConstMetric(
c.PhysicalMemoryBytes,
prometheus.GaugeValue,
float64(mem.TotalPhys),
)
hostname, err := sysinfoapi.GetComputerName(sysinfoapi.ComputerNameDNSHostname)
if err != nil {
return nil, err
}
domain, err := sysinfoapi.GetComputerName(sysinfoapi.ComputerNameDNSDomain)
if err != nil {
return nil, err
}
fqdn, err := sysinfoapi.GetComputerName(sysinfoapi.ComputerNameDNSFullyQualified)
if err != nil {
return nil, err
}
ch <- prometheus.MustNewConstMetric(
c.Hostname,
prometheus.GaugeValue,
1.0,
hostname,
domain,
fqdn,
)
return nil, nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkCsCollector(b *testing.B) {
benchmarkCollector(b, "cs", NewCSCollector)
}

View File

@@ -1,810 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)
var dfsrEnabledCollectors = kingpin.Flag("collectors.dfsr.sources-enabled", "Comma-seperated list of DFSR Perflib sources to use.").Default("connection,folder,volume").String()
func init() {
// Perflib sources are dynamic, depending on the enabled child collectors
var perflibDependencies []string
for _, source := range expandEnabledChildCollectors(*dfsrEnabledCollectors) {
perflibDependencies = append(perflibDependencies, dfsrGetPerfObjectName(source))
}
registerCollector("dfsr", NewDFSRCollector, perflibDependencies...)
}
// DFSRCollector contains the metric and state data of the DFSR collectors.
type DFSRCollector struct {
// Connection source
ConnectionBandwidthSavingsUsingDFSReplicationTotal *prometheus.Desc
ConnectionBytesReceivedTotal *prometheus.Desc
ConnectionCompressedSizeOfFilesReceivedTotal *prometheus.Desc
ConnectionFilesReceivedTotal *prometheus.Desc
ConnectionRDCBytesReceivedTotal *prometheus.Desc
ConnectionRDCCompressedSizeOfFilesReceivedTotal *prometheus.Desc
ConnectionRDCSizeOfFilesReceivedTotal *prometheus.Desc
ConnectionRDCNumberofFilesReceivedTotal *prometheus.Desc
ConnectionSizeOfFilesReceivedTotal *prometheus.Desc
// Folder source
FolderBandwidthSavingsUsingDFSReplicationTotal *prometheus.Desc
FolderCompressedSizeOfFilesReceivedTotal *prometheus.Desc
FolderConflictBytesCleanedupTotal *prometheus.Desc
FolderConflictBytesGeneratedTotal *prometheus.Desc
FolderConflictFilesCleanedUpTotal *prometheus.Desc
FolderConflictFilesGeneratedTotal *prometheus.Desc
FolderConflictFolderCleanupsCompletedTotal *prometheus.Desc
FolderConflictSpaceInUse *prometheus.Desc
FolderDeletedSpaceInUse *prometheus.Desc
FolderDeletedBytesCleanedUpTotal *prometheus.Desc
FolderDeletedBytesGeneratedTotal *prometheus.Desc
FolderDeletedFilesCleanedUpTotal *prometheus.Desc
FolderDeletedFilesGeneratedTotal *prometheus.Desc
FolderFileInstallsRetriedTotal *prometheus.Desc
FolderFileInstallsSucceededTotal *prometheus.Desc
FolderFilesReceivedTotal *prometheus.Desc
FolderRDCBytesReceivedTotal *prometheus.Desc
FolderRDCCompressedSizeOfFilesReceivedTotal *prometheus.Desc
FolderRDCNumberofFilesReceivedTotal *prometheus.Desc
FolderRDCSizeOfFilesReceivedTotal *prometheus.Desc
FolderSizeOfFilesReceivedTotal *prometheus.Desc
FolderStagingSpaceInUse *prometheus.Desc
FolderStagingBytesCleanedUpTotal *prometheus.Desc
FolderStagingBytesGeneratedTotal *prometheus.Desc
FolderStagingFilesCleanedUpTotal *prometheus.Desc
FolderStagingFilesGeneratedTotal *prometheus.Desc
FolderUpdatesDroppedTotal *prometheus.Desc
// Volume source
VolumeDatabaseLookupsTotal *prometheus.Desc
VolumeDatabaseCommitsTotal *prometheus.Desc
VolumeUSNJournalUnreadPercentage *prometheus.Desc
VolumeUSNJournalRecordsAcceptedTotal *prometheus.Desc
VolumeUSNJournalRecordsReadTotal *prometheus.Desc
// Map of child collector functions used during collection
dfsrChildCollectors []dfsrCollectorFunc
}
type dfsrCollectorFunc func(ctx *ScrapeContext, ch chan<- prometheus.Metric) error
// Map Perflib sources to DFSR collector names
// E.G. volume -> DFS Replication Service Volumes
func dfsrGetPerfObjectName(collector string) string {
prefix := "DFS "
suffix := ""
switch collector {
case "connection":
suffix = "Replication Connections"
case "folder":
suffix = "Replicated Folders"
case "volume":
suffix = "Replication Service Volumes"
}
return (prefix + suffix)
}
// NewDFSRCollector is registered
func NewDFSRCollector() (Collector, error) {
log.Info("dfsr collector is in an experimental state! Metrics for this collector have not been tested.")
const subsystem = "dfsr"
enabled := expandEnabledChildCollectors(*dfsrEnabledCollectors)
perfCounters := make([]string, 0, len(enabled))
for _, c := range enabled {
perfCounters = append(perfCounters, dfsrGetPerfObjectName(c))
}
addPerfCounterDependencies(subsystem, perfCounters)
dfsrCollector := DFSRCollector{
// Connection
ConnectionBandwidthSavingsUsingDFSReplicationTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_bandwidth_savings_using_dfs_replication_bytes_total"),
"Total bytes of bandwidth saved using DFS Replication for this connection",
[]string{"name"},
nil,
),
ConnectionBytesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_bytes_received_total"),
"Total bytes received for connection",
[]string{"name"},
nil,
),
ConnectionCompressedSizeOfFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_compressed_size_of_files_received_bytes_total"),
"Total compressed size of files received on the connection, in bytes",
[]string{"name"},
nil,
),
ConnectionFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_received_files_total"),
"Total number of files received for connection",
[]string{"name"},
nil,
),
ConnectionRDCBytesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_rdc_received_bytes_total"),
"Total bytes received on the connection while replicating files using Remote Differential Compression",
[]string{"name"},
nil,
),
ConnectionRDCCompressedSizeOfFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_rdc_compressed_size_of_received_files_bytes_total"),
"Total uncompressed size of files received with Remote Differential Compression for connection",
[]string{"name"},
nil,
),
ConnectionRDCNumberofFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_rdc_received_files_total"),
"Total number of files received using remote differential compression",
[]string{"name"},
nil,
),
ConnectionRDCSizeOfFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_rdc_size_of_received_files_bytes_total"),
"Total size of received Remote Differential Compression files, in bytes.",
[]string{"name"},
nil,
),
ConnectionSizeOfFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "connection_files_received_bytes_total"),
"Total size of files received, in bytes",
[]string{"name"},
nil,
),
// Folder
FolderBandwidthSavingsUsingDFSReplicationTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_bandwidth_savings_using_dfs_replication_bytes_total"),
"Total bytes of bandwidth saved using DFS Replication for this folder",
[]string{"name"},
nil,
),
FolderCompressedSizeOfFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_compressed_size_of_received_files_bytes_total"),
"Total compressed size of files received on the folder, in bytes",
[]string{"name"},
nil,
),
FolderConflictBytesCleanedupTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_conflict_cleaned_up_bytes_total"),
"Total size of conflict loser files and folders deleted from the Conflict and Deleted folder, in bytes",
[]string{"name"},
nil,
),
FolderConflictBytesGeneratedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_conflict_generated_bytes_total"),
"Total size of conflict loser files and folders moved to the Conflict and Deleted folder, in bytes",
[]string{"name"},
nil,
),
FolderConflictFilesCleanedUpTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_conflict_cleaned_up_files_total"),
"Number of conflict loser files deleted from the Conflict and Deleted folder",
[]string{"name"},
nil,
),
FolderConflictFilesGeneratedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_conflict_generated_files_total"),
"Number of files and folders moved to the Conflict and Deleted folder",
[]string{"name"},
nil,
),
FolderConflictFolderCleanupsCompletedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_conflict_folder_cleanups_total"),
"Number of deletions of conflict loser files and folders in the Conflict and Deleted",
[]string{"name"},
nil,
),
FolderConflictSpaceInUse: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_conflict_space_in_use_bytes"),
"Total size of the conflict loser files and folders currently in the Conflict and Deleted folder",
[]string{"name"},
nil,
),
FolderDeletedSpaceInUse: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_deleted_space_in_use_bytes"),
"Total size (in bytes) of the deleted files and folders currently in the Conflict and Deleted folder",
[]string{"name"},
nil,
),
FolderDeletedBytesCleanedUpTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_deleted_cleaned_up_bytes_total"),
"Total size (in bytes) of replicating deleted files and folders that were cleaned up from the Conflict and Deleted folder",
[]string{"name"},
nil,
),
FolderDeletedBytesGeneratedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_deleted_generated_bytes_total"),
"Total size (in bytes) of replicated deleted files and folders that were moved to the Conflict and Deleted folder after they were deleted from a replicated folder on a sending member",
[]string{"name"},
nil,
),
FolderDeletedFilesCleanedUpTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_deleted_cleaned_up_files_total"),
"Number of files and folders that were cleaned up from the Conflict and Deleted folder",
[]string{"name"},
nil,
),
FolderDeletedFilesGeneratedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_deleted_generated_files_total"),
"Number of deleted files and folders that were moved to the Conflict and Deleted folder",
[]string{"name"},
nil,
),
FolderFileInstallsRetriedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_file_installs_retried_total"),
"Total number of file installs that are being retried due to sharing violations or other errors encountered when installing the files",
[]string{"name"},
nil,
),
FolderFileInstallsSucceededTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_file_installs_succeeded_total"),
"Total number of files that were successfully received from sending members and installed locally on this server",
[]string{"name"},
nil,
),
FolderFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_received_files_total"),
"Total number of files received",
[]string{"name"},
nil,
),
FolderRDCBytesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_rdc_received_bytes_total"),
"Total number of bytes received in replicating files using Remote Differential Compression",
[]string{"name"},
nil,
),
FolderRDCCompressedSizeOfFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_rdc_compressed_size_of_received_files_bytes_total"),
"Total compressed size (in bytes) of the files received with Remote Differential Compression",
[]string{"name"},
nil,
),
FolderRDCNumberofFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_rdc_received_files_total"),
"Total number of files received with Remote Differential Compression",
[]string{"name"},
nil,
),
FolderRDCSizeOfFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_rdc_files_received_bytes_total"),
"Total uncompressed size (in bytes) of the files received with Remote Differential Compression",
[]string{"name"},
nil,
),
FolderSizeOfFilesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_files_received_bytes_total"),
"Total uncompressed size (in bytes) of the files received",
[]string{"name"},
nil,
),
FolderStagingSpaceInUse: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_staging_space_in_use_bytes"),
"Total size of files and folders currently in the staging folder.",
[]string{"name"},
nil,
),
FolderStagingBytesCleanedUpTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_staging_cleaned_up_bytes_total"),
"Total size (in bytes) of the files and folders that have been cleaned up from the staging folder",
[]string{"name"},
nil,
),
FolderStagingBytesGeneratedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_staging_generated_bytes_total"),
"Total size (in bytes) of replicated files and folders in the staging folder created by the DFS Replication service since last restart",
[]string{"name"},
nil,
),
FolderStagingFilesCleanedUpTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_staging_cleaned_up_files_total"),
"Total number of files and folders that have been cleaned up from the staging folder",
[]string{"name"},
nil,
),
FolderStagingFilesGeneratedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_staging_generated_files_total"),
"Total number of times replicated files and folders have been staged by the DFS Replication service",
[]string{"name"},
nil,
),
FolderUpdatesDroppedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "folder_dropped_updates_total"),
"Total number of redundant file replication update records that have been ignored by the DFS Replication service because they did not change the replicated file or folder",
[]string{"name"},
nil,
),
// Volume
VolumeDatabaseCommitsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "volume_database_commits_total"),
"Total number of DFSR Volume database commits",
[]string{"name"},
nil,
),
VolumeDatabaseLookupsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "volume_database_lookups_total"),
"Total number of DFSR Volume database lookups",
[]string{"name"},
nil,
),
VolumeUSNJournalUnreadPercentage: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "volume_usn_journal_unread_percentage"),
"Percentage of DFSR Volume USN journal records that are unread",
[]string{"name"},
nil,
),
VolumeUSNJournalRecordsAcceptedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "volume_usn_journal_accepted_records_total"),
"Total number of USN journal records accepted",
[]string{"name"},
nil,
),
VolumeUSNJournalRecordsReadTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "volume_usn_journal_read_records_total"),
"Total number of DFSR Volume USN journal records read",
[]string{"name"},
nil,
),
}
dfsrCollector.dfsrChildCollectors = dfsrCollector.getDFSRChildCollectors(enabled)
return &dfsrCollector, nil
}
// Maps enabled child collectors names to their relevant collection function,
// for use in DFSRCollector.Collect()
func (c *DFSRCollector) getDFSRChildCollectors(enabledCollectors []string) []dfsrCollectorFunc {
var dfsrCollectors []dfsrCollectorFunc
for _, collector := range enabledCollectors {
switch collector {
case "connection":
dfsrCollectors = append(dfsrCollectors, c.collectConnection)
case "folder":
dfsrCollectors = append(dfsrCollectors, c.collectFolder)
case "volume":
dfsrCollectors = append(dfsrCollectors, c.collectVolume)
}
}
return dfsrCollectors
}
// Collect implements the Collector interface.
// Sends metric values for each metric to the provided prometheus Metric channel.
func (c *DFSRCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
for _, fn := range c.dfsrChildCollectors {
err := fn(ctx, ch)
if err != nil {
return err
}
}
return nil
}
// Perflib: "DFS Replication Service Connections"
type PerflibDFSRConnection struct {
Name string
BandwidthSavingsUsingDFSReplicationTotal float64 `perflib:"Bandwidth Savings Using DFS Replication"`
BytesReceivedTotal float64 `perflib:"Total Bytes Received"`
CompressedSizeOfFilesReceivedTotal float64 `perflib:"Compressed Size of Files Received"`
FilesReceivedTotal float64 `perflib:"Total Files Received"`
RDCBytesReceivedTotal float64 `perflib:"RDC Bytes Received"`
RDCCompressedSizeOfFilesReceivedTotal float64 `perflib:"RDC Compressed Size of Files Received"`
RDCNumberofFilesReceivedTotal float64 `perflib:"RDC Number of Files Received"`
RDCSizeOfFilesReceivedTotal float64 `perflib:"RDC Size of Files Received"`
SizeOfFilesReceivedTotal float64 `perflib:"Size of Files Received"`
}
func (c *DFSRCollector) collectConnection(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var dst []PerflibDFSRConnection
if err := unmarshalObject(ctx.perfObjects["DFS Replication Connections"], &dst); err != nil {
return err
}
for _, connection := range dst {
ch <- prometheus.MustNewConstMetric(
c.ConnectionBandwidthSavingsUsingDFSReplicationTotal,
prometheus.CounterValue,
connection.BandwidthSavingsUsingDFSReplicationTotal,
connection.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionBytesReceivedTotal,
prometheus.CounterValue,
connection.BytesReceivedTotal,
connection.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionCompressedSizeOfFilesReceivedTotal,
prometheus.CounterValue,
connection.CompressedSizeOfFilesReceivedTotal,
connection.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionFilesReceivedTotal,
prometheus.CounterValue,
connection.FilesReceivedTotal,
connection.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionRDCBytesReceivedTotal,
prometheus.CounterValue,
connection.RDCBytesReceivedTotal,
connection.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionRDCCompressedSizeOfFilesReceivedTotal,
prometheus.CounterValue,
connection.RDCCompressedSizeOfFilesReceivedTotal,
connection.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionRDCSizeOfFilesReceivedTotal,
prometheus.CounterValue,
connection.RDCSizeOfFilesReceivedTotal,
connection.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionRDCNumberofFilesReceivedTotal,
prometheus.CounterValue,
connection.RDCNumberofFilesReceivedTotal,
connection.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionSizeOfFilesReceivedTotal,
prometheus.CounterValue,
connection.SizeOfFilesReceivedTotal,
connection.Name,
)
}
return nil
}
// Perflib: "DFS Replicated Folder"
type PerflibDFSRFolder struct {
Name string
BandwidthSavingsUsingDFSReplicationTotal float64 `perflib:"Bandwidth Savings Using DFS Replication"`
CompressedSizeOfFilesReceivedTotal float64 `perflib:"Compressed Size of Files Received"`
ConflictBytesCleanedupTotal float64 `perflib:"Conflict Bytes Cleaned Up"`
ConflictBytesGeneratedTotal float64 `perflib:"Conflict Bytes Generated"`
ConflictFilesCleanedUpTotal float64 `perflib:"Conflict Files Cleaned Up"`
ConflictFilesGeneratedTotal float64 `perflib:"Conflict Files Generated"`
ConflictFolderCleanupsCompletedTotal float64 `perflib:"Conflict Folder Cleanups Completed"`
ConflictSpaceInUse float64 `perflib:"Conflict Space In Use"`
DeletedSpaceInUse float64 `perflib:"Deleted Space In Use"`
DeletedBytesCleanedUpTotal float64 `perflib:"Deleted Bytes Cleaned Up"`
DeletedBytesGeneratedTotal float64 `perflib:"Deleted Bytes Generated"`
DeletedFilesCleanedUpTotal float64 `perflib:"Deleted Files Cleaned Up"`
DeletedFilesGeneratedTotal float64 `perflib:"Deleted Files Generated"`
FileInstallsRetriedTotal float64 `perflib:"File Installs Retried"`
FileInstallsSucceededTotal float64 `perflib:"File Installs Succeeded"`
FilesReceivedTotal float64 `perflib:"Total Files Received"`
RDCBytesReceivedTotal float64 `perflib:"RDC Bytes Received"`
RDCCompressedSizeOfFilesReceivedTotal float64 `perflib:"RDC Compressed Size of Files Received"`
RDCNumberofFilesReceivedTotal float64 `perflib:"RDC Number of Files Received"`
RDCSizeOfFilesReceivedTotal float64 `perflib:"RDC Size of Files Received"`
SizeOfFilesReceivedTotal float64 `perflib:"Size of Files Received"`
StagingSpaceInUse float64 `perflib:"Staging Space In Use"`
StagingBytesCleanedUpTotal float64 `perflib:"Staging Bytes Cleaned Up"`
StagingBytesGeneratedTotal float64 `perflib:"Staging Bytes Generated"`
StagingFilesCleanedUpTotal float64 `perflib:"Staging Files Cleaned Up"`
StagingFilesGeneratedTotal float64 `perflib:"Staging Files Generated"`
UpdatesDroppedTotal float64 `perflib:"Updates Dropped"`
}
func (c *DFSRCollector) collectFolder(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var dst []PerflibDFSRFolder
if err := unmarshalObject(ctx.perfObjects["DFS Replicated Folders"], &dst); err != nil {
return err
}
for _, folder := range dst {
ch <- prometheus.MustNewConstMetric(
c.FolderBandwidthSavingsUsingDFSReplicationTotal,
prometheus.CounterValue,
folder.BandwidthSavingsUsingDFSReplicationTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderCompressedSizeOfFilesReceivedTotal,
prometheus.CounterValue,
folder.CompressedSizeOfFilesReceivedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderConflictBytesCleanedupTotal,
prometheus.CounterValue,
folder.ConflictBytesCleanedupTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderConflictBytesGeneratedTotal,
prometheus.CounterValue,
folder.ConflictBytesGeneratedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderConflictFilesCleanedUpTotal,
prometheus.CounterValue,
folder.ConflictFilesCleanedUpTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderConflictFilesGeneratedTotal,
prometheus.CounterValue,
folder.ConflictFilesGeneratedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderConflictFolderCleanupsCompletedTotal,
prometheus.CounterValue,
folder.ConflictFolderCleanupsCompletedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderConflictSpaceInUse,
prometheus.GaugeValue,
folder.ConflictSpaceInUse,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderDeletedSpaceInUse,
prometheus.GaugeValue,
folder.DeletedSpaceInUse,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderDeletedBytesCleanedUpTotal,
prometheus.CounterValue,
folder.DeletedBytesCleanedUpTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderDeletedBytesGeneratedTotal,
prometheus.CounterValue,
folder.DeletedBytesGeneratedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderDeletedFilesCleanedUpTotal,
prometheus.CounterValue,
folder.DeletedFilesCleanedUpTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderDeletedFilesGeneratedTotal,
prometheus.CounterValue,
folder.DeletedFilesGeneratedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderFileInstallsRetriedTotal,
prometheus.CounterValue,
folder.FileInstallsRetriedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderFileInstallsSucceededTotal,
prometheus.CounterValue,
folder.FileInstallsSucceededTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderFilesReceivedTotal,
prometheus.CounterValue,
folder.FilesReceivedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderRDCBytesReceivedTotal,
prometheus.CounterValue,
folder.RDCBytesReceivedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderRDCCompressedSizeOfFilesReceivedTotal,
prometheus.CounterValue,
folder.RDCCompressedSizeOfFilesReceivedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderRDCNumberofFilesReceivedTotal,
prometheus.CounterValue,
folder.RDCNumberofFilesReceivedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderRDCSizeOfFilesReceivedTotal,
prometheus.CounterValue,
folder.RDCSizeOfFilesReceivedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderSizeOfFilesReceivedTotal,
prometheus.CounterValue,
folder.SizeOfFilesReceivedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderStagingSpaceInUse,
prometheus.GaugeValue,
folder.StagingSpaceInUse,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderStagingBytesCleanedUpTotal,
prometheus.CounterValue,
folder.StagingBytesCleanedUpTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderStagingBytesGeneratedTotal,
prometheus.CounterValue,
folder.StagingBytesGeneratedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderStagingFilesCleanedUpTotal,
prometheus.CounterValue,
folder.StagingFilesCleanedUpTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderStagingFilesGeneratedTotal,
prometheus.CounterValue,
folder.StagingFilesGeneratedTotal,
folder.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FolderUpdatesDroppedTotal,
prometheus.CounterValue,
folder.UpdatesDroppedTotal,
folder.Name,
)
}
return nil
}
// Perflib: "DFS Replication Service Volumes"
type PerflibDFSRVolume struct {
Name string
DatabaseCommitsTotal float64 `perflib:"Database Commits"`
DatabaseLookupsTotal float64 `perflib:"Database Lookups"`
USNJournalRecordsReadTotal float64 `perflib:"USN Journal Records Read"`
USNJournalRecordsAcceptedTotal float64 `perflib:"USN Journal Records Accepted"`
USNJournalUnreadPercentage float64 `perflib:"USN Journal Records Unread Percentage"`
}
func (c *DFSRCollector) collectVolume(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var dst []PerflibDFSRVolume
if err := unmarshalObject(ctx.perfObjects["DFS Replication Service Volumes"], &dst); err != nil {
return err
}
for _, volume := range dst {
ch <- prometheus.MustNewConstMetric(
c.VolumeDatabaseLookupsTotal,
prometheus.CounterValue,
volume.DatabaseLookupsTotal,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.VolumeDatabaseCommitsTotal,
prometheus.CounterValue,
volume.DatabaseCommitsTotal,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.VolumeUSNJournalRecordsAcceptedTotal,
prometheus.CounterValue,
volume.USNJournalRecordsAcceptedTotal,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.VolumeUSNJournalRecordsReadTotal,
prometheus.CounterValue,
volume.USNJournalRecordsReadTotal,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.VolumeUSNJournalUnreadPercentage,
prometheus.GaugeValue,
volume.USNJournalUnreadPercentage,
volume.Name,
)
}
return nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkDFSRCollector(b *testing.B) {
benchmarkCollector(b, "dfsr", NewDFSRCollector)
}

View File

@@ -1,388 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("dhcp", NewDhcpCollector, "DHCP Server")
}
// A DhcpCollector is a Prometheus collector perflib DHCP metrics
type DhcpCollector struct {
PacketsReceivedTotal *prometheus.Desc
DuplicatesDroppedTotal *prometheus.Desc
PacketsExpiredTotal *prometheus.Desc
ActiveQueueLength *prometheus.Desc
ConflictCheckQueueLength *prometheus.Desc
DiscoversTotal *prometheus.Desc
OffersTotal *prometheus.Desc
RequestsTotal *prometheus.Desc
InformsTotal *prometheus.Desc
AcksTotal *prometheus.Desc
NacksTotal *prometheus.Desc
DeclinesTotal *prometheus.Desc
ReleasesTotal *prometheus.Desc
OfferQueueLength *prometheus.Desc
DeniedDueToMatch *prometheus.Desc
DeniedDueToNonMatch *prometheus.Desc
FailoverBndupdSentTotal *prometheus.Desc
FailoverBndupdReceivedTotal *prometheus.Desc
FailoverBndackSentTotal *prometheus.Desc
FailoverBndackReceivedTotal *prometheus.Desc
FailoverBndupdPendingOutboundQueue *prometheus.Desc
FailoverTransitionsCommunicationinterruptedState *prometheus.Desc
FailoverTransitionsPartnerdownState *prometheus.Desc
FailoverTransitionsRecoverState *prometheus.Desc
FailoverBndupdDropped *prometheus.Desc
}
func NewDhcpCollector() (Collector, error) {
const subsystem = "dhcp"
return &DhcpCollector{
PacketsReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_received_total"),
"Total number of packets received by the DHCP server (PacketsReceivedTotal)",
nil,
nil,
),
DuplicatesDroppedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "duplicates_dropped_total"),
"Total number of duplicate packets received by the DHCP server (DuplicatesDroppedTotal)",
nil,
nil,
),
PacketsExpiredTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_expired_total"),
"Total number of packets expired in the DHCP server message queue (PacketsExpiredTotal)",
nil,
nil,
),
ActiveQueueLength: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "active_queue_length"),
"Number of packets in the processing queue of the DHCP server (ActiveQueueLength)",
nil,
nil,
),
ConflictCheckQueueLength: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "conflict_check_queue_length"),
"Number of packets in the DHCP server queue waiting on conflict detection (ping). (ConflictCheckQueueLength)",
nil,
nil,
),
DiscoversTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "discovers_total"),
"Total DHCP Discovers received by the DHCP server (DiscoversTotal)",
nil,
nil,
),
OffersTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "offers_total"),
"Total DHCP Offers sent by the DHCP server (OffersTotal)",
nil,
nil,
),
RequestsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "requests_total"),
"Total DHCP Requests received by the DHCP server (RequestsTotal)",
nil,
nil,
),
InformsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "informs_total"),
"Total DHCP Informs received by the DHCP server (InformsTotal)",
nil,
nil,
),
AcksTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "acks_total"),
"Total DHCP Acks sent by the DHCP server (AcksTotal)",
nil,
nil,
),
NacksTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "nacks_total"),
"Total DHCP Nacks sent by the DHCP server (NacksTotal)",
nil,
nil,
),
DeclinesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "declines_total"),
"Total DHCP Declines received by the DHCP server (DeclinesTotal)",
nil,
nil,
),
ReleasesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "releases_total"),
"Total DHCP Releases received by the DHCP server (ReleasesTotal)",
nil,
nil,
),
OfferQueueLength: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "offer_queue_length"),
"Number of packets in the offer queue of the DHCP server (OfferQueueLength)",
nil,
nil,
),
DeniedDueToMatch: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "denied_due_to_match_total"),
"Total number of DHCP requests denied, based on matches from the Deny list (DeniedDueToMatch)",
nil,
nil,
),
DeniedDueToNonMatch: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "denied_due_to_nonmatch_total"),
"Total number of DHCP requests denied, based on non-matches from the Allow list (DeniedDueToNonMatch)",
nil,
nil,
),
FailoverBndupdSentTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_bndupd_sent_total"),
"Number of DHCP failover Binding Update messages sent (FailoverBndupdSentTotal)",
nil,
nil,
),
FailoverBndupdReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_bndupd_received_total"),
"Number of DHCP failover Binding Update messages received (FailoverBndupdReceivedTotal)",
nil,
nil,
),
FailoverBndackSentTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_bndack_sent_total"),
"Number of DHCP failover Binding Ack messages sent (FailoverBndackSentTotal)",
nil,
nil,
),
FailoverBndackReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_bndack_received_total"),
"Number of DHCP failover Binding Ack messages received (FailoverBndackReceivedTotal)",
nil,
nil,
),
FailoverBndupdPendingOutboundQueue: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_bndupd_pending_in_outbound_queue"),
"Number of pending outbound DHCP failover Binding Update messages (FailoverBndupdPendingOutboundQueue)",
nil,
nil,
),
FailoverTransitionsCommunicationinterruptedState: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_transitions_communicationinterrupted_state_total"),
"Total number of transitions into COMMUNICATION INTERRUPTED state (FailoverTransitionsCommunicationinterruptedState)",
nil,
nil,
),
FailoverTransitionsPartnerdownState: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_transitions_partnerdown_state_total"),
"Total number of transitions into PARTNER DOWN state (FailoverTransitionsPartnerdownState)",
nil,
nil,
),
FailoverTransitionsRecoverState: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_transitions_recover_total"),
"Total number of transitions into RECOVER state (FailoverTransitionsRecoverState)",
nil,
nil,
),
FailoverBndupdDropped: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "failover_bndupd_dropped_total"),
"Total number of DHCP faileover Binding Updates dropped (FailoverBndupdDropped)",
nil,
nil,
),
}, nil
}
// represents perflib metrics from the DHCP Server class.
// While the name of a number of perflib metrics would indicate a rate is being returned (E.G. Packets Received/sec),
// perflib instead returns a counter, hence the "Total" suffix in some of the variable names.
type dhcpPerf struct {
PacketsReceivedTotal float64 `perflib:"Packets Received/sec"`
DuplicatesDroppedTotal float64 `perflib:"Duplicates Dropped/sec"`
PacketsExpiredTotal float64 `perflib:"Packets Expired/sec"`
ActiveQueueLength float64 `perflib:"Active Queue Length"`
ConflictCheckQueueLength float64 `perflib:"Conflict Check Queue Length"`
DiscoversTotal float64 `perflib:"Discovers/sec"`
OffersTotal float64 `perflib:"Offers/sec"`
RequestsTotal float64 `perflib:"Requests/sec"`
InformsTotal float64 `perflib:"Informs/sec"`
AcksTotal float64 `perflib:"Acks/sec"`
NacksTotal float64 `perflib:"Nacks/sec"`
DeclinesTotal float64 `perflib:"Declines/sec"`
ReleasesTotal float64 `perflib:"Releases/sec"`
DeniedDueToMatch float64 `perflib:"Denied due to match."`
DeniedDueToNonMatch float64 `perflib:"Denied due to match."`
OfferQueueLength float64 `perflib:"Offer Queue Length"`
FailoverBndupdSentTotal float64 `perflib:"Failover: BndUpd sent/sec."`
FailoverBndupdReceivedTotal float64 `perflib:"Failover: BndUpd received/sec."`
FailoverBndackSentTotal float64 `perflib:"Failover: BndAck sent/sec."`
FailoverBndackReceivedTotal float64 `perflib:"Failover: BndAck received/sec."`
FailoverBndupdPendingOutboundQueue float64 `perflib:"Failover: BndUpd pending in outbound queue."`
FailoverTransitionsCommunicationinterruptedState float64 `perflib:"Failover: Transitions to COMMUNICATION-INTERRUPTED state."`
FailoverTransitionsPartnerdownState float64 `perflib:"Failover: Transitions to PARTNER-DOWN state."`
FailoverTransitionsRecoverState float64 `perflib:"Failover: Transitions to RECOVER state."`
FailoverBndupdDropped float64 `perflib:"Failover: BndUpd Dropped."`
}
func (c *DhcpCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var perflib []dhcpPerf
if err := unmarshalObject(ctx.perfObjects["DHCP Server"], &perflib); err != nil {
return err
}
ch <- prometheus.MustNewConstMetric(
c.PacketsReceivedTotal,
prometheus.CounterValue,
perflib[0].PacketsReceivedTotal,
)
ch <- prometheus.MustNewConstMetric(
c.DuplicatesDroppedTotal,
prometheus.CounterValue,
perflib[0].DuplicatesDroppedTotal,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsExpiredTotal,
prometheus.CounterValue,
perflib[0].PacketsExpiredTotal,
)
ch <- prometheus.MustNewConstMetric(
c.ActiveQueueLength,
prometheus.GaugeValue,
perflib[0].ActiveQueueLength,
)
ch <- prometheus.MustNewConstMetric(
c.ConflictCheckQueueLength,
prometheus.GaugeValue,
perflib[0].ConflictCheckQueueLength,
)
ch <- prometheus.MustNewConstMetric(
c.DiscoversTotal,
prometheus.CounterValue,
perflib[0].DiscoversTotal,
)
ch <- prometheus.MustNewConstMetric(
c.OffersTotal,
prometheus.CounterValue,
perflib[0].OffersTotal,
)
ch <- prometheus.MustNewConstMetric(
c.RequestsTotal,
prometheus.CounterValue,
perflib[0].RequestsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.InformsTotal,
prometheus.CounterValue,
perflib[0].InformsTotal,
)
ch <- prometheus.MustNewConstMetric(
c.AcksTotal,
prometheus.CounterValue,
perflib[0].AcksTotal,
)
ch <- prometheus.MustNewConstMetric(
c.NacksTotal,
prometheus.CounterValue,
perflib[0].NacksTotal,
)
ch <- prometheus.MustNewConstMetric(
c.DeclinesTotal,
prometheus.CounterValue,
perflib[0].DeclinesTotal,
)
ch <- prometheus.MustNewConstMetric(
c.ReleasesTotal,
prometheus.CounterValue,
perflib[0].ReleasesTotal,
)
ch <- prometheus.MustNewConstMetric(
c.OfferQueueLength,
prometheus.GaugeValue,
perflib[0].OfferQueueLength,
)
ch <- prometheus.MustNewConstMetric(
c.DeniedDueToMatch,
prometheus.CounterValue,
perflib[0].DeniedDueToMatch,
)
ch <- prometheus.MustNewConstMetric(
c.DeniedDueToNonMatch,
prometheus.CounterValue,
perflib[0].DeniedDueToNonMatch,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverBndupdSentTotal,
prometheus.CounterValue,
perflib[0].FailoverBndupdSentTotal,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverBndupdReceivedTotal,
prometheus.CounterValue,
perflib[0].FailoverBndupdReceivedTotal,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverBndackSentTotal,
prometheus.CounterValue,
perflib[0].FailoverBndackSentTotal,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverBndackReceivedTotal,
prometheus.CounterValue,
perflib[0].FailoverBndackReceivedTotal,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverBndupdPendingOutboundQueue,
prometheus.GaugeValue,
perflib[0].FailoverBndupdPendingOutboundQueue,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverTransitionsCommunicationinterruptedState,
prometheus.CounterValue,
perflib[0].FailoverTransitionsCommunicationinterruptedState,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverTransitionsPartnerdownState,
prometheus.CounterValue,
perflib[0].FailoverTransitionsPartnerdownState,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverTransitionsRecoverState,
prometheus.CounterValue,
perflib[0].FailoverTransitionsRecoverState,
)
ch <- prometheus.MustNewConstMetric(
c.FailoverBndupdDropped,
prometheus.CounterValue,
perflib[0].FailoverBndupdDropped,
)
return nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkDHCPCollector(b *testing.B) {
benchmarkCollector(b, "dhcp", NewDhcpCollector)
}

View File

@@ -1,499 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"errors"
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("dns", NewDNSCollector)
}
// A DNSCollector is a Prometheus collector for WMI Win32_PerfRawData_DNS_DNS metrics
type DNSCollector struct {
ZoneTransferRequestsReceived *prometheus.Desc
ZoneTransferRequestsSent *prometheus.Desc
ZoneTransferResponsesReceived *prometheus.Desc
ZoneTransferSuccessReceived *prometheus.Desc
ZoneTransferSuccessSent *prometheus.Desc
ZoneTransferFailures *prometheus.Desc
MemoryUsedBytes *prometheus.Desc
DynamicUpdatesQueued *prometheus.Desc
DynamicUpdatesReceived *prometheus.Desc
DynamicUpdatesFailures *prometheus.Desc
NotifyReceived *prometheus.Desc
NotifySent *prometheus.Desc
SecureUpdateFailures *prometheus.Desc
SecureUpdateReceived *prometheus.Desc
Queries *prometheus.Desc
Responses *prometheus.Desc
RecursiveQueries *prometheus.Desc
RecursiveQueryFailures *prometheus.Desc
RecursiveQuerySendTimeouts *prometheus.Desc
WinsQueries *prometheus.Desc
WinsResponses *prometheus.Desc
UnmatchedResponsesReceived *prometheus.Desc
}
// NewDNSCollector ...
func NewDNSCollector() (Collector, error) {
const subsystem = "dns"
return &DNSCollector{
ZoneTransferRequestsReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "zone_transfer_requests_received_total"),
"Number of zone transfer requests (AXFR/IXFR) received by the master DNS server",
[]string{"qtype"},
nil,
),
ZoneTransferRequestsSent: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "zone_transfer_requests_sent_total"),
"Number of zone transfer requests (AXFR/IXFR) sent by the secondary DNS server",
[]string{"qtype"},
nil,
),
ZoneTransferResponsesReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "zone_transfer_response_received_total"),
"Number of zone transfer responses (AXFR/IXFR) received by the secondary DNS server",
[]string{"qtype"},
nil,
),
ZoneTransferSuccessReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "zone_transfer_success_received_total"),
"Number of successful zone transfers (AXFR/IXFR) received by the secondary DNS server",
[]string{"qtype", "protocol"},
nil,
),
ZoneTransferSuccessSent: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "zone_transfer_success_sent_total"),
"Number of successful zone transfers (AXFR/IXFR) of the master DNS server",
[]string{"qtype"},
nil,
),
ZoneTransferFailures: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "zone_transfer_failures_total"),
"Number of failed zone transfers of the master DNS server",
nil,
nil,
),
MemoryUsedBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "memory_used_bytes"),
"Current memory used by DNS server",
[]string{"area"},
nil,
),
DynamicUpdatesQueued: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "dynamic_updates_queued"),
"Number of dynamic updates queued by the DNS server",
nil,
nil,
),
DynamicUpdatesReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "dynamic_updates_received_total"),
"Number of secure update requests received by the DNS server",
[]string{"operation"},
nil,
),
DynamicUpdatesFailures: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "dynamic_updates_failures_total"),
"Number of dynamic updates which timed out or were rejected by the DNS server",
[]string{"reason"},
nil,
),
NotifyReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "notify_received_total"),
"Number of notifies received by the secondary DNS server",
nil,
nil,
),
NotifySent: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "notify_sent_total"),
"Number of notifies sent by the master DNS server",
nil,
nil,
),
SecureUpdateFailures: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "secure_update_failures_total"),
"Number of secure updates that failed on the DNS server",
nil,
nil,
),
SecureUpdateReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "secure_update_received_total"),
"Number of secure update requests received by the DNS server",
nil,
nil,
),
Queries: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "queries_total"),
"Number of queries received by DNS server",
[]string{"protocol"},
nil,
),
Responses: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "responses_total"),
"Number of responses sent by DNS server",
[]string{"protocol"},
nil,
),
RecursiveQueries: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "recursive_queries_total"),
"Number of recursive queries received by DNS server",
nil,
nil,
),
RecursiveQueryFailures: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "recursive_query_failures_total"),
"Number of recursive query failures",
nil,
nil,
),
RecursiveQuerySendTimeouts: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "recursive_query_send_timeouts_total"),
"Number of recursive query sending timeouts",
nil,
nil,
),
WinsQueries: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "wins_queries_total"),
"Number of WINS lookup requests received by the server",
[]string{"direction"},
nil,
),
WinsResponses: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "wins_responses_total"),
"Number of WINS lookup responses sent by the server",
[]string{"direction"},
nil,
),
UnmatchedResponsesReceived: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "unmatched_responses_total"),
"Number of response packets received by the DNS server that do not match any outstanding remote query",
nil,
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *DNSCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting dns metrics:", desc, err)
return err
}
return nil
}
// Win32_PerfRawData_DNS_DNS docs:
// - https://msdn.microsoft.com/en-us/library/ms803992.aspx?f=255&MSPPError=-2147217396
// - https://technet.microsoft.com/en-us/library/cc977686.aspx
type Win32_PerfRawData_DNS_DNS struct {
AXFRRequestReceived uint32
AXFRRequestSent uint32
AXFRResponseReceived uint32
AXFRSuccessReceived uint32
AXFRSuccessSent uint32
CachingMemory uint32
DatabaseNodeMemory uint32
DynamicUpdateNoOperation uint32
DynamicUpdateQueued uint32
DynamicUpdateRejected uint32
DynamicUpdateTimeOuts uint32
DynamicUpdateWrittentoDatabase uint32
IXFRRequestReceived uint32
IXFRRequestSent uint32
IXFRResponseReceived uint32
IXFRSuccessSent uint32
IXFRTCPSuccessReceived uint32
IXFRUDPSuccessReceived uint32
NbstatMemory uint32
NotifyReceived uint32
NotifySent uint32
RecordFlowMemory uint32
RecursiveQueries uint32
RecursiveQueryFailure uint32
RecursiveSendTimeOuts uint32
SecureUpdateFailure uint32
SecureUpdateReceived uint32
TCPMessageMemory uint32
TCPQueryReceived uint32
TCPResponseSent uint32
UDPMessageMemory uint32
UDPQueryReceived uint32
UDPResponseSent uint32
UnmatchedResponsesReceived uint32
WINSLookupReceived uint32
WINSResponseSent uint32
WINSReverseLookupReceived uint32
WINSReverseResponseSent uint32
ZoneTransferFailure uint32
ZoneTransferSOARequestSent uint32
}
func (c *DNSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_DNS_DNS
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
if len(dst) == 0 {
return nil, errors.New("WMI query returned empty result set")
}
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferRequestsReceived,
prometheus.CounterValue,
float64(dst[0].AXFRRequestReceived),
"full",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferRequestsReceived,
prometheus.CounterValue,
float64(dst[0].IXFRRequestReceived),
"incremental",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferRequestsSent,
prometheus.CounterValue,
float64(dst[0].AXFRRequestSent),
"full",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferRequestsSent,
prometheus.CounterValue,
float64(dst[0].IXFRRequestSent),
"incremental",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferRequestsSent,
prometheus.CounterValue,
float64(dst[0].ZoneTransferSOARequestSent),
"soa",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferResponsesReceived,
prometheus.CounterValue,
float64(dst[0].AXFRResponseReceived),
"full",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferResponsesReceived,
prometheus.CounterValue,
float64(dst[0].IXFRResponseReceived),
"incremental",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferSuccessReceived,
prometheus.CounterValue,
float64(dst[0].AXFRSuccessReceived),
"full",
"tcp",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferSuccessReceived,
prometheus.CounterValue,
float64(dst[0].IXFRTCPSuccessReceived),
"incremental",
"tcp",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferSuccessReceived,
prometheus.CounterValue,
float64(dst[0].IXFRTCPSuccessReceived),
"incremental",
"udp",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferSuccessSent,
prometheus.CounterValue,
float64(dst[0].AXFRSuccessSent),
"full",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferSuccessSent,
prometheus.CounterValue,
float64(dst[0].IXFRSuccessSent),
"incremental",
)
ch <- prometheus.MustNewConstMetric(
c.ZoneTransferFailures,
prometheus.CounterValue,
float64(dst[0].ZoneTransferFailure),
)
ch <- prometheus.MustNewConstMetric(
c.MemoryUsedBytes,
prometheus.GaugeValue,
float64(dst[0].CachingMemory),
"caching",
)
ch <- prometheus.MustNewConstMetric(
c.MemoryUsedBytes,
prometheus.GaugeValue,
float64(dst[0].DatabaseNodeMemory),
"database_node",
)
ch <- prometheus.MustNewConstMetric(
c.MemoryUsedBytes,
prometheus.GaugeValue,
float64(dst[0].NbstatMemory),
"nbstat",
)
ch <- prometheus.MustNewConstMetric(
c.MemoryUsedBytes,
prometheus.GaugeValue,
float64(dst[0].RecordFlowMemory),
"record_flow",
)
ch <- prometheus.MustNewConstMetric(
c.MemoryUsedBytes,
prometheus.GaugeValue,
float64(dst[0].TCPMessageMemory),
"tcp_message",
)
ch <- prometheus.MustNewConstMetric(
c.MemoryUsedBytes,
prometheus.GaugeValue,
float64(dst[0].UDPMessageMemory),
"udp_message",
)
ch <- prometheus.MustNewConstMetric(
c.DynamicUpdatesReceived,
prometheus.CounterValue,
float64(dst[0].DynamicUpdateNoOperation),
"noop",
)
ch <- prometheus.MustNewConstMetric(
c.DynamicUpdatesReceived,
prometheus.CounterValue,
float64(dst[0].DynamicUpdateWrittentoDatabase),
"written",
)
ch <- prometheus.MustNewConstMetric(
c.DynamicUpdatesQueued,
prometheus.GaugeValue,
float64(dst[0].DynamicUpdateQueued),
)
ch <- prometheus.MustNewConstMetric(
c.DynamicUpdatesFailures,
prometheus.CounterValue,
float64(dst[0].DynamicUpdateRejected),
"rejected",
)
ch <- prometheus.MustNewConstMetric(
c.DynamicUpdatesFailures,
prometheus.CounterValue,
float64(dst[0].DynamicUpdateTimeOuts),
"timeout",
)
ch <- prometheus.MustNewConstMetric(
c.NotifyReceived,
prometheus.CounterValue,
float64(dst[0].NotifyReceived),
)
ch <- prometheus.MustNewConstMetric(
c.NotifySent,
prometheus.CounterValue,
float64(dst[0].NotifySent),
)
ch <- prometheus.MustNewConstMetric(
c.RecursiveQueries,
prometheus.CounterValue,
float64(dst[0].RecursiveQueries),
)
ch <- prometheus.MustNewConstMetric(
c.RecursiveQueryFailures,
prometheus.CounterValue,
float64(dst[0].RecursiveQueryFailure),
)
ch <- prometheus.MustNewConstMetric(
c.RecursiveQuerySendTimeouts,
prometheus.CounterValue,
float64(dst[0].RecursiveSendTimeOuts),
)
ch <- prometheus.MustNewConstMetric(
c.Queries,
prometheus.CounterValue,
float64(dst[0].TCPQueryReceived),
"tcp",
)
ch <- prometheus.MustNewConstMetric(
c.Queries,
prometheus.CounterValue,
float64(dst[0].UDPQueryReceived),
"udp",
)
ch <- prometheus.MustNewConstMetric(
c.Responses,
prometheus.CounterValue,
float64(dst[0].TCPResponseSent),
"tcp",
)
ch <- prometheus.MustNewConstMetric(
c.Responses,
prometheus.CounterValue,
float64(dst[0].UDPResponseSent),
"udp",
)
ch <- prometheus.MustNewConstMetric(
c.UnmatchedResponsesReceived,
prometheus.CounterValue,
float64(dst[0].UnmatchedResponsesReceived),
)
ch <- prometheus.MustNewConstMetric(
c.WinsQueries,
prometheus.CounterValue,
float64(dst[0].WINSLookupReceived),
"forward",
)
ch <- prometheus.MustNewConstMetric(
c.WinsQueries,
prometheus.CounterValue,
float64(dst[0].WINSReverseLookupReceived),
"reverse",
)
ch <- prometheus.MustNewConstMetric(
c.WinsResponses,
prometheus.CounterValue,
float64(dst[0].WINSResponseSent),
"forward",
)
ch <- prometheus.MustNewConstMetric(
c.WinsResponses,
prometheus.CounterValue,
float64(dst[0].WINSReverseResponseSent),
"reverse",
)
ch <- prometheus.MustNewConstMetric(
c.SecureUpdateFailures,
prometheus.CounterValue,
float64(dst[0].SecureUpdateFailure),
)
ch <- prometheus.MustNewConstMetric(
c.SecureUpdateReceived,
prometheus.CounterValue,
float64(dst[0].SecureUpdateReceived),
)
return nil, nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkDNSCollector(b *testing.B) {
benchmarkCollector(b, "dns", NewDNSCollector)
}

View File

@@ -1,634 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"fmt"
"os"
"strings"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)
func init() {
registerCollector("exchange", newExchangeCollector,
"MSExchange ADAccess Processes",
"MSExchangeTransport Queues",
"MSExchange HttpProxy",
"MSExchange ActiveSync",
"MSExchange Availability Service",
"MSExchange OWA",
"MSExchangeAutodiscover",
"MSExchange WorkloadManagement Workloads",
"MSExchange RpcClientAccess",
)
}
type exchangeCollector struct {
LDAPReadTime *prometheus.Desc
LDAPSearchTime *prometheus.Desc
LDAPWriteTime *prometheus.Desc
LDAPTimeoutErrorsPerSec *prometheus.Desc
LongRunningLDAPOperationsPerMin *prometheus.Desc
ExternalActiveRemoteDeliveryQueueLength *prometheus.Desc
InternalActiveRemoteDeliveryQueueLength *prometheus.Desc
ActiveMailboxDeliveryQueueLength *prometheus.Desc
RetryMailboxDeliveryQueueLength *prometheus.Desc
UnreachableQueueLength *prometheus.Desc
ExternalLargestDeliveryQueueLength *prometheus.Desc
InternalLargestDeliveryQueueLength *prometheus.Desc
PoisonQueueLength *prometheus.Desc
MailboxServerLocatorAverageLatency *prometheus.Desc
AverageAuthenticationLatency *prometheus.Desc
AverageCASProcessingLatency *prometheus.Desc
MailboxServerProxyFailureRate *prometheus.Desc
OutstandingProxyRequests *prometheus.Desc
ProxyRequestsPerSec *prometheus.Desc
ActiveSyncRequestsPerSec *prometheus.Desc
PingCommandsPending *prometheus.Desc
SyncCommandsPerSec *prometheus.Desc
AvailabilityRequestsSec *prometheus.Desc
CurrentUniqueUsers *prometheus.Desc
OWARequestsPerSec *prometheus.Desc
AutodiscoverRequestsPerSec *prometheus.Desc
ActiveTasks *prometheus.Desc
CompletedTasks *prometheus.Desc
QueuedTasks *prometheus.Desc
YieldedTasks *prometheus.Desc
IsActive *prometheus.Desc
RPCAveragedLatency *prometheus.Desc
RPCRequests *prometheus.Desc
ActiveUserCount *prometheus.Desc
ConnectionCount *prometheus.Desc
RPCOperationsPerSec *prometheus.Desc
UserCount *prometheus.Desc
enabledCollectors []string
}
var (
// All available collector functions
exchangeAllCollectorNames = []string{
"ADAccessProcesses",
"TransportQueues",
"HttpProxy",
"ActiveSync",
"AvailabilityService",
"OutlookWebAccess",
"Autodiscover",
"WorkloadManagement",
"RpcClientAccess",
}
argExchangeListAllCollectors = kingpin.Flag(
"collectors.exchange.list",
"List the collectors along with their perflib object name/ids",
).Bool()
argExchangeCollectorsEnabled = kingpin.Flag(
"collectors.exchange.enabled",
"Comma-separated list of collectors to use. Defaults to all, if not specified.",
).Default("").String()
)
// newExchangeCollector returns a new Collector
func newExchangeCollector() (Collector, error) {
// desc creates a new prometheus description
desc := func(metricName string, description string, labels ...string) *prometheus.Desc {
return prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "exchange", metricName),
description,
labels,
nil,
)
}
c := exchangeCollector{
RPCAveragedLatency: desc("rpc_avg_latency_sec", "The latency (sec), averaged for the past 1024 packets"),
RPCRequests: desc("rpc_requests", "Number of client requests currently being processed by the RPC Client Access service"),
ActiveUserCount: desc("rpc_active_user_count", "Number of unique users that have shown some kind of activity in the last 2 minutes"),
ConnectionCount: desc("rpc_connection_count", "Total number of client connections maintained"),
RPCOperationsPerSec: desc("rpc_operations_total", "The rate at which RPC operations occur"),
UserCount: desc("rpc_user_count", "Number of users"),
LDAPReadTime: desc("ldap_read_time_sec", "Time (sec) to send an LDAP read request and receive a response", "name"),
LDAPSearchTime: desc("ldap_search_time_sec", "Time (sec) to send an LDAP search request and receive a response", "name"),
LDAPWriteTime: desc("ldap_write_time_sec", "Time (sec) to send an LDAP Add/Modify/Delete request and receive a response", "name"),
LDAPTimeoutErrorsPerSec: desc("ldap_timeout_errors_total", "Total number of LDAP timeout errors", "name"),
LongRunningLDAPOperationsPerMin: desc("ldap_long_running_ops_per_sec", "Long Running LDAP operations per second", "name"),
ExternalActiveRemoteDeliveryQueueLength: desc("transport_queues_external_active_remote_delivery", "External Active Remote Delivery Queue length", "name"),
InternalActiveRemoteDeliveryQueueLength: desc("transport_queues_internal_active_remote_delivery", "Internal Active Remote Delivery Queue length", "name"),
ActiveMailboxDeliveryQueueLength: desc("transport_queues_active_mailbox_delivery", "Active Mailbox Delivery Queue length", "name"),
RetryMailboxDeliveryQueueLength: desc("transport_queues_retry_mailbox_delivery", "Retry Mailbox Delivery Queue length", "name"),
UnreachableQueueLength: desc("transport_queues_unreachable", "Unreachable Queue length", "name"),
ExternalLargestDeliveryQueueLength: desc("transport_queues_external_largest_delivery", "External Largest Delivery Queue length", "name"),
InternalLargestDeliveryQueueLength: desc("transport_queues_internal_largest_delivery", "Internal Largest Delivery Queue length", "name"),
PoisonQueueLength: desc("transport_queues_poison", "Poison Queue length", "name"),
MailboxServerLocatorAverageLatency: desc("http_proxy_mailbox_server_locator_avg_latency_sec", "Average latency (sec) of MailboxServerLocator web service calls", "name"),
AverageAuthenticationLatency: desc("http_proxy_avg_auth_latency", "Average time spent authenticating CAS requests over the last 200 samples", "name"),
OutstandingProxyRequests: desc("http_proxy_outstanding_proxy_requests", "Number of concurrent outstanding proxy requests", "name"),
ProxyRequestsPerSec: desc("http_proxy_requests_total", "Number of proxy requests processed each second", "name"),
AvailabilityRequestsSec: desc("avail_service_requests_per_sec", "Number of requests serviced per second"),
CurrentUniqueUsers: desc("owa_current_unique_users", "Number of unique users currently logged on to Outlook Web App"),
OWARequestsPerSec: desc("owa_requests_total", "Number of requests handled by Outlook Web App per second"),
AutodiscoverRequestsPerSec: desc("autodiscover_requests_total", "Number of autodiscover service requests processed each second"),
ActiveTasks: desc("workload_active_tasks", "Number of active tasks currently running in the background for workload management", "name"),
CompletedTasks: desc("workload_completed_tasks", "Number of workload management tasks that have been completed", "name"),
QueuedTasks: desc("workload_queued_tasks", "Number of workload management tasks that are currently queued up waiting to be processed", "name"),
YieldedTasks: desc("workload_yielded_tasks", "The total number of tasks that have been yielded by a workload", "name"),
IsActive: desc("workload_is_active", "Active indicates whether the workload is in an active (1) or paused (0) state", "name"),
ActiveSyncRequestsPerSec: desc("activesync_requests_total", "Num HTTP requests received from the client via ASP.NET per sec. Shows Current user load"),
AverageCASProcessingLatency: desc("http_proxy_avg_cas_proccessing_latency_sec", "Average latency (sec) of CAS processing time over the last 200 reqs", "name"),
MailboxServerProxyFailureRate: desc("http_proxy_mailbox_proxy_failure_rate", "% of failures between this CAS and MBX servers over the last 200 samples", "name"),
PingCommandsPending: desc("activesync_ping_cmds_pending", "Number of ping commands currently pending in the queue"),
SyncCommandsPerSec: desc("activesync_sync_cmds_total", "Number of sync commands processed per second. Clients use this command to synchronize items within a folder"),
enabledCollectors: make([]string, 0, len(exchangeAllCollectorNames)),
}
collectorDesc := map[string]string{
"ADAccessProcesses": "[19108] MSExchange ADAccess Processes",
"TransportQueues": "[20524] MSExchangeTransport Queues",
"HttpProxy": "[36934] MSExchange HttpProxy",
"ActiveSync": "[25138] MSExchange ActiveSync",
"AvailabilityService": "[24914] MSExchange Availability Service",
"OutlookWebAccess": "[24618] MSExchange OWA",
"Autodiscover": "[29240] MSExchange Autodiscover",
"WorkloadManagement": "[19430] MSExchange WorkloadManagement Workloads",
"RpcClientAccess": "[29336] MSExchange RpcClientAccess",
}
if *argExchangeListAllCollectors {
fmt.Printf("%-32s %-32s\n", "Collector Name", "[PerfID] Perflib Object")
for _, cname := range exchangeAllCollectorNames {
fmt.Printf("%-32s %-32s\n", cname, collectorDesc[cname])
}
os.Exit(0)
}
if *argExchangeCollectorsEnabled == "" {
for _, collectorName := range exchangeAllCollectorNames {
c.enabledCollectors = append(c.enabledCollectors, collectorName)
}
} else {
for _, collectorName := range strings.Split(*argExchangeCollectorsEnabled, ",") {
if find(exchangeAllCollectorNames, collectorName) {
c.enabledCollectors = append(c.enabledCollectors, collectorName)
} else {
return nil, fmt.Errorf("Unknown exchange collector: %s", collectorName)
}
}
}
return &c, nil
}
// Collect collects exchange metrics and sends them to prometheus
func (c *exchangeCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
collectorFuncs := map[string]func(ctx *ScrapeContext, ch chan<- prometheus.Metric) error{
"ADAccessProcesses": c.collectADAccessProcesses,
"TransportQueues": c.collectTransportQueues,
"HttpProxy": c.collectHTTPProxy,
"ActiveSync": c.collectActiveSync,
"AvailabilityService": c.collectAvailabilityService,
"OutlookWebAccess": c.collectOWA,
"Autodiscover": c.collectAutoDiscover,
"WorkloadManagement": c.collectWorkloadManagementWorkloads,
"RpcClientAccess": c.collectRPC,
}
for _, collectorName := range c.enabledCollectors {
if err := collectorFuncs[collectorName](ctx, ch); err != nil {
log.Errorf("Error in %s: %s", collectorName, err)
return err
}
}
return nil
}
// Perflib: [19108] MSExchange ADAccess Processes
type perflibADAccessProcesses struct {
Name string
LDAPReadTime float64 `perflib:"LDAP Read Time"`
LDAPSearchTime float64 `perflib:"LDAP Search Time"`
LDAPWriteTime float64 `perflib:"LDAP Write Time"`
LDAPTimeoutErrorsPerSec float64 `perflib:"LDAP Timeout Errors/sec"`
LongRunningLDAPOperationsPerMin float64 `perflib:"Long Running LDAP Operations/min"`
}
func (c *exchangeCollector) collectADAccessProcesses(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibADAccessProcesses
if err := unmarshalObject(ctx.perfObjects["MSExchange ADAccess Processes"], &data); err != nil {
return err
}
labelUseCount := make(map[string]int)
for _, proc := range data {
labelName := c.toLabelName(proc.Name)
if strings.HasSuffix(labelName, "_total") {
continue
}
// since we're not including the PID suffix from the instance names in the label names,
// we get an occasional duplicate. This seems to affect about 4 instances only on this object.
labelUseCount[labelName]++
if labelUseCount[labelName] > 1 {
labelName = fmt.Sprintf("%s_%d", labelName, labelUseCount[labelName])
}
ch <- prometheus.MustNewConstMetric(
c.LDAPReadTime,
prometheus.CounterValue,
c.msToSec(proc.LDAPReadTime),
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.LDAPSearchTime,
prometheus.CounterValue,
c.msToSec(proc.LDAPSearchTime),
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.LDAPWriteTime,
prometheus.CounterValue,
c.msToSec(proc.LDAPWriteTime),
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.LDAPTimeoutErrorsPerSec,
prometheus.CounterValue,
proc.LDAPTimeoutErrorsPerSec,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.LongRunningLDAPOperationsPerMin,
prometheus.CounterValue,
proc.LongRunningLDAPOperationsPerMin*60,
labelName,
)
}
return nil
}
// Perflib: [24914] MSExchange Availability Service
type perflibAvailabilityService struct {
RequestsSec float64 `perflib:"Availability Requests (sec)"`
}
func (c *exchangeCollector) collectAvailabilityService(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibAvailabilityService
if err := unmarshalObject(ctx.perfObjects["MSExchange Availability Service"], &data); err != nil {
return err
}
for _, availservice := range data {
ch <- prometheus.MustNewConstMetric(
c.AvailabilityRequestsSec,
prometheus.CounterValue,
availservice.RequestsSec,
)
}
return nil
}
// Perflib: [36934] MSExchange HttpProxy
type perflibHTTPProxy struct {
Name string
MailboxServerLocatorAverageLatency float64 `perflib:"MailboxServerLocator Average Latency (Moving Average)"`
AverageAuthenticationLatency float64 `perflib:"Average Authentication Latency"`
AverageCASProcessingLatency float64 `perflib:"Average ClientAccess Server Processing Latency"`
MailboxServerProxyFailureRate float64 `perflib:"Mailbox Server Proxy Failure Rate"`
OutstandingProxyRequests float64 `perflib:"Outstanding Proxy Requests"`
ProxyRequestsPerSec float64 `perflib:"Proxy Requests/Sec"`
}
func (c *exchangeCollector) collectHTTPProxy(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibHTTPProxy
if err := unmarshalObject(ctx.perfObjects["MSExchange HttpProxy"], &data); err != nil {
return err
}
for _, instance := range data {
labelName := c.toLabelName(instance.Name)
ch <- prometheus.MustNewConstMetric(
c.MailboxServerLocatorAverageLatency,
prometheus.GaugeValue,
c.msToSec(instance.MailboxServerLocatorAverageLatency),
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.AverageAuthenticationLatency,
prometheus.GaugeValue,
instance.AverageAuthenticationLatency,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.AverageCASProcessingLatency,
prometheus.GaugeValue,
c.msToSec(instance.AverageCASProcessingLatency),
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.MailboxServerProxyFailureRate,
prometheus.GaugeValue,
instance.MailboxServerProxyFailureRate,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.OutstandingProxyRequests,
prometheus.GaugeValue,
instance.OutstandingProxyRequests,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.ProxyRequestsPerSec,
prometheus.CounterValue,
instance.ProxyRequestsPerSec,
labelName,
)
}
return nil
}
// Perflib: [24618] MSExchange OWA
type perflibOWA struct {
CurrentUniqueUsers float64 `perflib:"Current Unique Users"`
RequestsPerSec float64 `perflib:"Requests/sec"`
}
func (c *exchangeCollector) collectOWA(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibOWA
if err := unmarshalObject(ctx.perfObjects["MSExchange OWA"], &data); err != nil {
return err
}
for _, owa := range data {
ch <- prometheus.MustNewConstMetric(
c.CurrentUniqueUsers,
prometheus.GaugeValue,
owa.CurrentUniqueUsers,
)
ch <- prometheus.MustNewConstMetric(
c.OWARequestsPerSec,
prometheus.CounterValue,
owa.RequestsPerSec,
)
}
return nil
}
// Perflib: [25138] MSExchange ActiveSync
type perflibActiveSync struct {
RequestsPerSec float64 `perflib:"Requests/sec"`
PingCommandsPending float64 `perflib:"Ping Commands Pending"`
SyncCommandsPerSec float64 `perflib:"Sync Commands/sec"`
}
func (c *exchangeCollector) collectActiveSync(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibActiveSync
if err := unmarshalObject(ctx.perfObjects["MSExchange ActiveSync"], &data); err != nil {
return err
}
for _, instance := range data {
ch <- prometheus.MustNewConstMetric(
c.ActiveSyncRequestsPerSec,
prometheus.CounterValue,
instance.RequestsPerSec,
)
ch <- prometheus.MustNewConstMetric(
c.PingCommandsPending,
prometheus.GaugeValue,
instance.PingCommandsPending,
)
ch <- prometheus.MustNewConstMetric(
c.SyncCommandsPerSec,
prometheus.CounterValue,
instance.SyncCommandsPerSec,
)
}
return nil
}
// Perflib: [29366] MSExchange RpcClientAccess
type perflibRPCClientAccess struct {
RPCAveragedLatency float64 `perflib:"RPC Averaged Latency"`
RPCRequests float64 `perflib:"RPC Requests"`
ActiveUserCount float64 `perflib:"Active User Count"`
ConnectionCount float64 `perflib:"Connection Count"`
RPCOperationsPerSec float64 `perflib:"RPC Operations/sec"`
UserCount float64 `perflib:"User Count"`
}
func (c *exchangeCollector) collectRPC(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibRPCClientAccess
if err := unmarshalObject(ctx.perfObjects["MSExchange RpcClientAccess"], &data); err != nil {
return err
}
for _, rpc := range data {
ch <- prometheus.MustNewConstMetric(
c.RPCAveragedLatency,
prometheus.GaugeValue,
c.msToSec(rpc.RPCAveragedLatency),
)
ch <- prometheus.MustNewConstMetric(
c.RPCRequests,
prometheus.GaugeValue,
rpc.RPCRequests,
)
ch <- prometheus.MustNewConstMetric(
c.ActiveUserCount,
prometheus.GaugeValue,
rpc.ActiveUserCount,
)
ch <- prometheus.MustNewConstMetric(
c.ConnectionCount,
prometheus.GaugeValue,
rpc.ConnectionCount,
)
ch <- prometheus.MustNewConstMetric(
c.RPCOperationsPerSec,
prometheus.CounterValue,
rpc.RPCOperationsPerSec,
)
ch <- prometheus.MustNewConstMetric(
c.UserCount,
prometheus.GaugeValue,
rpc.UserCount,
)
}
return nil
}
// Perflib: [20524] MSExchangeTransport Queues
type perflibTransportQueues struct {
Name string
ExternalActiveRemoteDeliveryQueueLength float64 `perflib:"External Active Remote Delivery Queue Length"`
InternalActiveRemoteDeliveryQueueLength float64 `perflib:"Internal Active Remote Delivery Queue Length"`
ActiveMailboxDeliveryQueueLength float64 `perflib:"Active Mailbox Delivery Queue Length"`
RetryMailboxDeliveryQueueLength float64 `perflib:"Retry Mailbox Delivery Queue Length"`
UnreachableQueueLength float64 `perflib:"Unreachable Queue Length"`
ExternalLargestDeliveryQueueLength float64 `perflib:"External Largest Delivery Queue Length"`
InternalLargestDeliveryQueueLength float64 `perflib:"Internal Largest Delivery Queue Length"`
PoisonQueueLength float64 `perflib:"Poison Queue Length"`
}
func (c *exchangeCollector) collectTransportQueues(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibTransportQueues
if err := unmarshalObject(ctx.perfObjects["MSExchangeTransport Queues"], &data); err != nil {
return err
}
for _, queue := range data {
labelName := c.toLabelName(queue.Name)
if strings.HasSuffix(labelName, "_total") {
continue
}
ch <- prometheus.MustNewConstMetric(
c.ExternalActiveRemoteDeliveryQueueLength,
prometheus.GaugeValue,
queue.ExternalActiveRemoteDeliveryQueueLength,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.InternalActiveRemoteDeliveryQueueLength,
prometheus.GaugeValue,
queue.InternalActiveRemoteDeliveryQueueLength,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.ActiveMailboxDeliveryQueueLength,
prometheus.GaugeValue,
queue.ActiveMailboxDeliveryQueueLength,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.RetryMailboxDeliveryQueueLength,
prometheus.GaugeValue,
queue.RetryMailboxDeliveryQueueLength,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.UnreachableQueueLength,
prometheus.GaugeValue,
queue.UnreachableQueueLength,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.ExternalLargestDeliveryQueueLength,
prometheus.GaugeValue,
queue.ExternalLargestDeliveryQueueLength,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.InternalLargestDeliveryQueueLength,
prometheus.GaugeValue,
queue.InternalLargestDeliveryQueueLength,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.PoisonQueueLength,
prometheus.GaugeValue,
queue.PoisonQueueLength,
labelName,
)
}
return nil
}
// Perflib: [19430] MSExchange WorkloadManagement Workloads
type perflibWorkloadManagementWorkloads struct {
Name string
ActiveTasks float64 `perflib:"ActiveTasks"`
CompletedTasks float64 `perflib:"CompletedTasks"`
QueuedTasks float64 `perflib:"QueuedTasks"`
YieldedTasks float64 `perflib:"YieldedTasks"`
IsActive float64 `perflib:"Active"`
}
func (c *exchangeCollector) collectWorkloadManagementWorkloads(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibWorkloadManagementWorkloads
if err := unmarshalObject(ctx.perfObjects["MSExchange WorkloadManagement Workloads"], &data); err != nil {
return err
}
for _, instance := range data {
labelName := c.toLabelName(instance.Name)
if strings.HasSuffix(labelName, "_total") {
continue
}
ch <- prometheus.MustNewConstMetric(
c.ActiveTasks,
prometheus.GaugeValue,
instance.ActiveTasks,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.CompletedTasks,
prometheus.CounterValue,
instance.CompletedTasks,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.QueuedTasks,
prometheus.CounterValue,
instance.QueuedTasks,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.YieldedTasks,
prometheus.CounterValue,
instance.YieldedTasks,
labelName,
)
ch <- prometheus.MustNewConstMetric(
c.IsActive,
prometheus.GaugeValue,
instance.IsActive,
labelName,
)
}
return nil
}
// [29240] MSExchangeAutodiscover
type perflibAutodiscover struct {
RequestsPerSec float64 `perflib:"Requests/sec"`
}
func (c *exchangeCollector) collectAutoDiscover(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
var data []perflibAutodiscover
if err := unmarshalObject(ctx.perfObjects["MSExchangeAutodiscover"], &data); err != nil {
return err
}
for _, autodisc := range data {
ch <- prometheus.MustNewConstMetric(
c.AutodiscoverRequestsPerSec,
prometheus.CounterValue,
autodisc.RequestsPerSec,
)
}
return nil
}
// toLabelName converts strings to lowercase and replaces all whitespace and dots with underscores
func (c *exchangeCollector) toLabelName(name string) string {
s := strings.ReplaceAll(strings.Join(strings.Fields(strings.ToLower(name)), "_"), ".", "_")
s = strings.ReplaceAll(s, "__", "_")
return s
}
// msToSec converts from ms to seconds
func (c *exchangeCollector) msToSec(t float64) float64 {
return t / 1000
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkExchangeCollector(b *testing.B) {
benchmarkCollector(b, "exchange", newExchangeCollector)
}

View File

@@ -1,187 +0,0 @@
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("fsrmquota", newFSRMQuotaCollector)
}
type FSRMQuotaCollector struct {
QuotasCount *prometheus.Desc
Path *prometheus.Desc
PeakUsage *prometheus.Desc
Size *prometheus.Desc
Usage *prometheus.Desc
Description *prometheus.Desc
Disabled *prometheus.Desc
MatchesTemplate *prometheus.Desc
SoftLimit *prometheus.Desc
Template *prometheus.Desc
}
func newFSRMQuotaCollector() (Collector, error) {
const subsystem = "fsrmquota"
return &FSRMQuotaCollector{
QuotasCount: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "count"),
"Number of Quotas",
nil,
nil,
),
PeakUsage: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "peak_usage_bytes"),
"The highest amount of disk space usage charged to this quota. (PeakUsage)",
[]string{"path", "template"},
nil,
),
Size: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "size_bytes"),
"The size of the quota. (Size)",
[]string{"path", "template"},
nil,
),
Usage: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "usage_bytes"),
"The current amount of disk space usage charged to this quota. (Usage)",
[]string{"path", "template"},
nil,
),
Description: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "description"),
"Description of the quota (Description)",
[]string{"path", "template", "description"},
nil,
),
Disabled: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "disabled"),
"If 1, the quota is disabled. The default value is 0. (Disabled)",
[]string{"path", "template"},
nil,
),
SoftLimit: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "softlimit"),
"If 1, the quota is a soft limit. If 0, the quota is a hard limit. The default value is 0. Optional (SoftLimit)",
[]string{"path", "template"},
nil,
),
Template: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "template"),
"Quota template name. (Template)",
[]string{"path", "template"},
nil,
),
MatchesTemplate: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "matchestemplate"),
"If 1, the property values of this quota match those values of the template from which it was derived. (MatchesTemplate)",
[]string{"path", "template"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *FSRMQuotaCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting fsrmquota metrics:", desc, err)
return err
}
return nil
}
// MSFT_FSRMQuota docs:
// https://docs.microsoft.com/en-us/previous-versions/windows/desktop/fsrm/msft-fsrmquota
type MSFT_FSRMQuota struct {
Name string
Path string
PeakUsage uint64
Size uint64
Usage uint64
Description string
Template string
//Threshold string
Disabled bool
MatchesTemplate bool
SoftLimit bool
}
func (c *FSRMQuotaCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []MSFT_FSRMQuota
q := queryAll(&dst)
var count int
if err := wmi.QueryNamespace(q, &dst, "root/microsoft/windows/fsrm"); err != nil {
return nil, err
}
for _, quota := range dst {
count++
path := quota.Path
template := quota.Template
Description := quota.Description
ch <- prometheus.MustNewConstMetric(
c.PeakUsage,
prometheus.GaugeValue,
float64(quota.PeakUsage),
path,
template,
)
ch <- prometheus.MustNewConstMetric(
c.Size,
prometheus.GaugeValue,
float64(quota.Size),
path,
template,
)
ch <- prometheus.MustNewConstMetric(
c.Usage,
prometheus.GaugeValue,
float64(quota.Usage),
path,
template,
)
ch <- prometheus.MustNewConstMetric(
c.Description,
prometheus.GaugeValue,
1.0,
path, template, Description,
)
ch <- prometheus.MustNewConstMetric(
c.Disabled,
prometheus.GaugeValue,
boolToFloat(quota.Disabled),
path,
template,
)
ch <- prometheus.MustNewConstMetric(
c.MatchesTemplate,
prometheus.GaugeValue,
boolToFloat(quota.MatchesTemplate),
path,
template,
)
ch <- prometheus.MustNewConstMetric(
c.SoftLimit,
prometheus.GaugeValue,
boolToFloat(quota.SoftLimit),
path,
template,
)
}
ch <- prometheus.MustNewConstMetric(
c.QuotasCount,
prometheus.GaugeValue,
float64(count),
)
return nil, nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkFsrmQuotaCollector(b *testing.B) {
benchmarkCollector(b, "fsrmquota", newFSRMQuotaCollector)
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkHypervCollector(b *testing.B) {
benchmarkCollector(b, "hyperv", NewHyperVCollector)
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkIISCollector(b *testing.B) {
benchmarkCollector(b, "iis", NewIISCollector)
}

View File

@@ -1,303 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"fmt"
"regexp"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)
func init() {
registerCollector("logical_disk", NewLogicalDiskCollector, "LogicalDisk")
}
var (
volumeWhitelist = kingpin.Flag(
"collector.logical_disk.volume-whitelist",
"Regexp of volumes to whitelist. Volume name must both match whitelist and not match blacklist to be included.",
).Default(".+").String()
volumeBlacklist = kingpin.Flag(
"collector.logical_disk.volume-blacklist",
"Regexp of volumes to blacklist. Volume name must both match whitelist and not match blacklist to be included.",
).Default("").String()
)
// A LogicalDiskCollector is a Prometheus collector for perflib logicalDisk metrics
type LogicalDiskCollector struct {
RequestsQueued *prometheus.Desc
ReadBytesTotal *prometheus.Desc
ReadsTotal *prometheus.Desc
WriteBytesTotal *prometheus.Desc
WritesTotal *prometheus.Desc
ReadTime *prometheus.Desc
WriteTime *prometheus.Desc
TotalSpace *prometheus.Desc
FreeSpace *prometheus.Desc
IdleTime *prometheus.Desc
SplitIOs *prometheus.Desc
ReadLatency *prometheus.Desc
WriteLatency *prometheus.Desc
ReadWriteLatency *prometheus.Desc
volumeWhitelistPattern *regexp.Regexp
volumeBlacklistPattern *regexp.Regexp
}
// NewLogicalDiskCollector ...
func NewLogicalDiskCollector() (Collector, error) {
const subsystem = "logical_disk"
return &LogicalDiskCollector{
RequestsQueued: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "requests_queued"),
"The number of requests queued to the disk (LogicalDisk.CurrentDiskQueueLength)",
[]string{"volume"},
nil,
),
ReadBytesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "read_bytes_total"),
"The number of bytes transferred from the disk during read operations (LogicalDisk.DiskReadBytesPerSec)",
[]string{"volume"},
nil,
),
ReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "reads_total"),
"The number of read operations on the disk (LogicalDisk.DiskReadsPerSec)",
[]string{"volume"},
nil,
),
WriteBytesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "write_bytes_total"),
"The number of bytes transferred to the disk during write operations (LogicalDisk.DiskWriteBytesPerSec)",
[]string{"volume"},
nil,
),
WritesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "writes_total"),
"The number of write operations on the disk (LogicalDisk.DiskWritesPerSec)",
[]string{"volume"},
nil,
),
ReadTime: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "read_seconds_total"),
"Seconds that the disk was busy servicing read requests (LogicalDisk.PercentDiskReadTime)",
[]string{"volume"},
nil,
),
WriteTime: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "write_seconds_total"),
"Seconds that the disk was busy servicing write requests (LogicalDisk.PercentDiskWriteTime)",
[]string{"volume"},
nil,
),
FreeSpace: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "free_bytes"),
"Free space in bytes, updates every 10-15 min (LogicalDisk.PercentFreeSpace)",
[]string{"volume"},
nil,
),
TotalSpace: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "size_bytes"),
"Total space in bytes, updates every 10-15 min (LogicalDisk.PercentFreeSpace_Base)",
[]string{"volume"},
nil,
),
IdleTime: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "idle_seconds_total"),
"Seconds that the disk was idle (LogicalDisk.PercentIdleTime)",
[]string{"volume"},
nil,
),
SplitIOs: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "split_ios_total"),
"The number of I/Os to the disk were split into multiple I/Os (LogicalDisk.SplitIOPerSec)",
[]string{"volume"},
nil,
),
ReadLatency: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "read_latency_seconds_total"),
"Shows the average time, in seconds, of a read operation from the disk (LogicalDisk.AvgDiskSecPerRead)",
[]string{"volume"},
nil,
),
WriteLatency: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "write_latency_seconds_total"),
"Shows the average time, in seconds, of a write operation to the disk (LogicalDisk.AvgDiskSecPerWrite)",
[]string{"volume"},
nil,
),
ReadWriteLatency: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "read_write_latency_seconds_total"),
"Shows the time, in seconds, of the average disk transfer (LogicalDisk.AvgDiskSecPerTransfer)",
[]string{"volume"},
nil,
),
volumeWhitelistPattern: regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *volumeWhitelist)),
volumeBlacklistPattern: regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *volumeBlacklist)),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *LogicalDiskCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ctx, ch); err != nil {
log.Error("failed collecting logical_disk metrics:", desc, err)
return err
}
return nil
}
// Win32_PerfRawData_PerfDisk_LogicalDisk docs:
// - https://msdn.microsoft.com/en-us/windows/hardware/aa394307(v=vs.71) - Win32_PerfRawData_PerfDisk_LogicalDisk class
// - https://msdn.microsoft.com/en-us/library/ms803973.aspx - LogicalDisk object reference
type logicalDisk struct {
Name string
CurrentDiskQueueLength float64 `perflib:"Current Disk Queue Length"`
DiskReadBytesPerSec float64 `perflib:"Disk Read Bytes/sec"`
DiskReadsPerSec float64 `perflib:"Disk Reads/sec"`
DiskWriteBytesPerSec float64 `perflib:"Disk Write Bytes/sec"`
DiskWritesPerSec float64 `perflib:"Disk Writes/sec"`
PercentDiskReadTime float64 `perflib:"% Disk Read Time"`
PercentDiskWriteTime float64 `perflib:"% Disk Write Time"`
PercentFreeSpace float64 `perflib:"% Free Space_Base"`
PercentFreeSpace_Base float64 `perflib:"Free Megabytes"`
PercentIdleTime float64 `perflib:"% Idle Time"`
SplitIOPerSec float64 `perflib:"Split IO/Sec"`
AvgDiskSecPerRead float64 `perflib:"Avg. Disk sec/Read"`
AvgDiskSecPerWrite float64 `perflib:"Avg. Disk sec/Write"`
AvgDiskSecPerTransfer float64 `perflib:"Avg. Disk sec/Transfer"`
}
func (c *LogicalDiskCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []logicalDisk
if err := unmarshalObject(ctx.perfObjects["LogicalDisk"], &dst); err != nil {
return nil, err
}
for _, volume := range dst {
if volume.Name == "_Total" ||
c.volumeBlacklistPattern.MatchString(volume.Name) ||
!c.volumeWhitelistPattern.MatchString(volume.Name) {
continue
}
ch <- prometheus.MustNewConstMetric(
c.RequestsQueued,
prometheus.GaugeValue,
volume.CurrentDiskQueueLength,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ReadBytesTotal,
prometheus.CounterValue,
volume.DiskReadBytesPerSec,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ReadsTotal,
prometheus.CounterValue,
volume.DiskReadsPerSec,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.WriteBytesTotal,
prometheus.CounterValue,
volume.DiskWriteBytesPerSec,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.WritesTotal,
prometheus.CounterValue,
volume.DiskWritesPerSec,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ReadTime,
prometheus.CounterValue,
volume.PercentDiskReadTime,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.WriteTime,
prometheus.CounterValue,
volume.PercentDiskWriteTime,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FreeSpace,
prometheus.GaugeValue,
volume.PercentFreeSpace_Base*1024*1024,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalSpace,
prometheus.GaugeValue,
volume.PercentFreeSpace*1024*1024,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.IdleTime,
prometheus.CounterValue,
volume.PercentIdleTime,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.SplitIOs,
prometheus.CounterValue,
volume.SplitIOPerSec,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ReadLatency,
prometheus.CounterValue,
volume.AvgDiskSecPerRead*ticksToSecondsScaleFactor,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.WriteLatency,
prometheus.CounterValue,
volume.AvgDiskSecPerWrite*ticksToSecondsScaleFactor,
volume.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ReadWriteLatency,
prometheus.CounterValue,
volume.AvgDiskSecPerTransfer*ticksToSecondsScaleFactor,
volume.Name,
)
}
return nil, nil
}

View File

@@ -1,13 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkLogicalDiskCollector(b *testing.B) {
// Whitelist is not set in testing context (kingpin flags not parsed), causing the collector to skip all disks.
localVolumeWhitelist := ".+"
volumeWhitelist = &localVolumeWhitelist
benchmarkCollector(b, "logical_disk", NewLogicalDiskCollector)
}

View File

@@ -1,200 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"errors"
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("logon", NewLogonCollector)
}
// A LogonCollector is a Prometheus collector for WMI metrics
type LogonCollector struct {
LogonType *prometheus.Desc
}
// NewLogonCollector ...
func NewLogonCollector() (Collector, error) {
const subsystem = "logon"
return &LogonCollector{
LogonType: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "logon_type"),
"Number of active logon sessions (LogonSession.LogonType)",
[]string{"status"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *LogonCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting user metrics:", desc, err)
return err
}
return nil
}
// Win32_LogonSession docs:
// - https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-logonsession
type Win32_LogonSession struct {
LogonType uint32
}
func (c *LogonCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_LogonSession
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
if len(dst) == 0 {
return nil, errors.New("WMI query returned empty result set")
}
// Init counters
system := 0
interactive := 0
network := 0
batch := 0
service := 0
proxy := 0
unlock := 0
networkcleartext := 0
newcredentials := 0
remoteinteractive := 0
cachedinteractive := 0
cachedremoteinteractive := 0
cachedunlock := 0
for _, entry := range dst {
switch entry.LogonType {
case 0:
system++
case 2:
interactive++
case 3:
network++
case 4:
batch++
case 5:
service++
case 6:
proxy++
case 7:
unlock++
case 8:
networkcleartext++
case 9:
newcredentials++
case 10:
remoteinteractive++
case 11:
cachedinteractive++
case 12:
cachedremoteinteractive++
case 13:
cachedunlock++
}
}
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(system),
"system",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(interactive),
"interactive",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(network),
"network",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(batch),
"batch",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(service),
"service",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(proxy),
"proxy",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(unlock),
"unlock",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(networkcleartext),
"network_clear_text",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(newcredentials),
"new_credentials",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(remoteinteractive),
"remote_interactive",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(cachedinteractive),
"cached_interactive",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(remoteinteractive),
"cached_remote_interactive",
)
ch <- prometheus.MustNewConstMetric(
c.LogonType,
prometheus.GaugeValue,
float64(cachedunlock),
"cached_unlock",
)
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkLogonCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewLogonCollector)
}

View File

@@ -1,503 +0,0 @@
// returns data points from Win32_PerfRawData_PerfOS_Memory
// <add link to documentation here> - Win32_PerfRawData_PerfOS_Memory class
//go:build windows
// +build windows
package collector
import (
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("memory", NewMemoryCollector, "Memory")
}
// A MemoryCollector is a Prometheus collector for perflib Memory metrics
type MemoryCollector struct {
AvailableBytes *prometheus.Desc
CacheBytes *prometheus.Desc
CacheBytesPeak *prometheus.Desc
CacheFaultsTotal *prometheus.Desc
CommitLimit *prometheus.Desc
CommittedBytes *prometheus.Desc
DemandZeroFaultsTotal *prometheus.Desc
FreeAndZeroPageListBytes *prometheus.Desc
FreeSystemPageTableEntries *prometheus.Desc
ModifiedPageListBytes *prometheus.Desc
PageFaultsTotal *prometheus.Desc
SwapPageReadsTotal *prometheus.Desc
SwapPagesReadTotal *prometheus.Desc
SwapPagesWrittenTotal *prometheus.Desc
SwapPageOperationsTotal *prometheus.Desc
SwapPageWritesTotal *prometheus.Desc
PoolNonpagedAllocsTotal *prometheus.Desc
PoolNonpagedBytes *prometheus.Desc
PoolPagedAllocsTotal *prometheus.Desc
PoolPagedBytes *prometheus.Desc
PoolPagedResidentBytes *prometheus.Desc
StandbyCacheCoreBytes *prometheus.Desc
StandbyCacheNormalPriorityBytes *prometheus.Desc
StandbyCacheReserveBytes *prometheus.Desc
SystemCacheResidentBytes *prometheus.Desc
SystemCodeResidentBytes *prometheus.Desc
SystemCodeTotalBytes *prometheus.Desc
SystemDriverResidentBytes *prometheus.Desc
SystemDriverTotalBytes *prometheus.Desc
TransitionFaultsTotal *prometheus.Desc
TransitionPagesRepurposedTotal *prometheus.Desc
WriteCopiesTotal *prometheus.Desc
}
// NewMemoryCollector ...
func NewMemoryCollector() (Collector, error) {
const subsystem = "memory"
return &MemoryCollector{
AvailableBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "available_bytes"),
"The amount of physical memory immediately available for allocation to a process or for system use. It is equal to the sum of memory assigned to"+
" the standby (cached), free and zero page lists (AvailableBytes)",
nil,
nil,
),
CacheBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "cache_bytes"),
"(CacheBytes)",
nil,
nil,
),
CacheBytesPeak: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "cache_bytes_peak"),
"(CacheBytesPeak)",
nil,
nil,
),
CacheFaultsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "cache_faults_total"),
"(CacheFaultsPersec)",
nil,
nil,
),
CommitLimit: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "commit_limit"),
"(CommitLimit)",
nil,
nil,
),
CommittedBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "committed_bytes"),
"(CommittedBytes)",
nil,
nil,
),
DemandZeroFaultsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "demand_zero_faults_total"),
"The number of zeroed pages required to satisfy faults. Zeroed pages, pages emptied of previously stored data and filled with zeros, are a security"+
" feature of Windows that prevent processes from seeing data stored by earlier processes that used the memory space (DemandZeroFaults)",
nil,
nil,
),
FreeAndZeroPageListBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "free_and_zero_page_list_bytes"),
"(FreeAndZeroPageListBytes)",
nil,
nil,
),
FreeSystemPageTableEntries: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "free_system_page_table_entries"),
"(FreeSystemPageTableEntries)",
nil,
nil,
),
ModifiedPageListBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "modified_page_list_bytes"),
"(ModifiedPageListBytes)",
nil,
nil,
),
PageFaultsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "page_faults_total"),
"(PageFaultsPersec)",
nil,
nil,
),
SwapPageReadsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "swap_page_reads_total"),
"Number of disk page reads (a single read operation reading several pages is still only counted once) (PageReadsPersec)",
nil,
nil,
),
SwapPagesReadTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "swap_pages_read_total"),
"Number of pages read across all page reads (ie counting all pages read even if they are read in a single operation) (PagesInputPersec)",
nil,
nil,
),
SwapPagesWrittenTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "swap_pages_written_total"),
"Number of pages written across all page writes (ie counting all pages written even if they are written in a single operation) (PagesOutputPersec)",
nil,
nil,
),
SwapPageOperationsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "swap_page_operations_total"),
"Total number of swap page read and writes (PagesPersec)",
nil,
nil,
),
SwapPageWritesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "swap_page_writes_total"),
"Number of disk page writes (a single write operation writing several pages is still only counted once) (PageWritesPersec)",
nil,
nil,
),
PoolNonpagedAllocsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "pool_nonpaged_allocs_total"),
"The number of calls to allocate space in the nonpaged pool. The nonpaged pool is an area of system memory area for objects that cannot be written"+
" to disk, and must remain in physical memory as long as they are allocated (PoolNonpagedAllocs)",
nil,
nil,
),
PoolNonpagedBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "pool_nonpaged_bytes_total"),
"(PoolNonpagedBytes)",
nil,
nil,
),
PoolPagedAllocsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "pool_paged_allocs_total"),
"(PoolPagedAllocs)",
nil,
nil,
),
PoolPagedBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "pool_paged_bytes"),
"(PoolPagedBytes)",
nil,
nil,
),
PoolPagedResidentBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "pool_paged_resident_bytes"),
"(PoolPagedResidentBytes)",
nil,
nil,
),
StandbyCacheCoreBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "standby_cache_core_bytes"),
"(StandbyCacheCoreBytes)",
nil,
nil,
),
StandbyCacheNormalPriorityBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "standby_cache_normal_priority_bytes"),
"(StandbyCacheNormalPriorityBytes)",
nil,
nil,
),
StandbyCacheReserveBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "standby_cache_reserve_bytes"),
"(StandbyCacheReserveBytes)",
nil,
nil,
),
SystemCacheResidentBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "system_cache_resident_bytes"),
"(SystemCacheResidentBytes)",
nil,
nil,
),
SystemCodeResidentBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "system_code_resident_bytes"),
"(SystemCodeResidentBytes)",
nil,
nil,
),
SystemCodeTotalBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "system_code_total_bytes"),
"(SystemCodeTotalBytes)",
nil,
nil,
),
SystemDriverResidentBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "system_driver_resident_bytes"),
"(SystemDriverResidentBytes)",
nil,
nil,
),
SystemDriverTotalBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "system_driver_total_bytes"),
"(SystemDriverTotalBytes)",
nil,
nil,
),
TransitionFaultsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "transition_faults_total"),
"(TransitionFaultsPersec)",
nil,
nil,
),
TransitionPagesRepurposedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "transition_pages_repurposed_total"),
"(TransitionPagesRePurposedPersec)",
nil,
nil,
),
WriteCopiesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "write_copies_total"),
"The number of page faults caused by attempting to write that were satisfied by copying the page from elsewhere in physical memory (WriteCopiesPersec)",
nil,
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *MemoryCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ctx, ch); err != nil {
log.Error("failed collecting memory metrics:", desc, err)
return err
}
return nil
}
type memory struct {
AvailableBytes float64 `perflib:"Available Bytes"`
AvailableKBytes float64 `perflib:"Available KBytes"`
AvailableMBytes float64 `perflib:"Available MBytes"`
CacheBytes float64 `perflib:"Cache Bytes"`
CacheBytesPeak float64 `perflib:"Cache Bytes Peak"`
CacheFaultsPersec float64 `perflib:"Cache Faults/sec"`
CommitLimit float64 `perflib:"Commit Limit"`
CommittedBytes float64 `perflib:"Committed Bytes"`
DemandZeroFaultsPersec float64 `perflib:"Demand Zero Faults/sec"`
FreeAndZeroPageListBytes float64 `perflib:"Free & Zero Page List Bytes"`
FreeSystemPageTableEntries float64 `perflib:"Free System Page Table Entries"`
ModifiedPageListBytes float64 `perflib:"Modified Page List Bytes"`
PageFaultsPersec float64 `perflib:"Page Faults/sec"`
PageReadsPersec float64 `perflib:"Page Reads/sec"`
PagesInputPersec float64 `perflib:"Pages Input/sec"`
PagesOutputPersec float64 `perflib:"Pages Output/sec"`
PagesPersec float64 `perflib:"Pages/sec"`
PageWritesPersec float64 `perflib:"Page Writes/sec"`
PoolNonpagedAllocs float64 `perflib:"Pool Nonpaged Allocs"`
PoolNonpagedBytes float64 `perflib:"Pool Nonpaged Bytes"`
PoolPagedAllocs float64 `perflib:"Pool Paged Allocs"`
PoolPagedBytes float64 `perflib:"Pool Paged Bytes"`
PoolPagedResidentBytes float64 `perflib:"Pool Paged Resident Bytes"`
StandbyCacheCoreBytes float64 `perflib:"Standby Cache Core Bytes"`
StandbyCacheNormalPriorityBytes float64 `perflib:"Standby Cache Normal Priority Bytes"`
StandbyCacheReserveBytes float64 `perflib:"Standby Cache Reserve Bytes"`
SystemCacheResidentBytes float64 `perflib:"System Cache Resident Bytes"`
SystemCodeResidentBytes float64 `perflib:"System Code Resident Bytes"`
SystemCodeTotalBytes float64 `perflib:"System Code Total Bytes"`
SystemDriverResidentBytes float64 `perflib:"System Driver Resident Bytes"`
SystemDriverTotalBytes float64 `perflib:"System Driver Total Bytes"`
TransitionFaultsPersec float64 `perflib:"Transition Faults/sec"`
TransitionPagesRePurposedPersec float64 `perflib:"Transition Pages RePurposed/sec"`
WriteCopiesPersec float64 `perflib:"Write Copies/sec"`
}
func (c *MemoryCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []memory
if err := unmarshalObject(ctx.perfObjects["Memory"], &dst); err != nil {
return nil, err
}
ch <- prometheus.MustNewConstMetric(
c.AvailableBytes,
prometheus.GaugeValue,
dst[0].AvailableBytes,
)
ch <- prometheus.MustNewConstMetric(
c.CacheBytes,
prometheus.GaugeValue,
dst[0].CacheBytes,
)
ch <- prometheus.MustNewConstMetric(
c.CacheBytesPeak,
prometheus.GaugeValue,
dst[0].CacheBytesPeak,
)
ch <- prometheus.MustNewConstMetric(
c.CacheFaultsTotal,
prometheus.GaugeValue,
dst[0].CacheFaultsPersec,
)
ch <- prometheus.MustNewConstMetric(
c.CommitLimit,
prometheus.GaugeValue,
dst[0].CommitLimit,
)
ch <- prometheus.MustNewConstMetric(
c.CommittedBytes,
prometheus.GaugeValue,
dst[0].CommittedBytes,
)
ch <- prometheus.MustNewConstMetric(
c.DemandZeroFaultsTotal,
prometheus.GaugeValue,
dst[0].DemandZeroFaultsPersec,
)
ch <- prometheus.MustNewConstMetric(
c.FreeAndZeroPageListBytes,
prometheus.GaugeValue,
dst[0].FreeAndZeroPageListBytes,
)
ch <- prometheus.MustNewConstMetric(
c.FreeSystemPageTableEntries,
prometheus.GaugeValue,
dst[0].FreeSystemPageTableEntries,
)
ch <- prometheus.MustNewConstMetric(
c.ModifiedPageListBytes,
prometheus.GaugeValue,
dst[0].ModifiedPageListBytes,
)
ch <- prometheus.MustNewConstMetric(
c.PageFaultsTotal,
prometheus.GaugeValue,
dst[0].PageFaultsPersec,
)
ch <- prometheus.MustNewConstMetric(
c.SwapPageReadsTotal,
prometheus.GaugeValue,
dst[0].PageReadsPersec,
)
ch <- prometheus.MustNewConstMetric(
c.SwapPagesReadTotal,
prometheus.GaugeValue,
dst[0].PagesInputPersec,
)
ch <- prometheus.MustNewConstMetric(
c.SwapPagesWrittenTotal,
prometheus.GaugeValue,
dst[0].PagesOutputPersec,
)
ch <- prometheus.MustNewConstMetric(
c.SwapPageOperationsTotal,
prometheus.GaugeValue,
dst[0].PagesPersec,
)
ch <- prometheus.MustNewConstMetric(
c.SwapPageWritesTotal,
prometheus.GaugeValue,
dst[0].PageWritesPersec,
)
ch <- prometheus.MustNewConstMetric(
c.PoolNonpagedAllocsTotal,
prometheus.GaugeValue,
dst[0].PoolNonpagedAllocs,
)
ch <- prometheus.MustNewConstMetric(
c.PoolNonpagedBytes,
prometheus.GaugeValue,
dst[0].PoolNonpagedBytes,
)
ch <- prometheus.MustNewConstMetric(
c.PoolPagedAllocsTotal,
prometheus.GaugeValue,
dst[0].PoolPagedAllocs,
)
ch <- prometheus.MustNewConstMetric(
c.PoolPagedBytes,
prometheus.GaugeValue,
dst[0].PoolPagedBytes,
)
ch <- prometheus.MustNewConstMetric(
c.PoolPagedResidentBytes,
prometheus.GaugeValue,
dst[0].PoolPagedResidentBytes,
)
ch <- prometheus.MustNewConstMetric(
c.StandbyCacheCoreBytes,
prometheus.GaugeValue,
dst[0].StandbyCacheCoreBytes,
)
ch <- prometheus.MustNewConstMetric(
c.StandbyCacheNormalPriorityBytes,
prometheus.GaugeValue,
dst[0].StandbyCacheNormalPriorityBytes,
)
ch <- prometheus.MustNewConstMetric(
c.StandbyCacheReserveBytes,
prometheus.GaugeValue,
dst[0].StandbyCacheReserveBytes,
)
ch <- prometheus.MustNewConstMetric(
c.SystemCacheResidentBytes,
prometheus.GaugeValue,
dst[0].SystemCacheResidentBytes,
)
ch <- prometheus.MustNewConstMetric(
c.SystemCodeResidentBytes,
prometheus.GaugeValue,
dst[0].SystemCodeResidentBytes,
)
ch <- prometheus.MustNewConstMetric(
c.SystemCodeTotalBytes,
prometheus.GaugeValue,
dst[0].SystemCodeTotalBytes,
)
ch <- prometheus.MustNewConstMetric(
c.SystemDriverResidentBytes,
prometheus.GaugeValue,
dst[0].SystemDriverResidentBytes,
)
ch <- prometheus.MustNewConstMetric(
c.SystemDriverTotalBytes,
prometheus.GaugeValue,
dst[0].SystemDriverTotalBytes,
)
ch <- prometheus.MustNewConstMetric(
c.TransitionFaultsTotal,
prometheus.GaugeValue,
dst[0].TransitionFaultsPersec,
)
ch <- prometheus.MustNewConstMetric(
c.TransitionPagesRepurposedTotal,
prometheus.GaugeValue,
dst[0].TransitionPagesRePurposedPersec,
)
ch <- prometheus.MustNewConstMetric(
c.WriteCopiesTotal,
prometheus.GaugeValue,
dst[0].WriteCopiesPersec,
)
return nil, nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkMemoryCollector(b *testing.B) {
benchmarkCollector(b, "memory", NewMemoryCollector)
}

View File

@@ -1,126 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"strings"
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)
func init() {
registerCollector("msmq", NewMSMQCollector)
}
var (
msmqWhereClause = kingpin.Flag("collector.msmq.msmq-where", "WQL 'where' clause to use in WMI metrics query. Limits the response to the msmqs you specify and reduces the size of the response.").String()
)
// A Win32_PerfRawData_MSMQ_MSMQQueueCollector is a Prometheus collector for WMI Win32_PerfRawData_MSMQ_MSMQQueue metrics
type Win32_PerfRawData_MSMQ_MSMQQueueCollector struct {
BytesinJournalQueue *prometheus.Desc
BytesinQueue *prometheus.Desc
MessagesinJournalQueue *prometheus.Desc
MessagesinQueue *prometheus.Desc
queryWhereClause string
}
// NewWin32_PerfRawData_MSMQ_MSMQQueueCollector ...
func NewMSMQCollector() (Collector, error) {
const subsystem = "msmq"
if *msmqWhereClause == "" {
log.Warn("No where-clause specified for msmq collector. This will generate a very large number of metrics!")
}
return &Win32_PerfRawData_MSMQ_MSMQQueueCollector{
BytesinJournalQueue: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "bytes_in_journal_queue"),
"Size of queue journal in bytes",
[]string{"name"},
nil,
),
BytesinQueue: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "bytes_in_queue"),
"Size of queue in bytes",
[]string{"name"},
nil,
),
MessagesinJournalQueue: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "messages_in_journal_queue"),
"Count messages in queue journal",
[]string{"name"},
nil,
),
MessagesinQueue: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "messages_in_queue"),
"Count messages in queue",
[]string{"name"},
nil,
),
queryWhereClause: *msmqWhereClause,
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *Win32_PerfRawData_MSMQ_MSMQQueueCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting msmq metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_MSMQ_MSMQQueue struct {
Name string
BytesinJournalQueue uint64
BytesinQueue uint64
MessagesinJournalQueue uint64
MessagesinQueue uint64
}
func (c *Win32_PerfRawData_MSMQ_MSMQQueueCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_MSMQ_MSMQQueue
q := queryAllWhere(&dst, c.queryWhereClause)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, msmq := range dst {
ch <- prometheus.MustNewConstMetric(
c.BytesinJournalQueue,
prometheus.GaugeValue,
float64(msmq.BytesinJournalQueue),
strings.ToLower(msmq.Name),
)
ch <- prometheus.MustNewConstMetric(
c.BytesinQueue,
prometheus.GaugeValue,
float64(msmq.BytesinQueue),
strings.ToLower(msmq.Name),
)
ch <- prometheus.MustNewConstMetric(
c.MessagesinJournalQueue,
prometheus.GaugeValue,
float64(msmq.MessagesinJournalQueue),
strings.ToLower(msmq.Name),
)
ch <- prometheus.MustNewConstMetric(
c.MessagesinQueue,
prometheus.GaugeValue,
float64(msmq.MessagesinQueue),
strings.ToLower(msmq.Name),
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkMsmqCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewMSMQCollector)
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkMSSQLCollector(b *testing.B) {
benchmarkCollector(b, "mssql", NewMSSQLCollector)
}

View File

@@ -1,260 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"fmt"
"regexp"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)
func init() {
registerCollector("net", NewNetworkCollector, "Network Interface")
}
var (
nicWhitelist = kingpin.Flag(
"collector.net.nic-whitelist",
"Regexp of NIC:s to whitelist. NIC name must both match whitelist and not match blacklist to be included.",
).Default(".+").String()
nicBlacklist = kingpin.Flag(
"collector.net.nic-blacklist",
"Regexp of NIC:s to blacklist. NIC name must both match whitelist and not match blacklist to be included.",
).Default("").String()
nicNameToUnderscore = regexp.MustCompile("[^a-zA-Z0-9]")
)
// A NetworkCollector is a Prometheus collector for Perflib Network Interface metrics
type NetworkCollector struct {
BytesReceivedTotal *prometheus.Desc
BytesSentTotal *prometheus.Desc
BytesTotal *prometheus.Desc
PacketsOutboundDiscarded *prometheus.Desc
PacketsOutboundErrors *prometheus.Desc
PacketsTotal *prometheus.Desc
PacketsReceivedDiscarded *prometheus.Desc
PacketsReceivedErrors *prometheus.Desc
PacketsReceivedTotal *prometheus.Desc
PacketsReceivedUnknown *prometheus.Desc
PacketsSentTotal *prometheus.Desc
CurrentBandwidth *prometheus.Desc
nicWhitelistPattern *regexp.Regexp
nicBlacklistPattern *regexp.Regexp
}
// NewNetworkCollector ...
func NewNetworkCollector() (Collector, error) {
const subsystem = "net"
return &NetworkCollector{
BytesReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "bytes_received_total"),
"(Network.BytesReceivedPerSec)",
[]string{"nic"},
nil,
),
BytesSentTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "bytes_sent_total"),
"(Network.BytesSentPerSec)",
[]string{"nic"},
nil,
),
BytesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "bytes_total"),
"(Network.BytesTotalPerSec)",
[]string{"nic"},
nil,
),
PacketsOutboundDiscarded: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_outbound_discarded_total"),
"(Network.PacketsOutboundDiscarded)",
[]string{"nic"},
nil,
),
PacketsOutboundErrors: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_outbound_errors_total"),
"(Network.PacketsOutboundErrors)",
[]string{"nic"},
nil,
),
PacketsReceivedDiscarded: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_received_discarded_total"),
"(Network.PacketsReceivedDiscarded)",
[]string{"nic"},
nil,
),
PacketsReceivedErrors: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_received_errors_total"),
"(Network.PacketsReceivedErrors)",
[]string{"nic"},
nil,
),
PacketsReceivedTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_received_total"),
"(Network.PacketsReceivedPerSec)",
[]string{"nic"},
nil,
),
PacketsReceivedUnknown: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_received_unknown_total"),
"(Network.PacketsReceivedUnknown)",
[]string{"nic"},
nil,
),
PacketsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_total"),
"(Network.PacketsPerSec)",
[]string{"nic"},
nil,
),
PacketsSentTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "packets_sent_total"),
"(Network.PacketsSentPerSec)",
[]string{"nic"},
nil,
),
CurrentBandwidth: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "current_bandwidth_bytes"),
"(Network.CurrentBandwidth)",
[]string{"nic"},
nil,
),
nicWhitelistPattern: regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *nicWhitelist)),
nicBlacklistPattern: regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *nicBlacklist)),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NetworkCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ctx, ch); err != nil {
log.Error("failed collecting net metrics:", desc, err)
return err
}
return nil
}
// mangleNetworkName mangles Network Adapter name (non-alphanumeric to _)
// that is used in networkInterface.
func mangleNetworkName(name string) string {
return nicNameToUnderscore.ReplaceAllString(name, "_")
}
// Win32_PerfRawData_Tcpip_NetworkInterface docs:
// - https://technet.microsoft.com/en-us/security/aa394340(v=vs.80)
type networkInterface struct {
BytesReceivedPerSec float64 `perflib:"Bytes Received/sec"`
BytesSentPerSec float64 `perflib:"Bytes Sent/sec"`
BytesTotalPerSec float64 `perflib:"Bytes Total/sec"`
Name string
PacketsOutboundDiscarded float64 `perflib:"Packets Outbound Discarded"`
PacketsOutboundErrors float64 `perflib:"Packets Outbound Errors"`
PacketsPerSec float64 `perflib:"Packets/sec"`
PacketsReceivedDiscarded float64 `perflib:"Packets Received Discarded"`
PacketsReceivedErrors float64 `perflib:"Packets Received Errors"`
PacketsReceivedPerSec float64 `perflib:"Packets Received/sec"`
PacketsReceivedUnknown float64 `perflib:"Packets Received Unknown"`
PacketsSentPerSec float64 `perflib:"Packets Sent/sec"`
CurrentBandwidth float64 `perflib:"Current Bandwidth"`
}
func (c *NetworkCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []networkInterface
if err := unmarshalObject(ctx.perfObjects["Network Interface"], &dst); err != nil {
return nil, err
}
for _, nic := range dst {
if c.nicBlacklistPattern.MatchString(nic.Name) ||
!c.nicWhitelistPattern.MatchString(nic.Name) {
continue
}
name := mangleNetworkName(nic.Name)
if name == "" {
continue
}
// Counters
ch <- prometheus.MustNewConstMetric(
c.BytesReceivedTotal,
prometheus.CounterValue,
nic.BytesReceivedPerSec,
name,
)
ch <- prometheus.MustNewConstMetric(
c.BytesSentTotal,
prometheus.CounterValue,
nic.BytesSentPerSec,
name,
)
ch <- prometheus.MustNewConstMetric(
c.BytesTotal,
prometheus.CounterValue,
nic.BytesTotalPerSec,
name,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsOutboundDiscarded,
prometheus.CounterValue,
nic.PacketsOutboundDiscarded,
name,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsOutboundErrors,
prometheus.CounterValue,
nic.PacketsOutboundErrors,
name,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsTotal,
prometheus.CounterValue,
nic.PacketsPerSec,
name,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsReceivedDiscarded,
prometheus.CounterValue,
nic.PacketsReceivedDiscarded,
name,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsReceivedErrors,
prometheus.CounterValue,
nic.PacketsReceivedErrors,
name,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsReceivedTotal,
prometheus.CounterValue,
nic.PacketsReceivedPerSec,
name,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsReceivedUnknown,
prometheus.CounterValue,
nic.PacketsReceivedUnknown,
name,
)
ch <- prometheus.MustNewConstMetric(
c.PacketsSentTotal,
prometheus.CounterValue,
nic.PacketsSentPerSec,
name,
)
ch <- prometheus.MustNewConstMetric(
c.CurrentBandwidth,
prometheus.GaugeValue,
nic.CurrentBandwidth/8,
name,
)
}
return nil, nil
}

View File

@@ -1,27 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"testing"
)
func TestNetworkToInstanceName(t *testing.T) {
data := map[string]string{
"Intel[R] Dual Band Wireless-AC 8260": "Intel_R__Dual_Band_Wireless_AC_8260",
}
for in, out := range data {
got := mangleNetworkName(in)
if got != out {
t.Error("expected", out, "got", got)
}
}
}
func BenchmarkNetCollector(b *testing.B) {
// Whitelist is not set in testing context (kingpin flags not parsed), causing the collector to skip all interfaces.
localNicWhitelist := ".+"
nicWhitelist = &localNicWhitelist
benchmarkCollector(b, "net", NewNetworkCollector)
}

View File

@@ -1,118 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("netframework_clrexceptions", NewNETFramework_NETCLRExceptionsCollector)
}
// A NETFramework_NETCLRExceptionsCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRExceptions metrics
type NETFramework_NETCLRExceptionsCollector struct {
NumberofExcepsThrown *prometheus.Desc
NumberofFilters *prometheus.Desc
NumberofFinallys *prometheus.Desc
ThrowToCatchDepth *prometheus.Desc
}
// NewNETFramework_NETCLRExceptionsCollector ...
func NewNETFramework_NETCLRExceptionsCollector() (Collector, error) {
const subsystem = "netframework_clrexceptions"
return &NETFramework_NETCLRExceptionsCollector{
NumberofExcepsThrown: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "exceptions_thrown_total"),
"Displays the total number of exceptions thrown since the application started. This includes both .NET exceptions and unmanaged exceptions that are converted into .NET exceptions.",
[]string{"process"},
nil,
),
NumberofFilters: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "exceptions_filters_total"),
"Displays the total number of .NET exception filters executed. An exception filter evaluates regardless of whether an exception is handled.",
[]string{"process"},
nil,
),
NumberofFinallys: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "exceptions_finallys_total"),
"Displays the total number of finally blocks executed. Only the finally blocks executed for an exception are counted; finally blocks on normal code paths are not counted by this counter.",
[]string{"process"},
nil,
),
ThrowToCatchDepth: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "throw_to_catch_depth_total"),
"Displays the total number of stack frames traversed, from the frame that threw the exception to the frame that handled the exception.",
[]string{"process"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NETFramework_NETCLRExceptionsCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting win32_perfrawdata_netframework_netclrexceptions metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_NETFramework_NETCLRExceptions struct {
Name string
NumberofExcepsThrown uint32
NumberofExcepsThrownPersec uint32
NumberofFiltersPersec uint32
NumberofFinallysPersec uint32
ThrowToCatchDepthPersec uint32
}
func (c *NETFramework_NETCLRExceptionsCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_NETFramework_NETCLRExceptions
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, process := range dst {
if process.Name == "_Global_" {
continue
}
ch <- prometheus.MustNewConstMetric(
c.NumberofExcepsThrown,
prometheus.CounterValue,
float64(process.NumberofExcepsThrown),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofFilters,
prometheus.CounterValue,
float64(process.NumberofFiltersPersec),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofFinallys,
prometheus.CounterValue,
float64(process.NumberofFinallysPersec),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ThrowToCatchDepth,
prometheus.CounterValue,
float64(process.ThrowToCatchDepthPersec),
process.Name,
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkNetFrameworkNETCLRExceptionsCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewNETFramework_NETCLRExceptionsCollector)
}

View File

@@ -1,104 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("netframework_clrinterop", NewNETFramework_NETCLRInteropCollector)
}
// A NETFramework_NETCLRInteropCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRInterop metrics
type NETFramework_NETCLRInteropCollector struct {
NumberofCCWs *prometheus.Desc
Numberofmarshalling *prometheus.Desc
NumberofStubs *prometheus.Desc
}
// NewNETFramework_NETCLRInteropCollector ...
func NewNETFramework_NETCLRInteropCollector() (Collector, error) {
const subsystem = "netframework_clrinterop"
return &NETFramework_NETCLRInteropCollector{
NumberofCCWs: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "com_callable_wrappers_total"),
"Displays the current number of COM callable wrappers (CCWs). A CCW is a proxy for a managed object being referenced from an unmanaged COM client.",
[]string{"process"},
nil,
),
Numberofmarshalling: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "interop_marshalling_total"),
"Displays the total number of times arguments and return values have been marshaled from managed to unmanaged code, and vice versa, since the application started.",
[]string{"process"},
nil,
),
NumberofStubs: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "interop_stubs_created_total"),
"Displays the current number of stubs created by the common language runtime. Stubs are responsible for marshaling arguments and return values from managed to unmanaged code, and vice versa, during a COM interop call or a platform invoke call.",
[]string{"process"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NETFramework_NETCLRInteropCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting win32_perfrawdata_netframework_netclrinterop metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_NETFramework_NETCLRInterop struct {
Name string
NumberofCCWs uint32
Numberofmarshalling uint32
NumberofStubs uint32
NumberofTLBexportsPersec uint32
NumberofTLBimportsPersec uint32
}
func (c *NETFramework_NETCLRInteropCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_NETFramework_NETCLRInterop
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, process := range dst {
if process.Name == "_Global_" {
continue
}
ch <- prometheus.MustNewConstMetric(
c.NumberofCCWs,
prometheus.CounterValue,
float64(process.NumberofCCWs),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Numberofmarshalling,
prometheus.CounterValue,
float64(process.Numberofmarshalling),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofStubs,
prometheus.CounterValue,
float64(process.NumberofStubs),
process.Name,
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkNETFrameworkNETCLRInteropCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewNETFramework_NETCLRInteropCollector)
}

View File

@@ -1,120 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("netframework_clrjit", NewNETFramework_NETCLRJitCollector)
}
// A NETFramework_NETCLRJitCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRJit metrics
type NETFramework_NETCLRJitCollector struct {
NumberofMethodsJitted *prometheus.Desc
TimeinJit *prometheus.Desc
StandardJitFailures *prometheus.Desc
TotalNumberofILBytesJitted *prometheus.Desc
}
// NewNETFramework_NETCLRJitCollector ...
func NewNETFramework_NETCLRJitCollector() (Collector, error) {
const subsystem = "netframework_clrjit"
return &NETFramework_NETCLRJitCollector{
NumberofMethodsJitted: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "jit_methods_total"),
"Displays the total number of methods JIT-compiled since the application started. This counter does not include pre-JIT-compiled methods.",
[]string{"process"},
nil,
),
TimeinJit: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "jit_time_percent"),
"Displays the percentage of time spent in JIT compilation. This counter is updated at the end of every JIT compilation phase. A JIT compilation phase occurs when a method and its dependencies are compiled.",
[]string{"process"},
nil,
),
StandardJitFailures: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "jit_standard_failures_total"),
"Displays the peak number of methods the JIT compiler has failed to compile since the application started. This failure can occur if the MSIL cannot be verified or if there is an internal error in the JIT compiler.",
[]string{"process"},
nil,
),
TotalNumberofILBytesJitted: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "jit_il_bytes_total"),
"Displays the total number of Microsoft intermediate language (MSIL) bytes compiled by the just-in-time (JIT) compiler since the application started",
[]string{"process"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NETFramework_NETCLRJitCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting win32_perfrawdata_netframework_netclrjit metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_NETFramework_NETCLRJit struct {
Name string
Frequency_PerfTime uint32
ILBytesJittedPersec uint32
NumberofILBytesJitted uint32
NumberofMethodsJitted uint32
PercentTimeinJit uint32
StandardJitFailures uint32
TotalNumberofILBytesJitted uint32
}
func (c *NETFramework_NETCLRJitCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_NETFramework_NETCLRJit
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, process := range dst {
if process.Name == "_Global_" {
continue
}
ch <- prometheus.MustNewConstMetric(
c.NumberofMethodsJitted,
prometheus.CounterValue,
float64(process.NumberofMethodsJitted),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TimeinJit,
prometheus.GaugeValue,
float64(process.PercentTimeinJit)/float64(process.Frequency_PerfTime),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.StandardJitFailures,
prometheus.GaugeValue,
float64(process.StandardJitFailures),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalNumberofILBytesJitted,
prometheus.CounterValue,
float64(process.TotalNumberofILBytesJitted),
process.Name,
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkNETFrameworkNETCLRJitCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewNETFramework_NETCLRJitCollector)
}

View File

@@ -1,199 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("netframework_clrloading", NewNETFramework_NETCLRLoadingCollector)
}
// A NETFramework_NETCLRLoadingCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRLoading metrics
type NETFramework_NETCLRLoadingCollector struct {
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
}
// NewNETFramework_NETCLRLoadingCollector ...
func NewNETFramework_NETCLRLoadingCollector() (Collector, error) {
const subsystem = "netframework_clrloading"
return &NETFramework_NETCLRLoadingCollector{
BytesinLoaderHeap: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "loader_heap_size_bytes"),
"Displays the current size, in bytes, of the memory committed by the class loader across all application domains. Committed memory is the physical space reserved in the disk paging file.",
[]string{"process"},
nil,
),
Currentappdomains: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "appdomains_loaded_current"),
"Displays the current number of application domains loaded in this application.",
[]string{"process"},
nil,
),
CurrentAssemblies: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "assemblies_loaded_current"),
"Displays the current number of assemblies loaded across all application domains in the currently running application. If the assembly is loaded as domain-neutral from multiple application domains, this counter is incremented only once.",
[]string{"process"},
nil,
),
CurrentClassesLoaded: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "classes_loaded_current"),
"Displays the current number of classes loaded in all assemblies.",
[]string{"process"},
nil,
),
TotalAppdomains: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "appdomains_loaded_total"),
"Displays the peak number of application domains loaded since the application started.",
[]string{"process"},
nil,
),
Totalappdomainsunloaded: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "appdomains_unloaded_total"),
"Displays the total number of application domains unloaded since the application started. If an application domain is loaded and unloaded multiple times, this counter increments each time the application domain is unloaded.",
[]string{"process"},
nil,
),
TotalAssemblies: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "assemblies_loaded_total"),
"Displays the total number of assemblies loaded since the application started. If the assembly is loaded as domain-neutral from multiple application domains, this counter is incremented only once.",
[]string{"process"},
nil,
),
TotalClassesLoaded: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "classes_loaded_total"),
"Displays the cumulative number of classes loaded in all assemblies since the application started.",
[]string{"process"},
nil,
),
TotalNumberofLoadFailures: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "class_load_failures_total"),
"Displays the peak number of classes that have failed to load since the application started.",
[]string{"process"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NETFramework_NETCLRLoadingCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting win32_perfrawdata_netframework_netclrloading metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_NETFramework_NETCLRLoading struct {
Name string
AssemblySearchLength uint32
BytesinLoaderHeap uint64
Currentappdomains uint32
CurrentAssemblies uint32
CurrentClassesLoaded uint32
PercentTimeLoading uint64
Rateofappdomains uint32
Rateofappdomainsunloaded uint32
RateofAssemblies uint32
RateofClassesLoaded uint32
RateofLoadFailures uint32
TotalAppdomains uint32
Totalappdomainsunloaded uint32
TotalAssemblies uint32
TotalClassesLoaded uint32
TotalNumberofLoadFailures uint32
}
func (c *NETFramework_NETCLRLoadingCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_NETFramework_NETCLRLoading
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, process := range dst {
if process.Name == "_Global_" {
continue
}
ch <- prometheus.MustNewConstMetric(
c.BytesinLoaderHeap,
prometheus.GaugeValue,
float64(process.BytesinLoaderHeap),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Currentappdomains,
prometheus.GaugeValue,
float64(process.Currentappdomains),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.CurrentAssemblies,
prometheus.GaugeValue,
float64(process.CurrentAssemblies),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.CurrentClassesLoaded,
prometheus.GaugeValue,
float64(process.CurrentClassesLoaded),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalAppdomains,
prometheus.CounterValue,
float64(process.TotalAppdomains),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Totalappdomainsunloaded,
prometheus.CounterValue,
float64(process.Totalappdomainsunloaded),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalAssemblies,
prometheus.CounterValue,
float64(process.TotalAssemblies),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalClassesLoaded,
prometheus.CounterValue,
float64(process.TotalClassesLoaded),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalNumberofLoadFailures,
prometheus.CounterValue,
float64(process.TotalNumberofLoadFailures),
process.Name,
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkNETFrameworkNETCLRLoadingCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewNETFramework_NETCLRLoadingCollector)
}

View File

@@ -1,165 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("netframework_clrlocksandthreads", NewNETFramework_NETCLRLocksAndThreadsCollector)
}
// A NETFramework_NETCLRLocksAndThreadsCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads metrics
type NETFramework_NETCLRLocksAndThreadsCollector struct {
CurrentQueueLength *prometheus.Desc
NumberofcurrentlogicalThreads *prometheus.Desc
NumberofcurrentphysicalThreads *prometheus.Desc
Numberofcurrentrecognizedthreads *prometheus.Desc
Numberoftotalrecognizedthreads *prometheus.Desc
QueueLengthPeak *prometheus.Desc
TotalNumberofContentions *prometheus.Desc
}
// NewNETFramework_NETCLRLocksAndThreadsCollector ...
func NewNETFramework_NETCLRLocksAndThreadsCollector() (Collector, error) {
const subsystem = "netframework_clrlocksandthreads"
return &NETFramework_NETCLRLocksAndThreadsCollector{
CurrentQueueLength: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "current_queue_length"),
"Displays the total number of threads that are currently waiting to acquire a managed lock in the application.",
[]string{"process"},
nil,
),
NumberofcurrentlogicalThreads: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "current_logical_threads"),
"Displays the number of current managed thread objects in the application. This counter maintains the count of both running and stopped threads. ",
[]string{"process"},
nil,
),
NumberofcurrentphysicalThreads: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "physical_threads_current"),
"Displays the number of native operating system threads created and owned by the common language runtime to act as underlying threads for managed thread objects. This counter's value does not include the threads used by the runtime in its internal operations; it is a subset of the threads in the operating system process.",
[]string{"process"},
nil,
),
Numberofcurrentrecognizedthreads: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "recognized_threads_current"),
"Displays the number of threads that are currently recognized by the runtime. These threads are associated with a corresponding managed thread object. The runtime does not create these threads, but they have run inside the runtime at least once.",
[]string{"process"},
nil,
),
Numberoftotalrecognizedthreads: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "recognized_threads_total"),
"Displays the total number of threads that have been recognized by the runtime since the application started. These threads are associated with a corresponding managed thread object. The runtime does not create these threads, but they have run inside the runtime at least once.",
[]string{"process"},
nil,
),
QueueLengthPeak: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "queue_length_total"),
"Displays the total number of threads that waited to acquire a managed lock since the application started.",
[]string{"process"},
nil,
),
TotalNumberofContentions: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "contentions_total"),
"Displays the total number of times that threads in the runtime have attempted to acquire a managed lock unsuccessfully.",
[]string{"process"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NETFramework_NETCLRLocksAndThreadsCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting win32_perfrawdata_netframework_netclrlocksandthreads metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads struct {
Name string
ContentionRatePersec uint32
CurrentQueueLength uint32
NumberofcurrentlogicalThreads uint32
NumberofcurrentphysicalThreads uint32
Numberofcurrentrecognizedthreads uint32
Numberoftotalrecognizedthreads uint32
QueueLengthPeak uint32
QueueLengthPersec uint32
RateOfRecognizedThreadsPersec uint32
TotalNumberofContentions uint32
}
func (c *NETFramework_NETCLRLocksAndThreadsCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, process := range dst {
if process.Name == "_Global_" {
continue
}
ch <- prometheus.MustNewConstMetric(
c.CurrentQueueLength,
prometheus.GaugeValue,
float64(process.CurrentQueueLength),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofcurrentlogicalThreads,
prometheus.GaugeValue,
float64(process.NumberofcurrentlogicalThreads),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofcurrentphysicalThreads,
prometheus.GaugeValue,
float64(process.NumberofcurrentphysicalThreads),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Numberofcurrentrecognizedthreads,
prometheus.GaugeValue,
float64(process.Numberofcurrentrecognizedthreads),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Numberoftotalrecognizedthreads,
prometheus.CounterValue,
float64(process.Numberoftotalrecognizedthreads),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.QueueLengthPeak,
prometheus.CounterValue,
float64(process.QueueLengthPeak),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalNumberofContentions,
prometheus.CounterValue,
float64(process.TotalNumberofContentions),
process.Name,
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkNETFrameworkNETCLRLocksAndThreadsCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewNETFramework_NETCLRLocksAndThreadsCollector)
}

View File

@@ -1,303 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("netframework_clrmemory", NewNETFramework_NETCLRMemoryCollector)
}
// A NETFramework_NETCLRMemoryCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRMemory metrics
type NETFramework_NETCLRMemoryCollector struct {
AllocatedBytes *prometheus.Desc
FinalizationSurvivors *prometheus.Desc
HeapSize *prometheus.Desc
PromotedBytes *prometheus.Desc
NumberGCHandles *prometheus.Desc
NumberCollections *prometheus.Desc
NumberInducedGC *prometheus.Desc
NumberofPinnedObjects *prometheus.Desc
NumberofSinkBlocksinuse *prometheus.Desc
NumberTotalCommittedBytes *prometheus.Desc
NumberTotalreservedBytes *prometheus.Desc
TimeinGC *prometheus.Desc
PromotedFinalizationMemoryfromGen0 *prometheus.Desc
PromotedMemoryfromGen0 *prometheus.Desc
PromotedMemoryfromGen1 *prometheus.Desc
}
// NewNETFramework_NETCLRMemoryCollector ...
func NewNETFramework_NETCLRMemoryCollector() (Collector, error) {
const subsystem = "netframework_clrmemory"
return &NETFramework_NETCLRMemoryCollector{
AllocatedBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "allocated_bytes_total"),
"Displays the total number of bytes allocated on the garbage collection heap.",
[]string{"process"},
nil,
),
FinalizationSurvivors: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "finalization_survivors"),
"Displays the number of garbage-collected objects that survive a collection because they are waiting to be finalized.",
[]string{"process"},
nil,
),
HeapSize: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "heap_size_bytes"),
"Displays the maximum bytes that can be allocated; it does not indicate the current number of bytes allocated.",
[]string{"process", "area"},
nil,
),
PromotedBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "promoted_bytes"),
"Displays the bytes that were promoted from the generation to the next one during the last GC. Memory is promoted when it survives a garbage collection.",
[]string{"process", "area"},
nil,
),
NumberGCHandles: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "number_gc_handles"),
"Displays the current number of garbage collection handles in use. Garbage collection handles are handles to resources external to the common language runtime and the managed environment.",
[]string{"process"},
nil,
),
NumberCollections: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "collections_total"),
"Displays the number of times the generation objects are garbage collected since the application started.",
[]string{"process", "area"},
nil,
),
NumberInducedGC: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "induced_gc_total"),
"Displays the peak number of times garbage collection was performed because of an explicit call to GC.Collect.",
[]string{"process"},
nil,
),
NumberofPinnedObjects: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "number_pinned_objects"),
"Displays the number of pinned objects encountered in the last garbage collection.",
[]string{"process"},
nil,
),
NumberofSinkBlocksinuse: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "number_sink_blocksinuse"),
"Displays the current number of synchronization blocks in use. Synchronization blocks are per-object data structures allocated for storing synchronization information. They hold weak references to managed objects and must be scanned by the garbage collector.",
[]string{"process"},
nil,
),
NumberTotalCommittedBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "committed_bytes"),
"Displays the amount of virtual memory, in bytes, currently committed by the garbage collector. Committed memory is the physical memory for which space has been reserved in the disk paging file.",
[]string{"process"},
nil,
),
NumberTotalreservedBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "reserved_bytes"),
"Displays the amount of virtual memory, in bytes, currently reserved by the garbage collector. Reserved memory is the virtual memory space reserved for the application when no disk or main memory pages have been used.",
[]string{"process"},
nil,
),
TimeinGC: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "gc_time_percent"),
"Displays the percentage of time that was spent performing a garbage collection in the last sample.",
[]string{"process"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NETFramework_NETCLRMemoryCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting win32_perfrawdata_netframework_netclrmemory metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_NETFramework_NETCLRMemory struct {
Name string
AllocatedBytesPersec uint64
FinalizationSurvivors uint64
Frequency_PerfTime uint64
Gen0heapsize uint64
Gen0PromotedBytesPerSec uint64
Gen1heapsize uint64
Gen1PromotedBytesPerSec uint64
Gen2heapsize uint64
LargeObjectHeapsize uint64
NumberBytesinallHeaps uint64
NumberGCHandles uint64
NumberGen0Collections uint64
NumberGen1Collections uint64
NumberGen2Collections uint64
NumberInducedGC uint64
NumberofPinnedObjects uint64
NumberofSinkBlocksinuse uint64
NumberTotalcommittedBytes uint64
NumberTotalreservedBytes uint64
PercentTimeinGC uint32
ProcessID uint64
PromotedFinalizationMemoryfromGen0 uint64
PromotedMemoryfromGen0 uint64
PromotedMemoryfromGen1 uint64
}
func (c *NETFramework_NETCLRMemoryCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_NETFramework_NETCLRMemory
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, process := range dst {
if process.Name == "_Global_" {
continue
}
ch <- prometheus.MustNewConstMetric(
c.AllocatedBytes,
prometheus.CounterValue,
float64(process.AllocatedBytesPersec),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.FinalizationSurvivors,
prometheus.GaugeValue,
float64(process.FinalizationSurvivors),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.HeapSize,
prometheus.GaugeValue,
float64(process.Gen0heapsize),
process.Name,
"Gen0",
)
ch <- prometheus.MustNewConstMetric(
c.PromotedBytes,
prometheus.GaugeValue,
float64(process.Gen0PromotedBytesPerSec),
process.Name,
"Gen0",
)
ch <- prometheus.MustNewConstMetric(
c.HeapSize,
prometheus.GaugeValue,
float64(process.Gen1heapsize),
process.Name,
"Gen1",
)
ch <- prometheus.MustNewConstMetric(
c.PromotedBytes,
prometheus.GaugeValue,
float64(process.Gen1PromotedBytesPerSec),
process.Name,
"Gen1",
)
ch <- prometheus.MustNewConstMetric(
c.HeapSize,
prometheus.GaugeValue,
float64(process.Gen2heapsize),
process.Name,
"Gen2",
)
ch <- prometheus.MustNewConstMetric(
c.HeapSize,
prometheus.GaugeValue,
float64(process.LargeObjectHeapsize),
process.Name,
"LOH",
)
ch <- prometheus.MustNewConstMetric(
c.NumberGCHandles,
prometheus.GaugeValue,
float64(process.NumberGCHandles),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberCollections,
prometheus.CounterValue,
float64(process.NumberGen0Collections),
process.Name,
"Gen0",
)
ch <- prometheus.MustNewConstMetric(
c.NumberCollections,
prometheus.CounterValue,
float64(process.NumberGen1Collections),
process.Name,
"Gen1",
)
ch <- prometheus.MustNewConstMetric(
c.NumberCollections,
prometheus.CounterValue,
float64(process.NumberGen2Collections),
process.Name,
"Gen2",
)
ch <- prometheus.MustNewConstMetric(
c.NumberInducedGC,
prometheus.CounterValue,
float64(process.NumberInducedGC),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofPinnedObjects,
prometheus.GaugeValue,
float64(process.NumberofPinnedObjects),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberofSinkBlocksinuse,
prometheus.GaugeValue,
float64(process.NumberofSinkBlocksinuse),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberTotalCommittedBytes,
prometheus.GaugeValue,
float64(process.NumberTotalcommittedBytes),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.NumberTotalreservedBytes,
prometheus.GaugeValue,
float64(process.NumberTotalreservedBytes),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TimeinGC,
prometheus.GaugeValue,
float64(process.PercentTimeinGC)/float64(process.Frequency_PerfTime),
process.Name,
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkNETFrameworkNETCLRMemoryCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewNETFramework_NETCLRMemoryCollector)
}

View File

@@ -1,148 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("netframework_clrremoting", NewNETFramework_NETCLRRemotingCollector)
}
// A NETFramework_NETCLRRemotingCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRRemoting metrics
type NETFramework_NETCLRRemotingCollector struct {
Channels *prometheus.Desc
ContextBoundClassesLoaded *prometheus.Desc
ContextBoundObjects *prometheus.Desc
ContextProxies *prometheus.Desc
Contexts *prometheus.Desc
TotalRemoteCalls *prometheus.Desc
}
// NewNETFramework_NETCLRRemotingCollector ...
func NewNETFramework_NETCLRRemotingCollector() (Collector, error) {
const subsystem = "netframework_clrremoting"
return &NETFramework_NETCLRRemotingCollector{
Channels: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "channels_total"),
"Displays the total number of remoting channels registered across all application domains since application started.",
[]string{"process"},
nil,
),
ContextBoundClassesLoaded: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "context_bound_classes_loaded"),
"Displays the current number of context-bound classes that are loaded.",
[]string{"process"},
nil,
),
ContextBoundObjects: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "context_bound_objects_total"),
"Displays the total number of context-bound objects allocated.",
[]string{"process"},
nil,
),
ContextProxies: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "context_proxies_total"),
"Displays the total number of remoting proxy objects in this process since it started.",
[]string{"process"},
nil,
),
Contexts: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "contexts"),
"Displays the current number of remoting contexts in the application.",
[]string{"process"},
nil,
),
TotalRemoteCalls: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "remote_calls_total"),
"Displays the total number of remote procedure calls invoked since the application started.",
[]string{"process"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NETFramework_NETCLRRemotingCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting win32_perfrawdata_netframework_netclrremoting metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_NETFramework_NETCLRRemoting struct {
Name string
Channels uint32
ContextBoundClassesLoaded uint32
ContextBoundObjectsAllocPersec uint32
ContextProxies uint32
Contexts uint32
RemoteCallsPersec uint32
TotalRemoteCalls uint32
}
func (c *NETFramework_NETCLRRemotingCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_NETFramework_NETCLRRemoting
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, process := range dst {
if process.Name == "_Global_" {
continue
}
ch <- prometheus.MustNewConstMetric(
c.Channels,
prometheus.CounterValue,
float64(process.Channels),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ContextBoundClassesLoaded,
prometheus.GaugeValue,
float64(process.ContextBoundClassesLoaded),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ContextBoundObjects,
prometheus.CounterValue,
float64(process.ContextBoundObjectsAllocPersec),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.ContextProxies,
prometheus.CounterValue,
float64(process.ContextProxies),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.Contexts,
prometheus.GaugeValue,
float64(process.Contexts),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalRemoteCalls,
prometheus.CounterValue,
float64(process.TotalRemoteCalls),
process.Name,
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkNETFrameworkNETCLRRemotingCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewNETFramework_NETCLRRemotingCollector)
}

View File

@@ -1,119 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"github.com/StackExchange/wmi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
registerCollector("netframework_clrsecurity", NewNETFramework_NETCLRSecurityCollector)
}
// A NETFramework_NETCLRSecurityCollector is a Prometheus collector for WMI Win32_PerfRawData_NETFramework_NETCLRSecurity metrics
type NETFramework_NETCLRSecurityCollector struct {
NumberLinkTimeChecks *prometheus.Desc
TimeinRTchecks *prometheus.Desc
StackWalkDepth *prometheus.Desc
TotalRuntimeChecks *prometheus.Desc
}
// NewNETFramework_NETCLRSecurityCollector ...
func NewNETFramework_NETCLRSecurityCollector() (Collector, error) {
const subsystem = "netframework_clrsecurity"
return &NETFramework_NETCLRSecurityCollector{
NumberLinkTimeChecks: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "link_time_checks_total"),
"Displays the total number of link-time code access security checks since the application started.",
[]string{"process"},
nil,
),
TimeinRTchecks: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "rt_checks_time_percent"),
"Displays the percentage of time spent performing runtime code access security checks in the last sample.",
[]string{"process"},
nil,
),
StackWalkDepth: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "stack_walk_depth"),
"Displays the depth of the stack during that last runtime code access security check.",
[]string{"process"},
nil,
),
TotalRuntimeChecks: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "runtime_checks_total"),
"Displays the total number of runtime code access security checks performed since the application started.",
[]string{"process"},
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *NETFramework_NETCLRSecurityCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting win32_perfrawdata_netframework_netclrsecurity metrics:", desc, err)
return err
}
return nil
}
type Win32_PerfRawData_NETFramework_NETCLRSecurity struct {
Name string
Frequency_PerfTime uint32
NumberLinkTimeChecks uint32
PercentTimeinRTchecks uint32
PercentTimeSigAuthenticating uint64
StackWalkDepth uint32
TotalRuntimeChecks uint32
}
func (c *NETFramework_NETCLRSecurityCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
var dst []Win32_PerfRawData_NETFramework_NETCLRSecurity
q := queryAll(&dst)
if err := wmi.Query(q, &dst); err != nil {
return nil, err
}
for _, process := range dst {
if process.Name == "_Global_" {
continue
}
ch <- prometheus.MustNewConstMetric(
c.NumberLinkTimeChecks,
prometheus.CounterValue,
float64(process.NumberLinkTimeChecks),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TimeinRTchecks,
prometheus.GaugeValue,
float64(process.PercentTimeinRTchecks)/float64(process.Frequency_PerfTime),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.StackWalkDepth,
prometheus.GaugeValue,
float64(process.StackWalkDepth),
process.Name,
)
ch <- prometheus.MustNewConstMetric(
c.TotalRuntimeChecks,
prometheus.CounterValue,
float64(process.TotalRuntimeChecks),
process.Name,
)
}
return nil, nil
}

View File

@@ -1,10 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkNETFrameworkNETCLRSecurityCollector(b *testing.B) {
// No context name required as collector source is WMI
benchmarkCollector(b, "", NewNETFramework_NETCLRSecurityCollector)
}

View File

@@ -1,322 +0,0 @@
//go:build windows
// +build windows
package collector
import (
"fmt"
"os"
"strings"
"time"
"github.com/prometheus-community/windows_exporter/headers/netapi32"
"github.com/prometheus-community/windows_exporter/headers/psapi"
"github.com/prometheus-community/windows_exporter/headers/sysinfoapi"
"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/windows/registry"
)
func init() {
registerCollector("os", NewOSCollector, "Paging File")
}
// A OSCollector is a Prometheus collector for WMI metrics
type OSCollector struct {
OSInformation *prometheus.Desc
PhysicalMemoryFreeBytes *prometheus.Desc
PagingFreeBytes *prometheus.Desc
VirtualMemoryFreeBytes *prometheus.Desc
ProcessesLimit *prometheus.Desc
ProcessMemoryLimitBytes *prometheus.Desc
Processes *prometheus.Desc
Users *prometheus.Desc
PagingLimitBytes *prometheus.Desc
VirtualMemoryBytes *prometheus.Desc
VisibleMemoryBytes *prometheus.Desc
Time *prometheus.Desc
Timezone *prometheus.Desc
}
type pagingFileCounter struct {
Name string
Usage float64 `perflib:"% Usage"`
UsagePeak float64 `perflib:"% Usage Peak"`
}
// NewOSCollector ...
func NewOSCollector() (Collector, error) {
const subsystem = "os"
return &OSCollector{
OSInformation: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "info"),
"OperatingSystem.Caption, OperatingSystem.Version",
[]string{"product", "version"},
nil,
),
PagingLimitBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "paging_limit_bytes"),
"OperatingSystem.SizeStoredInPagingFiles",
nil,
nil,
),
PagingFreeBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "paging_free_bytes"),
"OperatingSystem.FreeSpaceInPagingFiles",
nil,
nil,
),
PhysicalMemoryFreeBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "physical_memory_free_bytes"),
"OperatingSystem.FreePhysicalMemory",
nil,
nil,
),
Time: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "time"),
"OperatingSystem.LocalDateTime",
nil,
nil,
),
Timezone: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "timezone"),
"OperatingSystem.LocalDateTime",
[]string{"timezone"},
nil,
),
Processes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "processes"),
"OperatingSystem.NumberOfProcesses",
nil,
nil,
),
ProcessesLimit: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "processes_limit"),
"OperatingSystem.MaxNumberOfProcesses",
nil,
nil,
),
ProcessMemoryLimitBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "process_memory_limit_bytes"),
"OperatingSystem.MaxProcessMemorySize",
nil,
nil,
),
Users: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "users"),
"OperatingSystem.NumberOfUsers",
nil,
nil,
),
VirtualMemoryBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "virtual_memory_bytes"),
"OperatingSystem.TotalVirtualMemorySize",
nil,
nil,
),
VisibleMemoryBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "visible_memory_bytes"),
"OperatingSystem.TotalVisibleMemorySize",
nil,
nil,
),
VirtualMemoryFreeBytes: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "virtual_memory_free_bytes"),
"OperatingSystem.FreeVirtualMemory",
nil,
nil,
),
}, nil
}
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *OSCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ctx, ch); err != nil {
log.Error("failed collecting os metrics:", desc, err)
return err
}
return nil
}
// Win32_OperatingSystem docs:
// - https://msdn.microsoft.com/en-us/library/aa394239 - Win32_OperatingSystem class
type Win32_OperatingSystem struct {
Caption string
FreePhysicalMemory uint64
FreeSpaceInPagingFiles uint64
FreeVirtualMemory uint64
LocalDateTime time.Time
MaxNumberOfProcesses uint32
MaxProcessMemorySize uint64
NumberOfProcesses uint32
NumberOfUsers uint32
SizeStoredInPagingFiles uint64
TotalVirtualMemorySize uint64
TotalVisibleMemorySize uint64
Version string
}
func (c *OSCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
nwgi, err := netapi32.GetWorkstationInfo()
if err != nil {
return nil, err
}
gmse, err := sysinfoapi.GlobalMemoryStatusEx()
if err != nil {
return nil, err
}
currentTime := time.Now()
timezoneName, _ := currentTime.Zone()
// Get total allocation of paging files across all disks.
memManKey, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management`, registry.QUERY_VALUE)
defer memManKey.Close()
if err != nil {
return nil, err
}
pagingFiles, _, err := memManKey.GetStringsValue("ExistingPageFiles")
if err != nil {
return nil, err
}
// Get build number and product name from registry
ntKey, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
defer ntKey.Close()
if err != nil {
return nil, err
}
pn, _, err := ntKey.GetStringValue("ProductName")
if err != nil {
return nil, err
}
bn, _, err := ntKey.GetStringValue("CurrentBuildNumber")
if err != nil {
return nil, err
}
var fsipf float64
for _, pagingFile := range pagingFiles {
fileString := strings.ReplaceAll(pagingFile, `\??\`, "")
file, err := os.Stat(fileString)
if err != nil {
return nil, err
}
fsipf += float64(file.Size())
}
gpi, err := psapi.GetPerformanceInfo()
if err != nil {
return nil, err
}
var pfc = make([]pagingFileCounter, 0)
if err := unmarshalObject(ctx.perfObjects["Paging File"], &pfc); err != nil {
return nil, err
}
// Get current page file usage.
var pfbRaw float64
for _, pageFile := range pfc {
if strings.Contains(strings.ToLower(pageFile.Name), "_total") {
continue
}
pfbRaw += pageFile.Usage
}
// Subtract from total page file allocation on disk.
pfb := fsipf - (pfbRaw * float64(gpi.PageSize))
ch <- prometheus.MustNewConstMetric(
c.OSInformation,
prometheus.GaugeValue,
1.0,
fmt.Sprintf("Microsoft %s", pn), // Caption
fmt.Sprintf("%d.%d.%s", nwgi.VersionMajor, nwgi.VersionMinor, bn), // Version
)
ch <- prometheus.MustNewConstMetric(
c.PhysicalMemoryFreeBytes,
prometheus.GaugeValue,
float64(gmse.AvailPhys),
)
ch <- prometheus.MustNewConstMetric(
c.Time,
prometheus.GaugeValue,
float64(currentTime.Unix()),
)
ch <- prometheus.MustNewConstMetric(
c.Timezone,
prometheus.GaugeValue,
1.0,
timezoneName,
)
ch <- prometheus.MustNewConstMetric(
c.PagingFreeBytes,
prometheus.GaugeValue,
pfb,
)
ch <- prometheus.MustNewConstMetric(
c.VirtualMemoryFreeBytes,
prometheus.GaugeValue,
float64(gmse.AvailPageFile),
)
// Windows has no defined limit, and is based off available resources. This currently isn't calculated by WMI and is set to default value.
// https://techcommunity.microsoft.com/t5/windows-blog-archive/pushing-the-limits-of-windows-processes-and-threads/ba-p/723824
// https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-operatingsystem
ch <- prometheus.MustNewConstMetric(
c.ProcessesLimit,
prometheus.GaugeValue,
float64(4294967295),
)
ch <- prometheus.MustNewConstMetric(
c.ProcessMemoryLimitBytes,
prometheus.GaugeValue,
float64(gmse.TotalVirtual),
)
ch <- prometheus.MustNewConstMetric(
c.Processes,
prometheus.GaugeValue,
float64(gpi.ProcessCount),
)
ch <- prometheus.MustNewConstMetric(
c.Users,
prometheus.GaugeValue,
float64(nwgi.LoggedOnUsers),
)
ch <- prometheus.MustNewConstMetric(
c.PagingLimitBytes,
prometheus.GaugeValue,
fsipf,
)
ch <- prometheus.MustNewConstMetric(
c.VirtualMemoryBytes,
prometheus.GaugeValue,
float64(gmse.TotalPageFile),
)
ch <- prometheus.MustNewConstMetric(
c.VisibleMemoryBytes,
prometheus.GaugeValue,
float64(gmse.TotalPhys),
)
return nil, nil
}

View File

@@ -1,9 +0,0 @@
package collector
import (
"testing"
)
func BenchmarkOSCollector(b *testing.B) {
benchmarkCollector(b, "os", NewOSCollector)
}

View File

@@ -1,107 +0,0 @@
package collector
import (
"fmt"
"reflect"
"strconv"
perflibCollector "github.com/leoluk/perflib_exporter/collector"
"github.com/leoluk/perflib_exporter/perflib"
"github.com/prometheus-community/windows_exporter/log"
)
var nametable = perflib.QueryNameTable("Counter 009") // Reads the names in English TODO: validate that the English names are always present
func MapCounterToIndex(name string) string {
return strconv.Itoa(int(nametable.LookupIndex(name)))
}
func getPerflibSnapshot(objNames string) (map[string]*perflib.PerfObject, error) {
objects, err := perflib.QueryPerformanceData(objNames)
if err != nil {
return nil, err
}
indexed := make(map[string]*perflib.PerfObject)
for _, obj := range objects {
indexed[obj.Name] = obj
}
return indexed, nil
}
func unmarshalObject(obj *perflib.PerfObject, vs interface{}) error {
if obj == nil {
return fmt.Errorf("counter not found")
}
rv := reflect.ValueOf(vs)
if rv.Kind() != reflect.Ptr || rv.IsNil() {
return fmt.Errorf("%v is nil or not a pointer to slice", reflect.TypeOf(vs))
}
ev := rv.Elem()
if ev.Kind() != reflect.Slice {
return fmt.Errorf("%v is not slice", reflect.TypeOf(vs))
}
// Ensure sufficient length
if ev.Cap() < len(obj.Instances) {
nvs := reflect.MakeSlice(ev.Type(), len(obj.Instances), len(obj.Instances))
ev.Set(nvs)
}
for idx, instance := range obj.Instances {
target := ev.Index(idx)
rt := target.Type()
counters := make(map[string]*perflib.PerfCounter, len(instance.Counters))
for _, ctr := range instance.Counters {
if ctr.Def.IsBaseValue && !ctr.Def.IsNanosecondCounter {
counters[ctr.Def.Name+"_Base"] = ctr
} else {
counters[ctr.Def.Name] = ctr
}
}
for i := 0; i < target.NumField(); i++ {
f := rt.Field(i)
tag := f.Tag.Get("perflib")
if tag == "" {
continue
}
ctr, found := counters[tag]
if !found {
log.Debugf("missing counter %q, have %v", tag, counterMapKeys(counters))
continue
}
if !target.Field(i).CanSet() {
return fmt.Errorf("tagged field %v cannot be written to", f.Name)
}
if fieldType := target.Field(i).Type(); fieldType != reflect.TypeOf((*float64)(nil)).Elem() {
return fmt.Errorf("tagged field %v has wrong type %v, must be float64", f.Name, fieldType)
}
switch ctr.Def.CounterType {
case perflibCollector.PERF_ELAPSED_TIME:
target.Field(i).SetFloat(float64(ctr.Value-windowsEpoch) / float64(obj.Frequency))
case perflibCollector.PERF_100NSEC_TIMER, perflibCollector.PERF_PRECISION_100NS_TIMER:
target.Field(i).SetFloat(float64(ctr.Value) * ticksToSecondsScaleFactor)
default:
target.Field(i).SetFloat(float64(ctr.Value))
}
}
if instance.Name != "" && target.FieldByName("Name").CanSet() {
target.FieldByName("Name").SetString(instance.Name)
}
}
return nil
}
func counterMapKeys(m map[string]*perflib.PerfCounter) []string {
keys := make([]string, 0, len(m))
for k := range m {
keys = append(keys, k)
}
return keys
}

Some files were not shown because too many files have changed in this diff Show More