mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
Compare commits
310 Commits
v0.30.0-be
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec6f705410 | ||
|
|
7119da5cf5 | ||
|
|
856c108e7f | ||
|
|
eaecea7797 | ||
|
|
a95df3d6f2 | ||
|
|
3fcdaca34a | ||
|
|
2a3f0ff9d9 | ||
|
|
7dcf0d3137 | ||
|
|
b584539387 | ||
|
|
7cec563af2 | ||
|
|
f0d5fd9ba0 | ||
|
|
2efe98d8ec | ||
|
|
5ab9019509 | ||
|
|
2b4576ecd4 | ||
|
|
9a666ace81 | ||
|
|
27186f7e78 | ||
|
|
0c1336b845 | ||
|
|
f3e50f4db4 | ||
|
|
04714a3fbd | ||
|
|
43bd352cfd | ||
|
|
6e831b0176 | ||
|
|
84dc1977de | ||
|
|
a944cd02a8 | ||
|
|
65ac3585a3 | ||
|
|
0dbea50704 | ||
|
|
7585044277 | ||
|
|
aaf22e7322 | ||
|
|
7671e42c70 | ||
|
|
1e16767afb | ||
|
|
81ff006f08 | ||
|
|
7c586b204d | ||
|
|
5351641287 | ||
|
|
462a495514 | ||
|
|
16ee024a1b | ||
|
|
afe1bfc29d | ||
|
|
ebbad8943b | ||
|
|
3d0587d28c | ||
|
|
a523ef69fd | ||
|
|
cd088325ef | ||
|
|
8fe118bff9 | ||
|
|
81051791e2 | ||
|
|
4fc7402985 | ||
|
|
52efb1c61c | ||
|
|
3a9e227bd9 | ||
|
|
ed11d8e8fa | ||
|
|
402eb6ef4e | ||
|
|
767367edc4 | ||
|
|
370a42b79a | ||
|
|
ccd977177c | ||
|
|
33fe157545 | ||
|
|
9e32f62ca4 | ||
|
|
c26c27a7f4 | ||
|
|
1f43ca4d8f | ||
|
|
d818d96e07 | ||
|
|
7c108ea5be | ||
|
|
bbe0d1aba7 | ||
|
|
1394f2399d | ||
|
|
f4d77803ea | ||
|
|
a19af1b695 | ||
|
|
95bf157049 | ||
|
|
9969618026 | ||
|
|
f2e62c6f53 | ||
|
|
a9b42ab3a4 | ||
|
|
e778eea250 | ||
|
|
c0eb53812d | ||
|
|
21d9fb057d | ||
|
|
f1772a742f | ||
|
|
fcf21bb600 | ||
|
|
cd5f136079 | ||
|
|
4171ec17a5 | ||
|
|
6289499dee | ||
|
|
79917893d1 | ||
|
|
0b8a257b31 | ||
|
|
71cedbc4d0 | ||
|
|
c8a4cb3806 | ||
|
|
558629dff5 | ||
|
|
5a8ebf0c44 | ||
|
|
acbabb926d | ||
|
|
e37392c00b | ||
|
|
00d86ba792 | ||
|
|
691f64f5cc | ||
|
|
19999dea49 | ||
|
|
c2df4d7514 | ||
|
|
8937a5ac91 | ||
|
|
930130f58a | ||
|
|
0e85959a4d | ||
|
|
6253bf812d | ||
|
|
6c2380bd04 | ||
|
|
5266f9ebfe | ||
|
|
6c9a5b66e2 | ||
|
|
c4ab8cb8a5 | ||
|
|
7bcaf81d26 | ||
|
|
5f6ba2c6e7 | ||
|
|
75c85fbde1 | ||
|
|
120c244313 | ||
|
|
0e2d78affe | ||
|
|
f0591d85cd | ||
|
|
255b01f610 | ||
|
|
ab7db07836 | ||
|
|
52056a5cd9 | ||
|
|
524fea08c4 | ||
|
|
6b8c895a68 | ||
|
|
eade0da514 | ||
|
|
b07e866b4a | ||
|
|
98618408ce | ||
|
|
56b9f7fd27 | ||
|
|
8d267336c1 | ||
|
|
fd7070354a | ||
|
|
373d741260 | ||
|
|
ed15b3c671 | ||
|
|
f8805932b2 | ||
|
|
4fd26fa0fa | ||
|
|
bf722630d6 | ||
|
|
9320e992cc | ||
|
|
7a4e92a473 | ||
|
|
02b9ab4058 | ||
|
|
c3043693df | ||
|
|
7377d48f07 | ||
|
|
d64f1316ca | ||
|
|
492f3af317 | ||
|
|
116203fd19 | ||
|
|
66751baef6 | ||
|
|
b02bddd38e | ||
|
|
3dbc19e18b | ||
|
|
be481e8776 | ||
|
|
aea5c5a2fb | ||
|
|
59ac3072b1 | ||
|
|
66cd489c4a | ||
|
|
4891e23d29 | ||
|
|
f285c3d1e2 | ||
|
|
90dac66bf5 | ||
|
|
34cfda306b | ||
|
|
3e8693f1e3 | ||
|
|
036c858355 | ||
|
|
a69720ae1d | ||
|
|
55c877f536 | ||
|
|
dcf85032ca | ||
|
|
e673f192d2 | ||
|
|
298d820bd6 | ||
|
|
89ac99e6a2 | ||
|
|
3e58d0e568 | ||
|
|
5cf1f7e623 | ||
|
|
0580b330a5 | ||
|
|
25915bb289 | ||
|
|
5e1a802237 | ||
|
|
6dd21a8e00 | ||
|
|
92f213ca7c | ||
|
|
ecd7dcfb0d | ||
|
|
87d76b18e9 | ||
|
|
068bcb7237 | ||
|
|
898e16bcb1 | ||
|
|
6b87441729 | ||
|
|
d31f21d5c6 | ||
|
|
c9fc0ee851 | ||
|
|
23894e0ac8 | ||
|
|
36c68320e5 | ||
|
|
931754b39d | ||
|
|
c3739886d1 | ||
|
|
9b41c805a5 | ||
|
|
48d29d8563 | ||
|
|
d899ae7e24 | ||
|
|
bebc44c948 | ||
|
|
bd536e61cc | ||
|
|
ebc60503ae | ||
|
|
055f4a56df | ||
|
|
fd92bfc1c8 | ||
|
|
e584adaf7e | ||
|
|
2d31d604fb | ||
|
|
4d73502752 | ||
|
|
090eed2959 | ||
|
|
769363d157 | ||
|
|
554607fee2 | ||
|
|
256399f25d | ||
|
|
4dcfb77587 | ||
|
|
c47f32fb1f | ||
|
|
17f1f98179 | ||
|
|
f0d5267874 | ||
|
|
85455bd04d | ||
|
|
f1f763bc79 | ||
|
|
c0af21eb1c | ||
|
|
eed95100ec | ||
|
|
896c9439d5 | ||
|
|
e00a3916b8 | ||
|
|
5294b61339 | ||
|
|
415c134f70 | ||
|
|
cb1769cacc | ||
|
|
ba605cffcc | ||
|
|
bf56e99ad2 | ||
|
|
9db4318ea9 | ||
|
|
ef46cd1dbe | ||
|
|
36b6afe4bb | ||
|
|
6471f3985a | ||
|
|
ecc805f0fa | ||
|
|
88c929ac6f | ||
|
|
c3dfd7f960 | ||
|
|
a3e840f960 | ||
|
|
53849a3500 | ||
|
|
970976c61d | ||
|
|
26893d22df | ||
|
|
5fcaa56a9c | ||
|
|
0846c2805f | ||
|
|
fa8af098c8 | ||
|
|
ad98d11326 | ||
|
|
63efa92be7 | ||
|
|
4c7df1ccaf | ||
|
|
19ccdc5731 | ||
|
|
2c548b8675 | ||
|
|
fdc79f675d | ||
|
|
041c2cd170 | ||
|
|
29307eb2b2 | ||
|
|
73ef2d9824 | ||
|
|
d5112d7766 | ||
|
|
bc1b40c679 | ||
|
|
d58f8c59c6 | ||
|
|
53a4e76a4b | ||
|
|
eecc6ce574 | ||
|
|
221cfec732 | ||
|
|
fce1e71cac | ||
|
|
2b96dd5c61 | ||
|
|
a5cbfefc24 | ||
|
|
c14af0ab20 | ||
|
|
4a67810832 | ||
|
|
eceec10237 | ||
|
|
3f2633d0b0 | ||
|
|
5114a5466a | ||
|
|
d6196c5c6b | ||
|
|
0c44a934f4 | ||
|
|
d1151e91f3 | ||
|
|
cbe94c1ea5 | ||
|
|
b809f5a8ee | ||
|
|
756d9c160d | ||
|
|
a0e132b30e | ||
|
|
d645e89be9 | ||
|
|
a73a08d704 | ||
|
|
228164765b | ||
|
|
4c9c78c599 | ||
|
|
4b3c154049 | ||
|
|
be0037eda5 | ||
|
|
367fae95c4 | ||
|
|
96ffc3bf3f | ||
|
|
285c4cc5ea | ||
|
|
f07aceb0dd | ||
|
|
dcacce4577 | ||
|
|
fc5b3051fa | ||
|
|
1b2958a7cc | ||
|
|
a20e1854d1 | ||
|
|
fe21cb44f6 | ||
|
|
71ec0bd6a3 | ||
|
|
8bff623393 | ||
|
|
3eabd0a00c | ||
|
|
73186cde48 | ||
|
|
25e04fc947 | ||
|
|
6b7201856c | ||
|
|
608b83cfd8 | ||
|
|
40a42ca457 | ||
|
|
423c8a787e | ||
|
|
6cefbed7f7 | ||
|
|
5836a7dbf2 | ||
|
|
d31ce0507c | ||
|
|
faa98d2708 | ||
|
|
f0f3d0d96e | ||
|
|
f73a74b678 | ||
|
|
b6f89ad92f | ||
|
|
86e6d12518 | ||
|
|
4cd9627ebf | ||
|
|
81ea4c6223 | ||
|
|
78386557d4 | ||
|
|
a9f8b3b722 | ||
|
|
39c929eefe | ||
|
|
eea5a50d5c | ||
|
|
a9698e27bf | ||
|
|
fac83b3c74 | ||
|
|
0fc926c0b0 | ||
|
|
57a3e84cec | ||
|
|
2aebd5c2da | ||
|
|
109c34f572 | ||
|
|
0ad8e01e0e | ||
|
|
3a3b50f898 | ||
|
|
f5ff75ebc2 | ||
|
|
71e5e5ec5f | ||
|
|
40ff2f2e57 | ||
|
|
9db94aa66a | ||
|
|
a359acb3d1 | ||
|
|
487de0c20b | ||
|
|
aaa4ce07f6 | ||
|
|
a2db81494e | ||
|
|
64bf0a6551 | ||
|
|
40b6f53479 | ||
|
|
ca04ad8fd2 | ||
|
|
fd55ac4894 | ||
|
|
c8eeb595c0 | ||
|
|
1a4c6c5ce7 | ||
|
|
fd76be38e0 | ||
|
|
eff124250f | ||
|
|
1badb34506 | ||
|
|
f9e41294c3 | ||
|
|
86ace68978 | ||
|
|
e812584f27 | ||
|
|
1ecc340659 | ||
|
|
4c0574536f | ||
|
|
26d6dddf25 | ||
|
|
75c6a4c182 | ||
|
|
a602d7be9d | ||
|
|
4534c2a6ae | ||
|
|
3b378136f5 | ||
|
|
85845f4780 | ||
|
|
fdee2d8613 | ||
|
|
8c90961c10 | ||
|
|
2335fba18a | ||
|
|
c6ee794598 |
@@ -11,6 +11,9 @@ tab_width = 4
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[renovate.json]
|
||||
indent_size = 2
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
indent_size = 2
|
||||
|
||||
26
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
26
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
@@ -4,8 +4,12 @@ labels: [ 🐞 bug ]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: Thanks for taking the time to fill out this bug report!
|
||||
|
||||
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: |-
|
||||
@@ -15,18 +19,18 @@ body:
|
||||
```
|
||||
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
|
||||
@@ -36,7 +40,7 @@ body:
|
||||
```...```
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
@@ -44,7 +48,7 @@ body:
|
||||
placeholder: When I do <X>, <Z> should happen instead.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps To Reproduce
|
||||
@@ -57,7 +61,7 @@ body:
|
||||
render: Markdown
|
||||
validations:
|
||||
required: false
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Environment
|
||||
@@ -70,7 +74,7 @@ body:
|
||||
- Windows Server Version:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: windows_exporter logs
|
||||
@@ -80,7 +84,7 @@ body:
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Anything else?
|
||||
|
||||
22
.github/ISSUE_TEMPLATE/question.yaml
vendored
22
.github/ISSUE_TEMPLATE/question.yaml
vendored
@@ -2,6 +2,28 @@ 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
|
||||
|
||||
40
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
40
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal 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
|
||||
15
.github/dependabot.yml
vendored
15
.github/dependabot.yml
vendored
@@ -1,15 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
labels:
|
||||
- "🛠️ dependencies"
|
||||
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
labels:
|
||||
- "🛠️ dependencies"
|
||||
28
.github/workflows/container_description.yml
vendored
28
.github/workflows/container_description.yml
vendored
@@ -18,7 +18,9 @@ jobs:
|
||||
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
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
|
||||
@@ -33,3 +35,27 @@ jobs:
|
||||
# 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: ''
|
||||
|
||||
45
.github/workflows/lint.yml
vendored
45
.github/workflows/lint.yml
vendored
@@ -4,27 +4,13 @@ name: Linting
|
||||
# have been changed.
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
- "**.go"
|
||||
- ".github/workflows/lint.yml"
|
||||
- "tools/e2e-output.txt"
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
- main
|
||||
- "0.*"
|
||||
- "1.*"
|
||||
pull_request:
|
||||
paths:
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
- "**.go"
|
||||
- ".github/workflows/lint.yml"
|
||||
- "tools/e2e-output.txt"
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
- main
|
||||
|
||||
env:
|
||||
VERSION_PROMU: '0.14.0'
|
||||
@@ -32,10 +18,10 @@ env:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
@@ -55,10 +41,10 @@ jobs:
|
||||
run: make e2e-test
|
||||
|
||||
promtool:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
@@ -79,7 +65,7 @@ jobs:
|
||||
run: make promtool
|
||||
|
||||
- name: Upload windows_exporter.exe
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
if: always()
|
||||
with:
|
||||
name: windows_exporter.amd64.exe
|
||||
@@ -88,7 +74,7 @@ jobs:
|
||||
if-no-files-found: error
|
||||
|
||||
lint:
|
||||
runs-on: windows-2022
|
||||
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
|
||||
@@ -96,13 +82,14 @@ jobs:
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- 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@v6
|
||||
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
|
||||
with:
|
||||
version: v1.60
|
||||
args: "--max-same-issues=0"
|
||||
# renovate: github=golangci/golangci-lint
|
||||
version: v2.7.2
|
||||
args: "--max-same-issues=0"
|
||||
|
||||
4
.github/workflows/pr-check.yaml
vendored
4
.github/workflows/pr-check.yaml
vendored
@@ -33,11 +33,11 @@ jobs:
|
||||
name: check title prefix
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- 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" == "feat" ]] || [[ "$PR_TITLE_PREFIX" == "chore" ]] || [[ "$PR_TITLE_PREFIX" == "chore(docs)" ]] || [[ "$PR_TITLE_PREFIX" == "chore(deps)" ]] || [[ "$PR_TITLE_PREFIX" == "*" ]] || [[ "$PR_TITLE_PREFIX" == "Synchronize common files from prometheus/prometheus" ]]; then
|
||||
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
|
||||
|
||||
|
||||
127
.github/workflows/release.yml
vendored
127
.github/workflows/release.yml
vendored
@@ -21,24 +21,26 @@ env:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
runs-on: windows-2025
|
||||
environment: build
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
- name: Install WiX
|
||||
run: dotnet tool install --global wix
|
||||
run: |
|
||||
dotnet tool install --global wix --version 5.0.2
|
||||
|
||||
- name: Install WiX extensions
|
||||
run: |
|
||||
wix extension add -g WixToolset.Util.wixext
|
||||
wix extension add -g WixToolset.Ui.wixext
|
||||
wix extension add -g WixToolset.Firewall.wixext
|
||||
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: |
|
||||
@@ -68,6 +70,40 @@ jobs:
|
||||
|
||||
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"
|
||||
@@ -79,12 +115,49 @@ jobs:
|
||||
}
|
||||
|
||||
Move-Item installer\*.msi output\
|
||||
Get-ChildItem -Path output\
|
||||
Get-ChildItem -Path output\ g
|
||||
|
||||
promu checksum output\
|
||||
- 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@v4
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: windows_exporter_binaries
|
||||
path: |
|
||||
@@ -103,34 +176,37 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
env:
|
||||
DOCKER_BUILD_SUMMARY: false
|
||||
DOCKER_BUILD_RECORD_UPLOAD: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
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@v3
|
||||
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@v3
|
||||
# with:
|
||||
# registry: quay.io
|
||||
# username: ${{ secrets.QUAY_USER }}
|
||||
# password: ${{ secrets.QUAY_PASS }}
|
||||
- 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@v3
|
||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -138,12 +214,12 @@ jobs:
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
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
|
||||
quay.io/prometheuscommunity/windows-exporter
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=ref,event=branch
|
||||
@@ -155,13 +231,14 @@ jobs:
|
||||
org.opencontainers.image.licenses=MIT
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
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 }}
|
||||
|
||||
4
.github/workflows/spelling.yml
vendored
4
.github/workflows/spelling.yml
vendored
@@ -17,10 +17,10 @@ jobs:
|
||||
name: Check for spelling errors
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- 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
|
||||
ignore_words_list: calle,Entires
|
||||
|
||||
2
.github/workflows/stale-close.yml
vendored
2
.github/workflows/stale-close.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
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@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
|
||||
- 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
|
||||
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
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@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
|
||||
- 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
|
||||
|
||||
16
.gitignore
vendored
16
.gitignore
vendored
@@ -4,9 +4,21 @@ VERSION
|
||||
*.un~
|
||||
output/
|
||||
.vscode
|
||||
.idea
|
||||
*.syso
|
||||
installer/*.msi
|
||||
installer/*.log
|
||||
installer/*.wixpdb
|
||||
local/
|
||||
!.idea/inspectionProfiles/Project_Default.xml
|
||||
|
||||
/.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
|
||||
|
||||
189
.golangci.yaml
189
.golangci.yaml
@@ -1,91 +1,146 @@
|
||||
version: "2"
|
||||
linters:
|
||||
enable-all: true
|
||||
default: all
|
||||
disable:
|
||||
- cyclop
|
||||
- depguard
|
||||
- dogsled
|
||||
- dupl
|
||||
- err113
|
||||
- execinquery
|
||||
- exhaustive
|
||||
- exhaustruct
|
||||
- exportloopref
|
||||
- fatcontext
|
||||
- funcorder
|
||||
- funlen
|
||||
- gochecknoglobals
|
||||
- gocognit
|
||||
- goconst
|
||||
- gocyclo
|
||||
- godoclint
|
||||
- godot
|
||||
- gomnd
|
||||
- paralleltest
|
||||
- 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
|
||||
|
||||
run:
|
||||
timeout: 5m
|
||||
Copyright {{ COMPANY }}
|
||||
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
|
||||
|
||||
linters-settings:
|
||||
gosec:
|
||||
excludes:
|
||||
- G101 # Potential hardcoded credentials
|
||||
- G115 # integer overflow conversion
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
gci:
|
||||
sections:
|
||||
- prefix(github.com/prometheus-community/windows_exporter/internal/windowsservice)
|
||||
- standard # Standard section: captures all standard packages.
|
||||
- default # Default section: contains all imports that could not be matched to another section type.
|
||||
custom-order: true
|
||||
tagliatelle:
|
||||
case:
|
||||
use-field-name: true
|
||||
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.
|
||||
gomoddirectives:
|
||||
toolchain-forbidden: true
|
||||
gosec:
|
||||
excludes:
|
||||
- G101
|
||||
- G115
|
||||
govet:
|
||||
enable-all: true
|
||||
disable:
|
||||
- fieldalignment
|
||||
- shadow
|
||||
revive:
|
||||
rules:
|
||||
# Any struct tag type can be used.
|
||||
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
|
||||
json: camel
|
||||
yaml: snake
|
||||
forbidigo:
|
||||
forbid:
|
||||
- "^(fmt\\.Print(|f|ln)|print|println)$"
|
||||
- p: "^syscall\\.(.{1,7}|.{7}[^N]|.{9,})$"
|
||||
msg: use golang.org/x/sys/windows instead of syscall
|
||||
- p: "^windows\\.NewLazyDLL$"
|
||||
msg: use NewLazySystemDLL instead NewLazyDLL
|
||||
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
|
||||
stylecheck:
|
||||
checks: ["all", "-ST1003"]
|
||||
issues:
|
||||
exclude:
|
||||
- don't use underscores in Go names
|
||||
- don't use an underscore in package name
|
||||
- exported type .+ should have comment or be unexported
|
||||
exclude-rules:
|
||||
- # Golint has many capitalisation complaints on WMI class names
|
||||
text: "`?\\w+`? should be `?\\w+`?"
|
||||
linters:
|
||||
- revive
|
||||
- text: "don't use ALL_CAPS in Go names; use CamelCase"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/perfdata/v1/
|
||||
linters:
|
||||
- godox
|
||||
- stylecheck
|
||||
- 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
11
.idea/copyright/profiles_settings.xml
generated
Normal 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
7
.idea/copyright/windows_exporter.xml
generated
Normal 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 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." />
|
||||
<option name="myName" value="windows_exporter" />
|
||||
</copyright>
|
||||
</component>
|
||||
16
.idea/dictionaries/project.xml
generated
Normal file
16
.idea/dictionaries/project.xml
generated
Normal 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
11
.idea/go.imports.xml
generated
Normal 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>
|
||||
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal 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
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -8,6 +8,7 @@ repository:
|
||||
build:
|
||||
binaries:
|
||||
- name: windows_exporter
|
||||
path: ./cmd/windows_exporter
|
||||
tags:
|
||||
all:
|
||||
- trimpath
|
||||
|
||||
30
.run/all.run.xml
Normal file
30
.run/all.run.xml
Normal 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='[{ "name": "memory", "type": "formatted", "object": "Memory", "counters": [{ "name":"Cache Faults/sec", "type":"counter" }]}]'" />
|
||||
<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>
|
||||
82
CONTRIBUTING.md
Normal file
82
CONTRIBUTING.md
Normal 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.
|
||||
1
LICENSE
1
LICENSE
@@ -1,6 +1,7 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Martin Lindhe
|
||||
Copyright (c) 2021 The Prometheus Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
Maintainers in alphabetical order
|
||||
|
||||
* [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
|
||||
|
||||
* [Brian Brazil](https://github.com/brian-brazil)
|
||||
* [Calle Pettersson](https://github.com/carlpett)
|
||||
* [Martin Lindhe](https://github.com/martinlindhe)
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -29,7 +29,7 @@ test:
|
||||
go test -v ./...
|
||||
|
||||
bench:
|
||||
go test -v -bench='benchmarkcollector' ./internal/collectors/{cpu,logical_disk,physical_disk,logon,memory,net,printer,process,service,system,tcp,time}
|
||||
go test -v -bench='benchmarkcollector' ./internal/collectors/{cpu,logical_disk,physical_disk,memory,net,printer,process,service,system,tcp,time}
|
||||
|
||||
lint:
|
||||
golangci-lint -c .golangci.yaml run
|
||||
|
||||
192
README.md
192
README.md
@@ -12,55 +12,53 @@ A Prometheus exporter for Windows machines.
|
||||
|
||||
## Collectors
|
||||
|
||||
Name | Description | Enabled by default
|
||||
---------|-------------|--------------------
|
||||
[ad](docs/collector.ad.md) | Active Directory Domain Services |
|
||||
[adcs](docs/collector.adcs.md) | Active Directory Certificate Services |
|
||||
[adfs](docs/collector.adfs.md) | Active Directory Federation Services |
|
||||
[cache](docs/collector.cache.md) | Cache metrics |
|
||||
[cpu](docs/collector.cpu.md) | CPU usage | ✓
|
||||
[cpu_info](docs/collector.cpu_info.md) | CPU Information |
|
||||
[cs](docs/collector.cs.md) | "Computer System" metrics (system properties, num cpus/total memory) |
|
||||
[container](docs/collector.container.md) | Container metrics |
|
||||
[diskdrive](docs/collector.diskdrive.md) | Diskdrive metrics |
|
||||
[dfsr](docs/collector.dfsr.md) | DFSR metrics |
|
||||
[dhcp](docs/collector.dhcp.md) | DHCP Server |
|
||||
[dns](docs/collector.dns.md) | DNS Server |
|
||||
[exchange](docs/collector.exchange.md) | Exchange metrics |
|
||||
[filetime](docs/collector.filetime.md) | FileTime metrics |
|
||||
[fsrmquota](docs/collector.fsrmquota.md) | Microsoft File Server Resource Manager (FSRM) Quotas collector |
|
||||
[hyperv](docs/collector.hyperv.md) | Hyper-V hosts |
|
||||
[iis](docs/collector.iis.md) | IIS sites and applications |
|
||||
[license](docs/collector.license.md) | Windows license status |
|
||||
[logical_disk](docs/collector.logical_disk.md) | Logical disks, disk I/O | ✓
|
||||
[logon](docs/collector.logon.md) | User logon sessions |
|
||||
[memory](docs/collector.memory.md) | Memory usage metrics | ✓
|
||||
[mscluster](docs/collector.mscluster.md) | MSCluster metrics |
|
||||
[msmq](docs/collector.msmq.md) | MSMQ queues |
|
||||
[mssql](docs/collector.mssql.md) | [SQL Server Performance Objects](https://docs.microsoft.com/en-us/sql/relational-databases/performance-monitor/use-sql-server-objects#SQLServerPOs) metrics |
|
||||
[netframework](docs/collector.netframework.md) | .NET Framework metrics |
|
||||
[net](docs/collector.net.md) | Network interface I/O | ✓
|
||||
[os](docs/collector.os.md) | OS metrics (memory, processes, users) | ✓
|
||||
[pagefile](docs/collector.pagefile.md) | pagefile metrics |
|
||||
[perfdata](docs/collector.perfdata.md) | Custom perfdata metrics |
|
||||
[physical_disk](docs/collector.physical_disk.md) | physical disk metrics | ✓
|
||||
[printer](docs/collector.printer.md) | Printer metrics |
|
||||
[process](docs/collector.process.md) | Per-process metrics |
|
||||
[remote_fx](docs/collector.remote_fx.md) | RemoteFX protocol (RDP) metrics |
|
||||
[scheduled_task](docs/collector.scheduled_task.md) | Scheduled Tasks metrics |
|
||||
[service](docs/collector.service.md) | Service state metrics | ✓
|
||||
[smb](docs/collector.smb.md) | SMB Server |
|
||||
[smbclient](docs/collector.smbclient.md) | SMB Client |
|
||||
[smtp](docs/collector.smtp.md) | IIS SMTP Server |
|
||||
[system](docs/collector.system.md) | System calls | ✓
|
||||
[tcp](docs/collector.tcp.md) | TCP connections |
|
||||
[terminal_services](docs/collector.terminal_services.md) | Terminal services (RDS)
|
||||
[textfile](docs/collector.textfile.md) | Read prometheus metrics from a text file |
|
||||
[thermalzone](docs/collector.thermalzone.md) | Thermal information |
|
||||
[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 |
|
||||
| Name | Description | Enabled by default |
|
||||
|------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
|
||||
| [ad](docs/collector.ad.md) | Active Directory Domain Services | |
|
||||
| [adcs](docs/collector.adcs.md) | Active Directory Certificate Services | |
|
||||
| [adfs](docs/collector.adfs.md) | Active Directory Federation Services | |
|
||||
| [cache](docs/collector.cache.md) | Cache metrics | |
|
||||
| [cpu](docs/collector.cpu.md) | CPU usage | ✓ |
|
||||
| [cpu_info](docs/collector.cpu_info.md) | CPU Information | |
|
||||
| [container](docs/collector.container.md) | Container metrics | |
|
||||
| [diskdrive](docs/collector.diskdrive.md) | Diskdrive metrics | |
|
||||
| [dfsr](docs/collector.dfsr.md) | DFSR metrics | |
|
||||
| [dhcp](docs/collector.dhcp.md) | DHCP Server | |
|
||||
| [dns](docs/collector.dns.md) | DNS Server | |
|
||||
| [exchange](docs/collector.exchange.md) | Exchange metrics | |
|
||||
| [file](docs/collector.file.md) | File metrics | |
|
||||
| [fsrmquota](docs/collector.fsrmquota.md) | Microsoft File Server Resource Manager (FSRM) Quotas collector | |
|
||||
| [gpu](docs/collector.gpu.md) | GPU metrics | |
|
||||
| [hyperv](docs/collector.hyperv.md) | Hyper-V hosts | |
|
||||
| [iis](docs/collector.iis.md) | IIS sites and applications | |
|
||||
| [license](docs/collector.license.md) | Windows license status | |
|
||||
| [logical_disk](docs/collector.logical_disk.md) | Logical disks, disk I/O | ✓ |
|
||||
| [memory](docs/collector.memory.md) | Memory usage metrics | ✓ |
|
||||
| [mscluster](docs/collector.mscluster.md) | MSCluster metrics | |
|
||||
| [msmq](docs/collector.msmq.md) | MSMQ queues | |
|
||||
| [mssql](docs/collector.mssql.md) | [SQL Server Performance Objects](https://docs.microsoft.com/en-us/sql/relational-databases/performance-monitor/use-sql-server-objects#SQLServerPOs) metrics | |
|
||||
| [netframework](docs/collector.netframework.md) | .NET Framework metrics | |
|
||||
| [net](docs/collector.net.md) | Network interface I/O | ✓ |
|
||||
| [os](docs/collector.os.md) | OS metrics (memory, processes, users) | ✓ |
|
||||
| [pagefile](docs/collector.pagefile.md) | pagefile metrics | |
|
||||
| [performancecounter](docs/collector.performancecounter.md) | Custom performance counter metrics | |
|
||||
| [physical_disk](docs/collector.physical_disk.md) | physical disk metrics | ✓ |
|
||||
| [printer](docs/collector.printer.md) | Printer metrics | |
|
||||
| [process](docs/collector.process.md) | Per-process metrics | |
|
||||
| [remote_fx](docs/collector.remote_fx.md) | RemoteFX protocol (RDP) metrics | |
|
||||
| [scheduled_task](docs/collector.scheduled_task.md) | Scheduled Tasks metrics | |
|
||||
| [service](docs/collector.service.md) | Service state metrics | ✓ |
|
||||
| [smb](docs/collector.smb.md) | SMB Server | |
|
||||
| [smbclient](docs/collector.smbclient.md) | SMB Client | |
|
||||
| [smtp](docs/collector.smtp.md) | IIS SMTP Server | |
|
||||
| [system](docs/collector.system.md) | System calls | ✓ |
|
||||
| [tcp](docs/collector.tcp.md) | TCP connections | |
|
||||
| [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.
|
||||
|
||||
@@ -83,23 +81,23 @@ 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.
|
||||
|
||||
| Flag | Description | Default value |
|
||||
|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
|
||||
| `--web.listen-address` | host:port for exporter. | `:9182` |
|
||||
| `--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.print` | If true, print available collectors and exit. | |
|
||||
| `--scrape.timeout-margin` | Seconds to subtract from the timeout allowed by the client. Tune to allow for overhead or high loads. | `0.5` |
|
||||
| `--web.config.file` | A [web config][web_config] for setting up TLS and Auth | None |
|
||||
| `--config.file` | [Using a config file](#using-a-configuration-file) from path or URL | None |
|
||||
| `--config.file.insecure-skip-verify` | Skip TLS when loading config file from URL | false |
|
||||
| `--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 |
|
||||
| Flag | Description | Default value |
|
||||
|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
|
||||
| `--web.listen-address` | host:port for exporter. | `:9182` |
|
||||
| `--telemetry.path` | URL path for surfacing collected metrics. | `/metrics` |
|
||||
| `--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` |
|
||||
| `--web.config.file` | A [web config][web_config] for setting up TLS and Auth | None |
|
||||
| `--config.file` | [Using a config file](#using-a-configuration-file) from path | 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
|
||||
|
||||
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.
|
||||
|
||||
If the installer is run without any parameters, the exporter will run with default settings for enabled collectors, ports, etc.
|
||||
@@ -113,18 +111,22 @@ The configuration file
|
||||
|
||||
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, no config file will be set. The special value `config.yaml` set the path to the config.yaml at install dir | |
|
||||
| `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` |
|
||||
| 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.
|
||||
@@ -145,10 +147,15 @@ Define a config file.
|
||||
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,logon,memory,process,tcp,textfile,thermalzone" TEXTFILE_DIRS="C:\custom_metrics\"
|
||||
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:
|
||||
@@ -170,15 +177,12 @@ The windows_exporter can be run as a Docker container. The Docker image is avail
|
||||
|
||||
* [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` -->
|
||||
* [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.
|
||||
|
||||
Additionally, a flavor `hostprocess` with `-hostprocess` as suffix is based on the https://github.com/microsoft/windows-host-process-containers-base-image
|
||||
which is designed to run as a Windows host process container. The size of that images is smaller than the default one.
|
||||
|
||||
## Kubernetes Implementation
|
||||
|
||||
See detailed steps to install on Windows Kubernetes [here](./kubernetes/kubernetes.md).
|
||||
@@ -187,29 +191,15 @@ See detailed steps to install on Windows Kubernetes [here](./kubernetes/kubernet
|
||||
|
||||
`windows_exporter` supports Windows Server versions 2016 and later, and desktop Windows version 10 and 11 (21H2 or later).
|
||||
|
||||
Windows Server 2012 and 2012R2 are supported as best-effort only, but not guaranteed to work.
|
||||
There are known compatibility issues with Windows Server 2012 R2 and earlier versions.
|
||||
|
||||
## Usage
|
||||
### HTTP Endpoints
|
||||
|
||||
go get -u github.com/prometheus/promu
|
||||
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
|
||||
windows_exporter provides the following HTTP endpoints:
|
||||
|
||||
The prometheus metrics will be exposed on [localhost:9182](http://localhost:9182)
|
||||
|
||||
## Examples
|
||||
|
||||
### Enable only service collector and specify a custom query
|
||||
|
||||
.\windows_exporter.exe --collectors.enabled "service" --collector.service.include="windows_exporter"
|
||||
|
||||
### Enable only process collector and specify a custom query
|
||||
|
||||
.\windows_exporter.exe --collectors.enabled "process" --collector.process.include="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.
|
||||
* `/metrics`: Exposes metrics in the [Prometheus text format](https://prometheus.io/docs/instrumenting/exposition_formats/).
|
||||
* `/health`: Returns 200 OK when the exporter is running.
|
||||
* `/debug/pprof/`: Exposes the [pprof](https://golang.org/pkg/net/http/pprof/) endpoints. Only, if `--debug.enabled` is set.
|
||||
|
||||
### Using [defaults] with `--collectors.enabled` argument
|
||||
|
||||
@@ -223,10 +213,6 @@ This enables the additional process and container collectors on top of the defau
|
||||
|
||||
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"`
|
||||
|
||||
It is also possible to load the configuration from a URL. e.g. `.\windows_exporter.exe --config.file="https://example.com/config.yml"`
|
||||
|
||||
If you need to skip TLS verification, you can use the `--config.file.insecure-skip-verify` flag. e.g. `.\windows_exporter.exe --config.file="https://example.com/config.yml" --config.file.insecure-skip-verify`
|
||||
|
||||
```yaml
|
||||
collectors:
|
||||
enabled: cpu,net,service
|
||||
@@ -243,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.
|
||||
|
||||
`.\windows_exporter.exe --collectors.enabled=cpu,logon`
|
||||
`.\windows_exporter.exe --collectors.enabled=cpu`
|
||||
|
||||
```yaml
|
||||
log:
|
||||
|
||||
215
cmd/windows_exporter/0_service.go
Normal file
215
cmd/windows_exporter/0_service.go
Normal 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(¤tProcess), 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
|
||||
}
|
||||
23
cmd/windows_exporter/doc.go
Normal file
23
cmd/windows_exporter/doc.go
Normal 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
|
||||
@@ -1,15 +1,25 @@
|
||||
// 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
|
||||
|
||||
//goland:noinspection GoUnsortedImport
|
||||
//nolint:gofumpt
|
||||
import (
|
||||
// Its important that we do these first so that we can register with the Windows service control ASAP to avoid timeouts.
|
||||
"github.com/prometheus-community/windows_exporter/internal/windowsservice"
|
||||
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -20,6 +30,7 @@ import (
|
||||
"os/signal"
|
||||
"os/user"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -29,6 +40,7 @@ import (
|
||||
"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"
|
||||
@@ -37,20 +49,26 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
exitCode := run()
|
||||
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 !windowsservice.IsService {
|
||||
if !IsService {
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
|
||||
windowsservice.ExitCodeCh <- exitCode
|
||||
exitCodeCh <- exitCode
|
||||
|
||||
// Wait for the service control manager to signal that we are done.
|
||||
<-windowsservice.StopCh
|
||||
<-serviceManagerFinishedCh
|
||||
}
|
||||
|
||||
func run() int {
|
||||
func run(ctx context.Context, args []string) int {
|
||||
startTime := time.Now()
|
||||
|
||||
app := kingpin.New("windows_exporter", "A metrics collector for Windows.")
|
||||
|
||||
var (
|
||||
@@ -58,10 +76,6 @@ func run() int {
|
||||
"config.file",
|
||||
"YAML configuration file to use. Values set in this file will be overridden by CLI flags.",
|
||||
).String()
|
||||
insecureSkipVerify = app.Flag(
|
||||
"config.file.insecure-skip-verify",
|
||||
"Skip TLS verification in loading YAML configuration.",
|
||||
).Default("false").Bool()
|
||||
webConfig = webflag.AddFlags(app, ":9182")
|
||||
metricsPath = app.Flag(
|
||||
"telemetry.path",
|
||||
@@ -71,14 +85,14 @@ func run() int {
|
||||
"web.disable-exporter-metrics",
|
||||
"Exclude metrics about the exporter itself (promhttp_*, process_*, go_*).",
|
||||
).Bool()
|
||||
maxRequests = app.Flag(
|
||||
"telemetry.max-requests",
|
||||
"Maximum number of concurrent requests. 0 to disable.",
|
||||
).Default("5").Int()
|
||||
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.",
|
||||
@@ -91,9 +105,20 @@ func run() int {
|
||||
"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()
|
||||
)
|
||||
|
||||
logConfig := &log.Config{}
|
||||
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"))
|
||||
@@ -102,74 +127,34 @@ func run() int {
|
||||
// Initialize collectors before loading and parsing CLI arguments
|
||||
collectors := collector.NewWithFlags(app)
|
||||
|
||||
// Load values from configuration file(s). Executable flags must first be parsed, in order
|
||||
// to load the specified file(s).
|
||||
if _, err := app.Parse(os.Args[1:]); err != nil {
|
||||
if err := config.Parse(app, args); err != nil {
|
||||
//nolint:sloglint // we do not have an logger yet
|
||||
slog.Error("Failed to parse CLI args",
|
||||
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 {
|
||||
//nolint:sloglint // we do not have an logger yet
|
||||
slog.Error("failed to create logger",
|
||||
logger.LogAttrs(ctx, slog.LevelError, "failed to create logger",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
if *configFile != "" {
|
||||
resolver, err := config.NewResolver(*configFile, logger, *insecureSkipVerify)
|
||||
if err != nil {
|
||||
logger.Error("could not load config file",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
logger.LogAttrs(ctx, slog.LevelDebug, "logging has Started")
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
if err = resolver.Bind(app, os.Args[1:]); err != nil {
|
||||
logger.Error("Failed to bind configuration",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
// NOTE: This is temporary fix for issue #1092, calling kingpin.Parse
|
||||
// twice makes slices flags duplicate its value, this clean up
|
||||
// the first parse before the second call.
|
||||
*webConfig.WebListenAddresses = (*webConfig.WebListenAddresses)[1:]
|
||||
|
||||
// Parse flags once more to include those discovered in configuration file(s).
|
||||
if _, err = app.Parse(os.Args[1:]); err != nil {
|
||||
logger.Error("Failed to parse CLI args from YAML file",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
logger, err = log.New(logConfig)
|
||||
if err != nil {
|
||||
//nolint:sloglint // we do not have an logger yet
|
||||
slog.Error("failed to create logger",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
return 1
|
||||
}
|
||||
if configFile != nil && *configFile != "" {
|
||||
logger.LogAttrs(ctx, slog.LevelInfo, "using configuration file: "+*configFile)
|
||||
}
|
||||
|
||||
logger.Debug("Logging has Started")
|
||||
|
||||
if err = setPriorityWindows(logger, os.Getpid(), *processPriority); err != nil {
|
||||
logger.Error("failed to set process priority",
|
||||
if err = setPriorityWindows(ctx, logger, os.Getpid(), *processPriority); err != nil {
|
||||
logger.LogAttrs(ctx, slog.LevelError, "failed to set process priority",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
@@ -178,25 +163,31 @@ func run() int {
|
||||
|
||||
enabledCollectorList := expandEnabledCollectors(*enabledCollectors)
|
||||
if err := collectors.Enable(enabledCollectorList); err != nil {
|
||||
logger.Error("Couldn't enable collectors",
|
||||
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(logger); err != nil {
|
||||
logger.Error("Couldn't load collectors",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
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
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
logCurrentUser(logger)
|
||||
logCurrentUser(ctx, logger)
|
||||
|
||||
logger.Info("Enabled collectors: " + strings.Join(enabledCollectorList, ", "))
|
||||
logger.InfoContext(ctx, "Enabled collectors: "+strings.Join(enabledCollectorList, ", "))
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("GET /health", httphandler.NewHealthHandler())
|
||||
@@ -204,7 +195,6 @@ func run() int {
|
||||
mux.Handle("GET "+*metricsPath, httphandler.New(logger, collectors, &httphandler.Options{
|
||||
DisableExporterMetrics: *disableExporterMetrics,
|
||||
TimeoutMargin: *timeoutMargin,
|
||||
MaxRequests: *maxRequests,
|
||||
}))
|
||||
|
||||
if *debugEnabled {
|
||||
@@ -215,7 +205,7 @@ func run() int {
|
||||
mux.HandleFunc("GET /debug/pprof/trace", pprof.Trace)
|
||||
}
|
||||
|
||||
logger.Info("Starting windows_exporter",
|
||||
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()),
|
||||
@@ -242,17 +232,14 @@ func run() int {
|
||||
close(errCh)
|
||||
}()
|
||||
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill)
|
||||
defer stop()
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
logger.Info("Shutting down windows_exporter via kill signal")
|
||||
case <-windowsservice.StopCh:
|
||||
logger.Info("Shutting down windows_exporter via service control")
|
||||
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.Error("Failed to start windows_exporter",
|
||||
logger.LogAttrs(ctx, slog.LevelError, "Failed to start windows_exporter",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
@@ -263,32 +250,39 @@ func run() int {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
_ = server.Shutdown(ctx)
|
||||
|
||||
logger.Info("windows_exporter has shut down")
|
||||
//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(logger *slog.Logger) {
|
||||
func logCurrentUser(ctx context.Context, logger *slog.Logger) {
|
||||
u, err := user.Current()
|
||||
if err != nil {
|
||||
logger.Warn("Unable to determine which user is running this exporter. More info: https://github.com/golang/go/issues/37348",
|
||||
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.Info("Running as " + u.Username)
|
||||
logger.LogAttrs(ctx, slog.LevelInfo, "Running as "+u.Username)
|
||||
|
||||
if strings.Contains(u.Username, "ContainerAdministrator") || strings.Contains(u.Username, "ContainerUser") {
|
||||
logger.Warn("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.")
|
||||
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(logger *slog.Logger, pid int, priority string) error {
|
||||
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,
|
||||
@@ -302,11 +296,11 @@ func setPriorityWindows(logger *slog.Logger, pid int, priority string) error {
|
||||
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 {
|
||||
if !ok || winPriority == windows.NORMAL_PRIORITY_CLASS {
|
||||
return nil
|
||||
}
|
||||
|
||||
logger.Debug("setting process priority to " + priority)
|
||||
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(
|
||||
199
cmd/windows_exporter/main_test.go
Normal file
199
cmd/windows_exporter/main_test.go
Normal 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)
|
||||
}
|
||||
BIN
cmd/windows_exporter/winres/icon.png
Normal file
BIN
cmd/windows_exporter/winres/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
56
cmd/windows_exporter/winres/winres.json
Normal file
56
cmd/windows_exporter/winres/winres.json
Normal 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": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
config.yaml
20
config.yaml
@@ -1,9 +1,27 @@
|
||||
# example configuration file for windows_exporter
|
||||
|
||||
collectors:
|
||||
enabled: cpu,cpu_info,exchange,iis,logical_disk,logon,memory,net,os,process,remote_fx,service,system,tcp,time,terminal_services,textfile
|
||||
enabled: cpu,cpu_info,exchange,iis,logical_disk,memory,net,os,performancecounter,process,remote_fx,service,system,tcp,time,terminal_services,textfile
|
||||
collector:
|
||||
textfile:
|
||||
directories:
|
||||
- 'C:\MyDir1'
|
||||
- 'C:\MyDir2'
|
||||
service:
|
||||
include: "windows_exporter"
|
||||
performancecounter:
|
||||
objects: |-
|
||||
- name: photon_udp
|
||||
object: "Photon Socket Server: UDP"
|
||||
instances: ["*"]
|
||||
counters:
|
||||
- name: "UDP: Datagrams in"
|
||||
metric: "photon_udp_datagrams"
|
||||
labels:
|
||||
direction: "in"
|
||||
- name: "UDP: Datagrams out"
|
||||
metric: "photon_udp_datagrams"
|
||||
labels:
|
||||
direction: "out"
|
||||
log:
|
||||
level: warn
|
||||
|
||||
13
dashboard/README.md
Normal file
13
dashboard/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
## Sample dashboard for Windows Exporter
|
||||
|
||||
This sample dashboard is heavily inspired by [this dashboard in Chinese](https://grafana.com/grafana/dashboards/10467-windows-exporter-for-prometheus-dashboard-cn-v20230531/).
|
||||
|
||||
First row shows an Overview of your Windows landscape.
|
||||
<br/>
|
||||

|
||||
|
||||
Second row provides resource details about specific Windows VM picked from the variables at the top.
|
||||
<br/>
|
||||

|
||||
<br/>
|
||||

|
||||
BIN
dashboard/dashboard-overview.png
Normal file
BIN
dashboard/dashboard-overview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
BIN
dashboard/resource-details-part1.png
Normal file
BIN
dashboard/resource-details-part1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 649 KiB |
BIN
dashboard/resource-details-part2.png
Normal file
BIN
dashboard/resource-details-part2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 511 KiB |
4522
dashboard/windows-exporter-dashboard.json
Normal file
4522
dashboard/windows-exporter-dashboard.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,17 +9,17 @@ This directory contains documentation of the collectors in the windows_exporter,
|
||||
- [`container`](collector.container.md)
|
||||
- [`cpu`](collector.cpu.md)
|
||||
- [`cpu_info`](collector.cpu_info.md)
|
||||
- [`cs`](collector.cs.md)
|
||||
- [`dfsr`](collector.dfsr.md)
|
||||
- [`dhcp`](collector.dhcp.md)
|
||||
- [`diskdrive`](collector.diskdrive.md)
|
||||
- [`dns`](collector.dns.md)
|
||||
- [`exchange`](collector.exchange.md)
|
||||
- [`file`](collector.file.md)
|
||||
- [`fsrmquota`](collector.fsrmquota.md)
|
||||
- [`hyperv`](collector.hyperv.md)
|
||||
- [`iis`](collector.iis.md)
|
||||
- [`license`](collector.license.md)
|
||||
- [`logical_disk`](collector.logical_disk.md)
|
||||
- [`logon`](collector.logon.md)
|
||||
- [`memory`](collector.memory.md)
|
||||
- [`mscluster`](collector.mscluster.md)
|
||||
- [`msmq`](collector.msmq.md)
|
||||
@@ -28,18 +28,21 @@ This directory contains documentation of the collectors in the windows_exporter,
|
||||
- [`netframework`](collector.netframework.md)
|
||||
- [`nps`](collector.nps.md)
|
||||
- [`os`](collector.os.md)
|
||||
- [`pagefile`](collector.pagefile.md)
|
||||
- [`performancecounter`](collector.performancecounter.md)
|
||||
- [`physical_disk`](collector.physical_disk.md)
|
||||
- [`printer`](collector.printer.md)
|
||||
- [`process`](collector.process.md)
|
||||
- [`remote_fx`](collector.remote_fx.md)
|
||||
- [`scheduled_task`](collector.scheduled_task.md)
|
||||
- [`service`](collector.service.md)
|
||||
- [`smb`](collector.smb.md)
|
||||
- [`smbclient`](collector.smbclient.md)
|
||||
- [`smtp`](collector.smtp.md)
|
||||
- [`system`](collector.system.md)
|
||||
- [`tcp`](collector.tcp.md)
|
||||
- [`terminal_services`](collector.terminal_services.md)
|
||||
- [`textfile`](collector.textfile.md)
|
||||
- [`thermalzone`](collector.thermalzone.md)
|
||||
- [`time`](collector.time.md)
|
||||
- [`udp`](collector.udp.md)
|
||||
- [`update`](collector.update.md)
|
||||
|
||||
@@ -5,7 +5,7 @@ The container collector exposes metrics about containers running on a Hyper-V sy
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `container`
|
||||
Data source | [hcsshim](https://github.com/Microsoft/hcsshim)
|
||||
Data source | [HCS](https://learn.microsoft.com/en-us/virtualization/api/hcs/overview)
|
||||
Enabled by default? | No
|
||||
|
||||
## Flags
|
||||
@@ -14,26 +14,26 @@ None
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_container_available` | Available | counter | `container_id`
|
||||
`windows_container_count` | Number of containers | gauge | `container_id`
|
||||
`windows_container_cpu_usage_seconds_kernelmode` | Run time in Kernel mode in Seconds | counter | `container_id`
|
||||
`windows_container_cpu_usage_seconds_usermode` | Run Time in User mode in Seconds | counter | `container_id`
|
||||
`windows_container_cpu_usage_seconds_total` | Total Run time in Seconds | counter | `container_id`
|
||||
`windows_container_memory_usage_commit_bytes` | Memory Usage Commit Bytes | gauge | `container_id`
|
||||
`windows_container_memory_usage_commit_peak_bytes` | Memory Usage Commit Peak Bytes | gauge | `container_id`
|
||||
`windows_container_memory_usage_private_working_set_bytes` | Memory Usage Private Working Set Bytes | gauge | `container_id`
|
||||
`windows_container_network_receive_bytes_total` | Bytes Received on Interface | counter | `container_id`, `interface`
|
||||
`windows_container_network_receive_packets_total` | Packets Received on Interface | counter | `container_id`, `interface`
|
||||
`windows_container_network_receive_packets_dropped_total` | Dropped Incoming Packets on Interface | counter | `container_id`, `interface`
|
||||
`windows_container_network_transmit_bytes_total` | Bytes Sent on Interface | counter | `container_id`, `interface`
|
||||
`windows_container_network_transmit_packets_total` | Packets Sent on Interface | counter | `container_id`, `interface`
|
||||
`windows_container_network_transmit_packets_dropped_total` | Dropped Outgoing Packets on Interface | counter | `container_id`, `interface`
|
||||
`windows_container_storage_read_count_normalized_total` | Read Count Normalized | counter | `container_id`
|
||||
`windows_container_storage_read_size_bytes_total` | Read Size Bytes | counter | `container_id`
|
||||
`windows_container_storage_write_count_normalized_total` | Write Count Normalized | counter | `container_id`
|
||||
`windows_container_storage_write_size_bytes_total` | Write Size Bytes | counter | `container_id`
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------------------------|----------------------------------------|---------|----------------------------------------------------------|
|
||||
| `windows_container_available` | Available | counter | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_count` | Number of containers | gauge | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_cpu_usage_seconds_kernelmode` | Run time in Kernel mode in Seconds | counter | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_cpu_usage_seconds_usermode` | Run Time in User mode in Seconds | counter | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_cpu_usage_seconds_total` | Total Run time in Seconds | counter | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_memory_usage_commit_bytes` | Memory Usage Commit Bytes | gauge | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_memory_usage_commit_peak_bytes` | Memory Usage Commit Peak Bytes | gauge | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_memory_usage_private_working_set_bytes` | Memory Usage Private Working Set Bytes | gauge | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_network_receive_bytes_total` | Bytes Received on Interface | counter | `container_id`,`namespace`,`pod`,`container`,`interface` |
|
||||
| `windows_container_network_receive_packets_total` | Packets Received on Interface | counter | `container_id`,`namespace`,`pod`,`container`,`interface` |
|
||||
| `windows_container_network_receive_packets_dropped_total` | Dropped Incoming Packets on Interface | counter | `container_id`,`namespace`,`pod`,`container`,`interface` |
|
||||
| `windows_container_network_transmit_bytes_total` | Bytes Sent on Interface | counter | `container_id`,`namespace`,`pod`,`container`,`interface` |
|
||||
| `windows_container_network_transmit_packets_total` | Packets Sent on Interface | counter | `container_id`,`namespace`,`pod`,`container`,`interface` |
|
||||
| `windows_container_network_transmit_packets_dropped_total` | Dropped Outgoing Packets on Interface | counter | `container_id`,`namespace`,`pod`,`container`,`interface` |
|
||||
| `windows_container_storage_read_count_normalized_total` | Read Count Normalized | counter | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_storage_read_size_bytes_total` | Read Size Bytes | counter | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_storage_write_count_normalized_total` | Write Count Normalized | counter | `container_id`,`namespace`,`pod`,`container`, |
|
||||
| `windows_container_storage_write_size_bytes_total` | Write Size Bytes | counter | `container_id`,`namespace`,`pod`,`container`, |
|
||||
|
||||
### Example metric
|
||||
_windows_container_network_receive_bytes_total{container_id="docker://1bd30e8b8ac28cbd76a9b697b4d7bb9d760267b0733d1bc55c60024e98d1e43e",interface="822179E7-002C-4280-ABBA-28BCFE401826"} 9.3305343e+07_
|
||||
|
||||
@@ -48,6 +48,27 @@ Show per-cpu utilisation using the processor utility metrics
|
||||
```
|
||||
rate(windows_cpu_processor_utility_total{instance="localhost"}[5m]) / rate(windows_cpu_processor_rtc_total{instance="localhost"}[5m])
|
||||
```
|
||||
Show average CPU utilization percentage (like Windows Task Manager)
|
||||
```
|
||||
sum by (instance) (
|
||||
clamp_max(
|
||||
(
|
||||
rate(windows_cpu_processor_utility_total{
|
||||
job=~"$job",
|
||||
}[1m])
|
||||
/
|
||||
rate(windows_cpu_processor_rtc_total{
|
||||
job=~"$job",
|
||||
}[1m])
|
||||
), 100
|
||||
)
|
||||
) /
|
||||
count by (instance) (
|
||||
windows_cpu_processor_utility_total{
|
||||
job=~"$job"
|
||||
}
|
||||
)
|
||||
```
|
||||
Show actual average CPU frequency in Hz
|
||||
```
|
||||
avg by(instance) (
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# cs collector
|
||||
|
||||
> [!CAUTION]
|
||||
> This collector is deprecated and will be removed in a future release.
|
||||
> See https://github.com/prometheus-community/windows_exporter/pull/1596 for more information.
|
||||
|
||||
The cs collector exposes metrics detailing the hardware of the computer system
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `cs`
|
||||
Classes | [`Win32_ComputerSystem`](https://msdn.microsoft.com/en-us/library/aa394102)
|
||||
Enabled by default? | Yes
|
||||
|
||||
## Flags
|
||||
|
||||
None
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_cs_logical_processors` | Number of installed logical processors | gauge | None
|
||||
`windows_cs_physical_memory_bytes` | Total installed physical memory | gauge | None
|
||||
`windows_cs_hostname` | Labelled system hostname information | gauge | `hostname`, `domain`, `fqdn`
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
## Alerting examples
|
||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||
@@ -2,49 +2,177 @@
|
||||
|
||||
The dhcp collector exposes DHCP Server metrics
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `dhcp`
|
||||
Data source | Perflib
|
||||
Classes | `DHCP Server`
|
||||
Enabled by default? | No
|
||||
| | |
|
||||
|---------------------|---------------|
|
||||
| Metric name prefix | `dhcp` |
|
||||
| Data source | Perflib |
|
||||
| Classes | `DHCP Server` |
|
||||
| Enabled by default? | No |
|
||||
|
||||
## Flags
|
||||
|
||||
None
|
||||
### `--collector.dhcp.enabled`
|
||||
|
||||
Comma-separated list of collectors to use. Defaults to all, if not specified.
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`packets_received_total` | Total number of packets received by the DHCP server | counter | None
|
||||
`duplicates_dropped_total` | Total number of duplicate packets received by the DHCP server | counter | None
|
||||
`packets_expired_total` | Total number of packets expired in the DHCP server message queue | counter | None
|
||||
`active_queue_length` | Number of packets in the processing queue of the DHCP server | gauge | None
|
||||
`conflict_check_queue_length` | Number of packets in the DHCP server queue waiting on conflict detection (ping) | gauge | None
|
||||
`discovers_total` | Total DHCP Discovers received by the DHCP server | counter | None
|
||||
`offers_total` | Total DHCP Offers sent by the DHCP server | counter | None
|
||||
`requests_total` | Total DHCP Requests received by the DHCP server | counter | None
|
||||
`informs_total` | Total DHCP Informs received by the DHCP server | counter | None
|
||||
`acks_total` | Total DHCP Acks sent by the DHCP server | counter | None
|
||||
`nacks_total` | Total DHCP Nacks sent by the DHCP server | counter | None
|
||||
`declines_total` | Total DHCP Declines received by the DHCP server | counter | None
|
||||
`releases_total` | Total DHCP Releases received by the DHCP server | counter | None
|
||||
`offer_queue_length` | Number of packets in the offer queue of the DHCP server | gauge | None
|
||||
`denied_due_to_match_total` | Total number of DHCP requests denied, based on matches from the Deny List | gauge | None
|
||||
`denied_due_to_nonmatch_total` | Total number of DHCP requests denied, based on non-matches from the Allow List | gauge | None
|
||||
`failover_bndupd_sent_total` | Number of DHCP failover Binding Update messages sent | counter | None
|
||||
`failover_bndupd_received_total` | Number of DHCP failover Binding Update messages received | counter | None
|
||||
`failover_bndack_sent_total` | Number of DHCP failover Binding Ack messages sent | counter | None
|
||||
`failover_bndack_received_total` | Number of DHCP failover Binding Ack messages received | counter | None
|
||||
`failover_bndupd_pending_in_outbound_queue` | Number of pending outbound DHCP failover Binding Update messages | counter | None
|
||||
`failover_transitions_communicationinterrupted_state_total` | Total number of transitions into COMMUNICATION INTERRUPTED state | counter | None
|
||||
`failover_transitions_partnerdown_state_total` | Total number of transitions into PARTNER DOWN state | counter | None
|
||||
`failover_transitions_recover_total` | Total number of transitions into RECOVER state | counter | None
|
||||
`failover_bndupd_dropped_total` | Total number of DHCP faileover Binding Updates dropped | counter | None
|
||||
| Name | Description | Type | Labels |
|
||||
|--------------------------------------------------------------------------|--------------------------------------------------------------------------------|---------|-----------------------------------------------------|
|
||||
| `windows_dhcp_ack_total` | Total DHCP Acks sent by the DHCP server | counter | None |
|
||||
| `windows_dhcp_denied_due_to_match_total` | Total number of DHCP requests denied, based on matches from the Deny List | gauge | None |
|
||||
| `windows_dhcp_denied_due_to_nonmatch_total` | Total number of DHCP requests denied, based on non-matches from the Allow List | gauge | None |
|
||||
| `windows_dhcp_declines_total` | Total DHCP Declines received by the DHCP server | counter | None |
|
||||
| `windows_dhcp_discovers_total` | Total DHCP Discovers received by the DHCP server | counter | None |
|
||||
| `windows_dhcp_failover_bndack_received_total` | Number of DHCP failover Binding Ack messages received | counter | None |
|
||||
| `windows_dhcp_failover_bndack_sent_total` | Number of DHCP failover Binding Ack messages sent | counter | None |
|
||||
| `windows_dhcp_failover_bndupd_dropped_total` | Total number of DHCP failover Binding Updates dropped | counter | None |
|
||||
| `windows_dhcp_failover_bndupd_received_total` | Number of DHCP failover Binding Update messages received | counter | None |
|
||||
| `windows_dhcp_failover_bndupd_sent_total` | Number of DHCP failover Binding Update messages sent | counter | None |
|
||||
| `windows_dhcp_failover_bndupd_pending_in_outbound_queue` | Number of pending outbound DHCP failover Binding Update messages | counter | None |
|
||||
| `windows_dhcp_failover_transitions_communicationinterrupted_state_total` | Total number of transitions into COMMUNICATION INTERRUPTED state | counter | None |
|
||||
| `windows_dhcp_failover_transitions_partnerdown_state_total` | Total number of transitions into PARTNER DOWN state | counter | None |
|
||||
| `windows_dhcp_failover_transitions_recover_total` | Total number of transitions into RECOVER state | counter | None |
|
||||
| `windows_dhcp_informs_total` | Total DHCP Informs received by the DHCP server | counter | None |
|
||||
| `windows_dhcp_nacks_total` | Total DHCP Nacks sent by the DHCP server | counter | None |
|
||||
| `windows_dhcp_offers_total` | Total DHCP Offers sent by the DHCP server | counter | None |
|
||||
| `windows_dhcp_packets_expired_total` | Total number of packets expired in the DHCP server message queue | counter | None |
|
||||
| `windows_dhcp_packets_received_total` | Total number of packets received by the DHCP server | counter | None |
|
||||
| `windows_dhcp_pending_offers_total` | Total number of pending offers in the DHCP server | counter | None |
|
||||
| `windows_dhcp_releases_total` | Total DHCP Releases received by the DHCP server | counter | None |
|
||||
| `windows_dhcp_requests_total` | Total DHCP Requests received by the DHCP server | counter | None |
|
||||
| `windows_dhcp_scope_addresses_free_on_this_server` | DHCP Scope free addresses on this server | gauge | `scope` |
|
||||
| `windows_dhcp_scope_addresses_free_on_partner_server` | DHCP Scope free addresses on partner server | gauge | `scope` |
|
||||
| `windows_dhcp_scope_addresses_free` | DHCP Scope free addresses | gauge | `scope` |
|
||||
| `windows_dhcp_scope_addresses_in_use_on_this_server` | DHCP Scope addresses in use on this server | gauge | `scope` |
|
||||
| `windows_dhcp_scope_addresses_in_use_on_partner_server` | DHCP Scope addresses in use on partner server | gauge | `scope` |
|
||||
| `windows_dhcp_scope_addresses_in_use` | DHCP Scope addresses in use | gauge | `scope` |
|
||||
| `windows_dhcp_scope_info` | DHCP Scope information | gauge | `name`, `superscope_name`, `superscope_id`, `scope` |
|
||||
| `windows_dhcp_scope_pending_offers` | DHCP Scope pending offers | gauge | `scope` |
|
||||
| `windows_dhcp_scope_reserved_address` | DHCP Scope reserved addresses | gauge | `scope` |
|
||||
| `windows_dhcp_scope_state` | DHCP Scope state | gauge | `scope`, `state` |
|
||||
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
```
|
||||
# HELP windows_dhcp_acks_total Total DHCP Acks sent by the DHCP server (AcksTotal)
|
||||
# TYPE windows_dhcp_acks_total counter
|
||||
windows_dhcp_acks_total 0
|
||||
# HELP windows_dhcp_active_queue_length Number of packets in the processing queue of the DHCP server (ActiveQueueLength)
|
||||
# TYPE windows_dhcp_active_queue_length gauge
|
||||
windows_dhcp_active_queue_length 0
|
||||
# HELP windows_dhcp_conflict_check_queue_length Number of packets in the DHCP server queue waiting on conflict detection (ping). (ConflictCheckQueueLength)
|
||||
# TYPE windows_dhcp_conflict_check_queue_length gauge
|
||||
windows_dhcp_conflict_check_queue_length 0
|
||||
# HELP windows_dhcp_declines_total Total DHCP Declines received by the DHCP server (DeclinesTotal)
|
||||
# TYPE windows_dhcp_declines_total counter
|
||||
windows_dhcp_declines_total 0
|
||||
# HELP windows_dhcp_denied_due_to_match_total Total number of DHCP requests denied, based on matches from the Deny list (DeniedDueToMatch)
|
||||
# TYPE windows_dhcp_denied_due_to_match_total counter
|
||||
windows_dhcp_denied_due_to_match_total 0
|
||||
# HELP windows_dhcp_denied_due_to_nonmatch_total Total number of DHCP requests denied, based on non-matches from the Allow list (DeniedDueToNonMatch)
|
||||
# TYPE windows_dhcp_denied_due_to_nonmatch_total counter
|
||||
windows_dhcp_denied_due_to_nonmatch_total 0
|
||||
# HELP windows_dhcp_discovers_total Total DHCP Discovers received by the DHCP server (DiscoversTotal)
|
||||
# TYPE windows_dhcp_discovers_total counter
|
||||
windows_dhcp_discovers_total 0
|
||||
# HELP windows_dhcp_duplicates_dropped_total Total number of duplicate packets received by the DHCP server (DuplicatesDroppedTotal)
|
||||
# TYPE windows_dhcp_duplicates_dropped_total counter
|
||||
windows_dhcp_duplicates_dropped_total 0
|
||||
# HELP windows_dhcp_failover_bndack_received_total Number of DHCP fail over Binding Ack messages received (FailoverBndackReceivedTotal)
|
||||
# TYPE windows_dhcp_failover_bndack_received_total counter
|
||||
windows_dhcp_failover_bndack_received_total 0
|
||||
# HELP windows_dhcp_failover_bndack_sent_total Number of DHCP fail over Binding Ack messages sent (FailoverBndackSentTotal)
|
||||
# TYPE windows_dhcp_failover_bndack_sent_total counter
|
||||
windows_dhcp_failover_bndack_sent_total 0
|
||||
# HELP windows_dhcp_failover_bndupd_dropped_total Total number of DHCP fail over Binding Updates dropped (FailoverBndupdDropped)
|
||||
# TYPE windows_dhcp_failover_bndupd_dropped_total counter
|
||||
windows_dhcp_failover_bndupd_dropped_total 0
|
||||
# HELP windows_dhcp_failover_bndupd_pending_in_outbound_queue Number of pending outbound DHCP fail over Binding Update messages (FailoverBndupdPendingOutboundQueue)
|
||||
# TYPE windows_dhcp_failover_bndupd_pending_in_outbound_queue gauge
|
||||
windows_dhcp_failover_bndupd_pending_in_outbound_queue 0
|
||||
# HELP windows_dhcp_failover_bndupd_received_total Number of DHCP fail over Binding Update messages received (FailoverBndupdReceivedTotal)
|
||||
# TYPE windows_dhcp_failover_bndupd_received_total counter
|
||||
windows_dhcp_failover_bndupd_received_total 0
|
||||
# HELP windows_dhcp_failover_bndupd_sent_total Number of DHCP fail over Binding Update messages sent (FailoverBndupdSentTotal)
|
||||
# TYPE windows_dhcp_failover_bndupd_sent_total counter
|
||||
windows_dhcp_failover_bndupd_sent_total 0
|
||||
# HELP windows_dhcp_failover_transitions_communicationinterrupted_state_total Total number of transitions into COMMUNICATION INTERRUPTED state (FailoverTransitionsCommunicationinterruptedState)
|
||||
# TYPE windows_dhcp_failover_transitions_communicationinterrupted_state_total counter
|
||||
windows_dhcp_failover_transitions_communicationinterrupted_state_total 0
|
||||
# HELP windows_dhcp_failover_transitions_partnerdown_state_total Total number of transitions into PARTNER DOWN state (FailoverTransitionsPartnerdownState)
|
||||
# TYPE windows_dhcp_failover_transitions_partnerdown_state_total counter
|
||||
windows_dhcp_failover_transitions_partnerdown_state_total 0
|
||||
# HELP windows_dhcp_failover_transitions_recover_total Total number of transitions into RECOVER state (FailoverTransitionsRecoverState)
|
||||
# TYPE windows_dhcp_failover_transitions_recover_total counter
|
||||
windows_dhcp_failover_transitions_recover_total 0
|
||||
# HELP windows_dhcp_informs_total Total DHCP Informs received by the DHCP server (InformsTotal)
|
||||
# TYPE windows_dhcp_informs_total counter
|
||||
windows_dhcp_informs_total 0
|
||||
# HELP windows_dhcp_nacks_total Total DHCP Nacks sent by the DHCP server (NacksTotal)
|
||||
# TYPE windows_dhcp_nacks_total counter
|
||||
windows_dhcp_nacks_total 0
|
||||
# HELP windows_dhcp_offer_queue_length Number of packets in the offer queue of the DHCP server (OfferQueueLength)
|
||||
# TYPE windows_dhcp_offer_queue_length gauge
|
||||
windows_dhcp_offer_queue_length 0
|
||||
# HELP windows_dhcp_offers_total Total DHCP Offers sent by the DHCP server (OffersTotal)
|
||||
# TYPE windows_dhcp_offers_total counter
|
||||
windows_dhcp_offers_total 0
|
||||
# HELP windows_dhcp_packets_expired_total Total number of packets expired in the DHCP server message queue (PacketsExpiredTotal)
|
||||
# TYPE windows_dhcp_packets_expired_total counter
|
||||
windows_dhcp_packets_expired_total 0
|
||||
# HELP windows_dhcp_packets_received_total Total number of packets received by the DHCP server (PacketsReceivedTotal)
|
||||
# TYPE windows_dhcp_packets_received_total counter
|
||||
windows_dhcp_packets_received_total 0
|
||||
# HELP windows_dhcp_releases_total Total DHCP Releases received by the DHCP server (ReleasesTotal)
|
||||
# TYPE windows_dhcp_releases_total counter
|
||||
windows_dhcp_releases_total 0
|
||||
# HELP windows_dhcp_requests_total Total DHCP Requests received by the DHCP server (RequestsTotal)
|
||||
# TYPE windows_dhcp_requests_total counter
|
||||
windows_dhcp_requests_total 0
|
||||
# HELP windows_dhcp_scope_addresses_free_total DHCP Scope free addresses
|
||||
# TYPE windows_dhcp_scope_addresses_free_total gauge
|
||||
windows_dhcp_scope_addresses_free_total{scope="10.11.12.0/25"} 0
|
||||
windows_dhcp_scope_addresses_free_total{scope="172.16.0.0/24"} 0
|
||||
windows_dhcp_scope_addresses_free_total{scope="192.168.0.0/24"} 231
|
||||
# HELP windows_dhcp_scope_addresses_in_use_total DHCP Scope addresses in use
|
||||
# TYPE windows_dhcp_scope_addresses_in_use_total gauge
|
||||
windows_dhcp_scope_addresses_in_use_total{scope="10.11.12.0/25"} 0
|
||||
windows_dhcp_scope_addresses_in_use_total{scope="172.16.0.0/24"} 0
|
||||
windows_dhcp_scope_addresses_in_use_total{scope="192.168.0.0/24"} 0
|
||||
# HELP windows_dhcp_scope_info DHCP Scope information
|
||||
# TYPE windows_dhcp_scope_info gauge
|
||||
windows_dhcp_scope_info{name="SUBSUPERSCOPE",scope="172.16.0.0/24",superscope_id="2",superscope_name="SUPERSCOPE"} 1
|
||||
windows_dhcp_scope_info{name="TEST",scope="192.168.0.0/24",superscope_id="0",superscope_name=""} 1
|
||||
windows_dhcp_scope_info{name="TEST2",scope="10.11.12.0/25",superscope_id="2",superscope_name="SUPERSCOPE"} 1
|
||||
# HELP windows_dhcp_scope_pending_offers_total DHCP Scope pending offers
|
||||
# TYPE windows_dhcp_scope_pending_offers_total gauge
|
||||
windows_dhcp_scope_pending_offers_total{scope="10.11.12.0/25"} 0
|
||||
windows_dhcp_scope_pending_offers_total{scope="172.16.0.0/24"} 0
|
||||
windows_dhcp_scope_pending_offers_total{scope="192.168.0.0/24"} 0
|
||||
# HELP windows_dhcp_scope_reserved_address_total DHCP Scope reserved addresses
|
||||
# TYPE windows_dhcp_scope_reserved_address_total gauge
|
||||
windows_dhcp_scope_reserved_address_total{scope="10.11.12.0/25"} 0
|
||||
windows_dhcp_scope_reserved_address_total{scope="172.16.0.0/24"} 0
|
||||
windows_dhcp_scope_reserved_address_total{scope="192.168.0.0/24"} 2
|
||||
# HELP windows_dhcp_scope_state DHCP Scope state
|
||||
# TYPE windows_dhcp_scope_state gauge
|
||||
windows_dhcp_scope_state{scope="10.11.12.0/25",state="Disabled"} 1
|
||||
windows_dhcp_scope_state{scope="10.11.12.0/25",state="DisabledSwitched"} 0
|
||||
windows_dhcp_scope_state{scope="10.11.12.0/25",state="Enabled"} 0
|
||||
windows_dhcp_scope_state{scope="10.11.12.0/25",state="EnabledSwitched"} 0
|
||||
windows_dhcp_scope_state{scope="10.11.12.0/25",state="InvalidState"} 0
|
||||
windows_dhcp_scope_state{scope="172.16.0.0/24",state="Disabled"} 1
|
||||
windows_dhcp_scope_state{scope="172.16.0.0/24",state="DisabledSwitched"} 0
|
||||
windows_dhcp_scope_state{scope="172.16.0.0/24",state="Enabled"} 0
|
||||
windows_dhcp_scope_state{scope="172.16.0.0/24",state="EnabledSwitched"} 0
|
||||
windows_dhcp_scope_state{scope="172.16.0.0/24",state="InvalidState"} 0
|
||||
windows_dhcp_scope_state{scope="192.168.0.0/24",state="Disabled"} 0
|
||||
windows_dhcp_scope_state{scope="192.168.0.0/24",state="DisabledSwitched"} 0
|
||||
windows_dhcp_scope_state{scope="192.168.0.0/24",state="Enabled"} 1
|
||||
windows_dhcp_scope_state{scope="192.168.0.0/24",state="EnabledSwitched"} 0
|
||||
windows_dhcp_scope_state{scope="192.168.0.0/24",state="InvalidState"} 0
|
||||
```
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
@@ -30,7 +30,7 @@ groups:
|
||||
rules:
|
||||
|
||||
- alert: Drive_Status
|
||||
expr: windows_disk_drive_status{status="OK"} != 1
|
||||
expr: windows_diskdrive_status{status="OK"} != 1
|
||||
for: 10m
|
||||
labels:
|
||||
severity: high
|
||||
|
||||
@@ -3,14 +3,19 @@
|
||||
The dns collector exposes metrics about the DNS server
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `dns`
|
||||
Classes | [`Win32_PerfRawData_DNS_DNS`](https://technet.microsoft.com/en-us/library/cc977686.aspx)
|
||||
Enabled by default? | No
|
||||
-|-|-
|
||||
Metric name prefix | `dns` |
|
||||
Classes | [`Win32_PerfRawData_DNS_DNS`](https://technet.microsoft.com/en-us/library/cc977686.aspx) |
|
||||
Enabled by default | Yes |
|
||||
Metric name prefix (error stats) | `windows_dns` |
|
||||
Classes | [`MicrosoftDNS_Statistic`](https://learn.microsoft.com/en-us/windows/win32/dns/dns-wmi-provider-overview) |
|
||||
Enabled by default (error stats)? | Yes |
|
||||
|
||||
## Flags
|
||||
|
||||
None
|
||||
Name | Description
|
||||
-----|------------
|
||||
`collector.dns.enabled` | Comma-separated list of collectors to use. Available collectors: `metrics`, `wmi_stats`. Defaults to all collectors if not specified.
|
||||
|
||||
## Metrics
|
||||
|
||||
@@ -38,9 +43,53 @@ Name | Description | Type | Labels
|
||||
`windows_dns_wins_queries_total` | _Not yet documented_ | counter | `direction`
|
||||
`windows_dns_wins_responses_total` | _Not yet documented_ | counter | `direction`
|
||||
`windows_dns_unmatched_responses_total` | _Not yet documented_ | counter | None
|
||||
`windows_dns_error_stats_total` | DNS error statistics from MicrosoftDNS_Statistic | counter | `name`, `collection_name`, `dns_server`
|
||||
|
||||
### Sub-collectors
|
||||
|
||||
The DNS collector is split into two sub-collectors:
|
||||
|
||||
1. `metrics` - Collects standard DNS performance metrics using PDH (Performance Data Helper)
|
||||
2. `wmi_stats` - Collects DNS error statistics from the MicrosoftDNS_Statistic WMI class
|
||||
|
||||
By default, both sub-collectors are enabled. You can enable specific sub-collectors using the `collector.dns.enabled` flag.
|
||||
|
||||
### Example Usage
|
||||
|
||||
To enable only DNS error statistics collection:
|
||||
```powershell
|
||||
windows_exporter.exe --collector.dns.enabled=wmi_stats
|
||||
```
|
||||
|
||||
To enable only standard DNS metrics:
|
||||
```powershell
|
||||
windows_exporter.exe --collector.dns.enabled=metrics
|
||||
```
|
||||
|
||||
To enable both (default behavior):
|
||||
```powershell
|
||||
windows_exporter.exe --collector.dns.enabled=metrics,wmi_stats
|
||||
```
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
```
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="BadKey"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="BadSig"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="BadTime"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="FormError"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="Max"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NoError"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NotAuth"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NotImpl"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NotZone"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NxDomain"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="NxRRSet"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="Refused"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="ServFail"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="UnknownError"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="YxDomain"} 0
|
||||
windows_dns_wmi_stats_total{collection_name="Error Stats",dns_server="EC2AMAZ-5NNM8M1",name="YxRRSet"} 0
|
||||
```
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
# exchange collector
|
||||
|
||||
The exchange collector collects metrics from MS Exchange hosts through perflib
|
||||
The exchange collector collects metrics from MS Exchange hosts through Performance Counter
|
||||
=======
|
||||
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `exchange`
|
||||
Classes | [Win32_PerfRawData_MSExchangeADAccess_MSExchangeADAccessProcesses](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_MSExchangeTransportQueues_MSExchangeTransportQueues](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_ESE_MSExchangeDatabaseInstances](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_MSExchangeHttpProxy_MSExchangeHttpProxy](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_MSExchangeActiveSync_MSExchangeActiveSync](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_MSExchangeAvailabilityService_MSExchangeAvailabilityService](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_MSExchangeOWA_MSExchangeOWA](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_MSExchangeAutodiscover_MSExchangeAutodiscover](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_MSExchangeWorkloadManagementWorkloads_MSExchangeWorkloadManagementWorkloads](https://docs.microsoft.com/en-us/exchange/)<br/> [Win32_PerfRawData_MSExchangeRpcClientAccess_MSExchangeRpcClientAccess](https://docs.microsoft.com/en-us/exchange/)<br/>
|
||||
Enabled by default? | No
|
||||
| | |
|
||||
|---------------------|---------------------|
|
||||
| Metric name prefix | `exchange` |
|
||||
| Source | Performance Counter |
|
||||
| Enabled by default? | No |
|
||||
|
||||
## Flags
|
||||
|
||||
@@ -19,45 +18,56 @@ Lists the Perflib Objects that are queried for data along with the perlfib objec
|
||||
Comma-separated list of collectors to use, for example: `--collectors.exchange.enabled=AvailabilityService,OutlookWebAccess`. Matching is case-sensitive. Depending on the exchange installation not all performance counters are available. Use `--collectors.exchange.list` to obtain a list of supported collectors.
|
||||
|
||||
## Metrics
|
||||
Name | Description
|
||||
--------------|---------------
|
||||
`windows_exchange_rpc_avg_latency_sec` | The latency (sec), averaged for the past 1024 packets
|
||||
`windows_exchange_rpc_requests` | Number of client requests currently being processed by the RPC Client Access service
|
||||
`windows_exchange_rpc_active_user_count` | Number of unique users that have shown some kind of activity in the last 2 minutes
|
||||
`windows_exchange_rpc_connection_count` | Total number of client connections maintained
|
||||
`windows_exchange_rpc_operations_total` | The rate at which RPC operations occur
|
||||
`windows_exchange_rpc_user_count` | Number of users
|
||||
`windows_exchange_ldap_read_time_sec` | Time (sec) to send an LDAP read request and receive a response
|
||||
`windows_exchange_ldap_search_time_sec` | Time (sec) to send an LDAP search request and receive a response
|
||||
`windows_exchange_ldap_write_time_sec` | Time (sec) to send an LDAP Add/Modify/Delete request and receive a response
|
||||
`windows_exchange_ldap_timeout_errors_total` | Total number of LDAP timeout errors
|
||||
`windows_exchange_ldap_long_running_ops_per_sec` | Long Running LDAP operations per second
|
||||
`windows_exchange_transport_queues_external_active_remote_delivery` | External Active Remote Delivery Queue length
|
||||
`windows_exchange_transport_queues_internal_active_remote_delivery` | Internal Active Remote Delivery Queue length
|
||||
`windows_exchange_transport_queues_active_mailbox_delivery` | Active Mailbox Delivery Queue length
|
||||
`windows_exchange_transport_queues_retry_mailbox_delivery` | Retry Mailbox Delivery Queue length
|
||||
`windows_exchange_transport_queues_unreachable` | Unreachable Queue length
|
||||
`windows_exchange_transport_queues_external_largest_delivery` | External Largest Delivery Queue length
|
||||
`windows_exchange_transport_queues_internal_largest_delivery` | Internal Largest Delivery Queue length
|
||||
`windows_exchange_transport_queues_poison` | Poison Queue length
|
||||
`windows_exchange_http_proxy_mailbox_server_locator_avg_latency_sec` | Average latency (sec) of MailboxServerLocator web service calls
|
||||
`windows_exchange_http_proxy_avg_auth_latency` | Average time spent authenticating CAS requests over the last 200 samples
|
||||
`windows_exchange_http_proxy_outstanding_proxy_requests` | Number of concurrent outstanding proxy requests
|
||||
`windows_exchange_http_proxy_requests_total` | Number of proxy requests processed each second
|
||||
`windows_exchange_avail_service_requests_per_sec` | Number of requests serviced per second
|
||||
`windows_exchange_owa_current_unique_users` | Number of unique users currently logged on to Outlook Web App
|
||||
`windows_exchange_owa_requests_total` | Number of requests handled by Outlook Web App per second
|
||||
`windows_exchange_autodiscover_requests_total` | Number of autodiscover service requests processed each second
|
||||
`windows_exchange_workload_active_tasks` | Number of active tasks currently running in the background for workload management
|
||||
`windows_exchange_workload_completed_tasks` | Number of workload management tasks that have been completed
|
||||
`windows_exchange_workload_queued_tasks` | Number of workload management tasks that are currently queued up waiting to be processed
|
||||
`windows_exchange_workload_yielded_tasks` | The total number of tasks that have been yielded by a workload
|
||||
`windows_exchange_workload_is_active` | Active indicates whether the workload is in an active (1) or paused (0) state
|
||||
`windows_exchange_activesync_requests_total` | Num HTTP requests received from the client via ASP.NET per sec. Shows Current user load
|
||||
`windows_exchange_http_proxy_avg_cas_proccessing_latency_sec` | Average latency (sec) of CAS processing time over the last 200 reqs
|
||||
`windows_exchange_http_proxy_mailbox_proxy_failure_rate` | % of failures between this CAS and MBX servers over the last 200 sample
|
||||
`windows_exchange_activesync_ping_cmds_pending` | Number of ping commands currently pending in the queue
|
||||
`windows_exchange_activesync_sync_cmds_total` | Number of sync commands processed per second. Clients use this command to synchronize items within a folder
|
||||
| Name | Description |
|
||||
|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
|
||||
| `windows_exchange_rpc_avg_latency_sec` | The latency (sec), averaged for the past 1024 packets |
|
||||
| `windows_exchange_rpc_requests` | Number of client requests currently being processed by the RPC Client Access service |
|
||||
| `windows_exchange_rpc_active_user_count` | Number of unique users that have shown some kind of activity in the last 2 minutes |
|
||||
| `windows_exchange_rpc_connection_count` | Total number of client connections maintained |
|
||||
| `windows_exchange_rpc_operations_total` | The rate at which RPC operations occur |
|
||||
| `windows_exchange_rpc_user_count` | Number of users |
|
||||
| `windows_exchange_ldap_read_time_sec` | Time (sec) to send an LDAP read request and receive a response |
|
||||
| `windows_exchange_ldap_search_time_sec` | Time (sec) to send an LDAP search request and receive a response |
|
||||
| `windows_exchange_ldap_write_time_sec` | Time (sec) to send an LDAP Add/Modify/Delete request and receive a response |
|
||||
| `windows_exchange_ldap_timeout_errors_total` | Total number of LDAP timeout errors |
|
||||
| `windows_exchange_ldap_long_running_ops_per_sec` | Long Running LDAP operations per second |
|
||||
| `windows_exchange_transport_queues_external_active_remote_delivery` | External Active Remote Delivery Queue length |
|
||||
| `windows_exchange_transport_queues_internal_active_remote_delivery` | Internal Active Remote Delivery Queue length |
|
||||
| `windows_exchange_transport_queues_active_mailbox_delivery` | Active Mailbox Delivery Queue length |
|
||||
| `windows_exchange_transport_queues_retry_mailbox_delivery` | Retry Mailbox Delivery Queue length |
|
||||
| `windows_exchange_transport_queues_unreachable` | Unreachable Queue length |
|
||||
| `windows_exchange_transport_queues_external_largest_delivery` | External Largest Delivery Queue length |
|
||||
| `windows_exchange_transport_queues_internal_largest_delivery` | Internal Largest Delivery Queue length |
|
||||
| `windows_exchange_transport_queues_poison` | Poison Queue length |
|
||||
| `windows_exchange_transport_queues_messages_queued_for_delivery_total` | Messages Queued For Delivery Total |
|
||||
| `windows_exchange_transport_queues_messages_submitted_total` | Messages Submitted Total |
|
||||
| `windows_exchange_transport_queues_messages_delayed_total` | Messages Delayed Total |
|
||||
| `windows_exchange_transport_queues_messages_completed_delivery_total` | Messages Completed Delivery Total |
|
||||
| `windows_exchange_transport_queues_aggregate_shadow_queue_length` | The current number of messages in shadow queues |
|
||||
| `windows_exchange_transport_queues_submission_queue_length` | Submission Queue Length |
|
||||
| `windows_exchange_transport_queues_delay_queue_length` | Delay Queue Length |
|
||||
| `windows_exchange_transport_queues_items_completed_delivery_total` | Items Completed Delivery Total |
|
||||
| `windows_exchange_transport_queues_items_queued_for_delivery_expired_total` | Items Queued For Delivery Expired Total |
|
||||
| `windows_exchange_transport_queues_items_queued_for_delivery_total` | Items Queued For Delivery Total |
|
||||
| `windows_exchange_transport_queues_items_resubmitted_total` | Items Resubmitted Total |
|
||||
| `windows_exchange_http_proxy_mailbox_server_locator_avg_latency_sec` | Average latency (sec) of MailboxServerLocator web service calls |
|
||||
| `windows_exchange_http_proxy_avg_auth_latency` | Average time spent authenticating CAS requests over the last 200 samples |
|
||||
| `windows_exchange_http_proxy_outstanding_proxy_requests` | Number of concurrent outstanding proxy requests |
|
||||
| `windows_exchange_http_proxy_requests_total` | Number of proxy requests processed each second |
|
||||
| `windows_exchange_availability_service_requests_per_sec` | Number of requests serviced per second |
|
||||
| `windows_exchange_owa_current_unique_users` | Number of unique users currently logged on to Outlook Web App |
|
||||
| `windows_exchange_owa_requests_total` | Number of requests handled by Outlook Web App per second |
|
||||
| `windows_exchange_autodiscover_requests_total` | Number of autodiscover service requests processed each second |
|
||||
| `windows_exchange_workload_active_tasks` | Number of active tasks currently running in the background for workload management |
|
||||
| `windows_exchange_workload_completed_tasks` | Number of workload management tasks that have been completed |
|
||||
| `windows_exchange_workload_queued_tasks` | Number of workload management tasks that are currently queued up waiting to be processed |
|
||||
| `windows_exchange_workload_yielded_tasks` | The total number of tasks that have been yielded by a workload |
|
||||
| `windows_exchange_workload_is_active` | Active indicates whether the workload is in an active (1) or paused (0) state |
|
||||
| `windows_exchange_activesync_requests_total` | Num HTTP requests received from the client via ASP.NET per sec. Shows Current user load |
|
||||
| `windows_exchange_http_proxy_avg_cas_proccessing_latency_sec` | Average latency (sec) of CAS processing time over the last 200 reqs |
|
||||
| `windows_exchange_http_proxy_mailbox_proxy_failure_rate` | % of failures between this CAS and MBX servers over the last 200 sample |
|
||||
| `windows_exchange_activesync_ping_cmds_pending` | Number of ping commands currently pending in the queue |
|
||||
| `windows_exchange_activesync_sync_cmds_total` | Number of sync commands processed per second. Clients use this command to synchronize items within a folder |
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
@@ -67,4 +77,3 @@ _This collector does not yet have any useful queries added, we would appreciate
|
||||
|
||||
## Alerting examples
|
||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||
|
||||
|
||||
40
docs/collector.file.md
Normal file
40
docs/collector.file.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# file collector
|
||||
|
||||
The file collector exposes modified timestamps and file size of files in the filesystem.
|
||||
|
||||
The collector
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `file`
|
||||
Enabled by default? | No
|
||||
|
||||
## Flags
|
||||
|
||||
### `--collector.file.file-patterns`
|
||||
Comma-separated list of file patterns. Each pattern is a glob pattern that can contain `*`, `?`, and `**` (recursive).
|
||||
See https://github.com/bmatcuk/doublestar#patterns for an extended description of the pattern syntax.
|
||||
|
||||
## Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------|------------------------|-------|--------|
|
||||
| `windows_file_mtime_timestamp_seconds` | File modification time | gauge | `file` |
|
||||
| `windows_file_size_bytes` | File size | gauge | `file` |
|
||||
|
||||
### Example metric
|
||||
|
||||
```
|
||||
# HELP windows_file_mtime_timestamp_seconds File modification time
|
||||
# TYPE windows_file_mtime_timestamp_seconds gauge
|
||||
windows_file_mtime_timestamp_seconds{file="C:\\Users\\admin\\Desktop\\Dashboard.lnk"} 1.726434517e+09
|
||||
# HELP windows_file_size_bytes File size
|
||||
# TYPE windows_file_size_bytes gauge
|
||||
windows_file_size_bytes{file="C:\\Users\\admin\\Desktop\\Dashboard.lnk"} 123
|
||||
```
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
## Alerting examples
|
||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||
@@ -1,36 +0,0 @@
|
||||
# filetime collector
|
||||
|
||||
The filetime collector exposes modified timestamps of files in the filesystem.
|
||||
|
||||
The collector
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `filetime`
|
||||
Enabled by default? | No
|
||||
|
||||
## Flags
|
||||
|
||||
### `--collectors.filetime.file-patterns`
|
||||
Comma-separated list of file patterns. Each pattern is a glob pattern that can contain `*`, `?`, and `**` (recursive).
|
||||
See https://github.com/bmatcuk/doublestar#patterns for an extended description of the pattern syntax.
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_filetime_mtime_timestamp_seconds` | File modification time | gauge | `file`
|
||||
|
||||
### Example metric
|
||||
|
||||
```
|
||||
# HELP windows_filetime_mtime_timestamp_seconds File modification time
|
||||
# TYPE windows_filetime_mtime_timestamp_seconds gauge
|
||||
windows_filetime_mtime_timestamp_seconds{file="C:\\Users\\admin\\Desktop\\Dashboard.lnk"} 1.726434517e+09
|
||||
```
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
## Alerting examples
|
||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||
149
docs/collector.gpu.md
Normal file
149
docs/collector.gpu.md
Normal file
@@ -0,0 +1,149 @@
|
||||
# gpu collector
|
||||
|
||||
The gpu collector exposes metrics about GPU usage and memory consumption, both at the adapter (physical GPU) and
|
||||
per-process level.
|
||||
|
||||
| | |
|
||||
|---------------------|--------------------------------------|
|
||||
| Metric name prefix | `gpu` |
|
||||
| Data source | Perflib |
|
||||
| Counters | GPU Engine, GPU Adapter, GPU Process |
|
||||
| Enabled by default? | No |
|
||||
|
||||
## Flags
|
||||
|
||||
None
|
||||
|
||||
## Metrics
|
||||
|
||||
These metrics are available on supported versions of Windows with compatible GPUs and drivers:
|
||||
|
||||
### Adapter-level Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|--------------------------------------------------|------------------------------------------------------------------------------------|-------|-----------------------------------------------------------------|
|
||||
| `windows_gpu_info` | A metric with a constant '1' value labeled with gpu device information. | gauge | `bus_number`,`device_id`,`function_number`,`luid`,`name`,`phys` |
|
||||
| `windows_gpu_dedicated_system_memory_size_bytes` | The size, in bytes, of memory that is dedicated from system memory. | gauge | `device_id`,`luid` |
|
||||
| `windows_gpu_dedicated_video_memory_size_bytes` | The size, in bytes, of memory that is dedicated from video memory. | gauge | `device_id`,`luid` |
|
||||
| `windows_gpu_shared_system_memory_size_bytes` | The size, in bytes, of memory from system memory that can be shared by many users. | gauge | `device_id`,`luid` |
|
||||
| `windows_gpu_adapter_memory_committed_bytes` | Total committed GPU memory in bytes per physical GPU | gauge | `device_id`,`luid`,`phys` |
|
||||
| `windows_gpu_adapter_memory_dedicated_bytes` | Dedicated GPU memory usage in bytes per physical GPU | gauge | `device_id`,`luid`,`phys` |
|
||||
| `windows_gpu_adapter_memory_shared_bytes` | Shared GPU memory usage in bytes per physical GPU | gauge | `device_id`,`luid`,`phys` |
|
||||
| `windows_gpu_local_adapter_memory_bytes` | Local adapter memory usage in bytes per physical GPU | gauge | `device_id`,`luid`,`phys`,`part` |
|
||||
| `windows_gpu_non_local_adapter_memory_bytes` | Non-local adapter memory usage in bytes per physical GPU | gauge | `device_id`,`luid`,`phys`,`part` |
|
||||
|
||||
### Per-process Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------------|-------------------------------------------------|---------|-----------------------------------------------------------|
|
||||
| `windows_gpu_engine_time_seconds` | Total running time of the GPU engine in seconds | counter | `device_id`,`luid`,`phys`, `eng`, `engtype`, `process_id` |
|
||||
| `windows_gpu_process_memory_committed_bytes` | Total committed GPU memory in bytes per process | gauge | `device_id`,`luid`,`phys`,`process_id` |
|
||||
| `windows_gpu_process_memory_dedicated_bytes` | Dedicated GPU memory usage in bytes per process | gauge | `device_id`,`luid`,`phys`,`process_id` |
|
||||
| `windows_gpu_process_memory_local_bytes` | Local GPU memory usage in bytes per process | gauge | `device_id`,`luid`,`phys`,`process_id` |
|
||||
| `windows_gpu_process_memory_non_local_bytes` | Non-local GPU memory usage in bytes per process | gauge | `device_id`,`luid`,`phys`,`process_id` |
|
||||
| `windows_gpu_process_memory_shared_bytes` | Shared GPU memory usage in bytes per process | gauge | `device_id`,`luid`,`phys`,`process_id` |
|
||||
|
||||
## Metric Labels
|
||||
|
||||
* `luid`,`phys`: Physical GPU index (e.g., "0")
|
||||
* `eng`: GPU engine index (e.g., "0", "1", ...)
|
||||
* `engtype`: GPU engine type (e.g., "3D", "Copy", "VideoDecode", etc.)
|
||||
* `process_id`: Process ID
|
||||
|
||||
## Example Metric
|
||||
|
||||
These are basic queries to help you get started with GPU monitoring on Windows using Prometheus.
|
||||
|
||||
**Show GPU information for a specific physical GPU (0):**
|
||||
|
||||
```promql
|
||||
windows_gpu_info{bus_number="8",device_id="PCI\\VEN_10DE&DEV_1B81&SUBSYS_61733842&REV_A1",function_number="0",luid="0x00000000_0x00010F8A",name="NVIDIA GeForce GTX 1070",phys="0"} 1
|
||||
```
|
||||
|
||||
**Show total dedicated GPU memory (in bytes) usage on GPU 0:**
|
||||
|
||||
```promql
|
||||
windows_gpu_adapter_memory_dedicated_bytes{phys="0"}
|
||||
```
|
||||
|
||||
**Aggregate GPU utilization across all processes for a physical GPU (3D engine):**
|
||||
|
||||
```promql
|
||||
sum by (phys) (
|
||||
rate(windows_gpu_engine_time_seconds{phys="0", engtype="3D"}[1m])
|
||||
) * 100
|
||||
```
|
||||
|
||||
**Show GPU utilization for a specific process (3D engine):**
|
||||
|
||||
```promql
|
||||
sum by (phys, process_id) (
|
||||
rate(windows_gpu_engine_time_seconds{process_id="1234", engtype="3D"}[1m])
|
||||
) * 100
|
||||
```
|
||||
|
||||
**Show dedicated GPU memory per process:**
|
||||
|
||||
```promql
|
||||
windows_gpu_adapter_memory_dedicated_bytes
|
||||
```
|
||||
|
||||
## Useful Queries
|
||||
|
||||
**Show top 5 processes by GPU utilization (all engines):**
|
||||
|
||||
```promql
|
||||
topk(5, sum by (process_id) (
|
||||
rate(windows_gpu_engine_time_seconds[1m])
|
||||
) * 100)
|
||||
```
|
||||
|
||||
**Show GPU memory usage per physical GPU:**
|
||||
|
||||
```promql
|
||||
sum by (phys) (
|
||||
windows_gpu_adapter_memory_dedicated_bytes
|
||||
)
|
||||
```
|
||||
|
||||
Show GPU engine time with process owner and command line:
|
||||
|
||||
```promql
|
||||
windows_gpu_engine_time_seconds * on(process_id) group_left(owner, cmdline) windows_process_info
|
||||
```
|
||||
|
||||
## Alerting Examples
|
||||
|
||||
**prometheus.rules**
|
||||
|
||||
```yaml
|
||||
# Alert on processes using more than 80% of a GPU's capacity over 10 minutes
|
||||
- alert: HighGpuUtilization
|
||||
expr: |
|
||||
sum by (process_id) (
|
||||
rate(windows_gpu_engine_time_seconds[1m])
|
||||
) * 100 > 80
|
||||
for: 10m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "High GPU Utilization (process {{ $labels.process_id }})"
|
||||
description: "Process is using more than 80% of GPU resources\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
* Per-process metrics allow you to identify which processes are consuming GPU resources.
|
||||
* Adapter-level metrics provide an overview of total GPU memory usage.
|
||||
* For overall GPU utilization, aggregate per-process metrics in Prometheus using queries such as `sum()`.
|
||||
* The collector relies on Windows performance counters; ensure your system and drivers support these counters.
|
||||
|
||||
## Enabling the Collector
|
||||
|
||||
To enable the GPU collector, add `gpu` to the list of enabled collectors in your windows_exporter configuration.
|
||||
|
||||
Example (command line):
|
||||
|
||||
```shell
|
||||
windows_exporter.exe --collectors.enabled=gpu
|
||||
```
|
||||
@@ -2,110 +2,262 @@
|
||||
|
||||
The hyperv collector exposes metrics about the Hyper-V hypervisor
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `hyperv`
|
||||
Classes | `Win32_PerfRawData_VmmsVirtualMachineStats_HyperVVirtualMachineHealthSummary`<br/>`Win32_PerfRawData_VidPerfProvider_HyperVVMVidPartition`<br/>`Win32_PerfRawData_HvStats_HyperVHypervisorRootPartition`<br/>`Win32_PerfRawData_HvStats_HyperVHypervisor`<br/>`Win32_PerfRawData_HvStats_HyperVHypervisorLogicalProcessor`<br/>`Win32_PerfRawData_HvStats_HyperVHypervisorRootVirtualProcessor`<br/>`Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor`<br/>`Win32_PerfRawData_NvspSwitchStats_HyperVVirtualSwitch`<br/>`Win32_PerfRawData_EthernetPerfProvider_HyperVLegacyNetworkAdapter`<br/>`Win32_PerfRawData_Counters_HyperVVirtualStorageDevice`<br/>`Win32_PerfRawData_NvspNicStats_HyperVVirtualNetworkAdapter`
|
||||
Enabled by default? | No
|
||||
| | |
|
||||
|---------------------|----------------------|
|
||||
| Metric name prefix | `hyperv` |
|
||||
| Source | Performance counters |
|
||||
| Enabled by default? | No |
|
||||
|
||||
## Flags
|
||||
|
||||
None
|
||||
### `--collectors.hyperv.enabled`
|
||||
Comma-separated list of collectors to use, for example:
|
||||
`--collectors.hyperv.enabled=dynamic_memory_balancer,dynamic_memory_vm,hypervisor_logical_processor,hypervisor_root_partition,hypervisor_root_virtual_processor,hypervisor_virtual_processor,legacy_network_adapter,virtual_machine_health_summary,virtual_machine_vid_partition,virtual_network_adapter,virtual_storage_device,virtual_switch`.
|
||||
Matching is case-sensitive.
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_hyperv_health_critical` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_health_ok` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_vid_physical_pages_allocated` | _Not yet documented_ | counter | `vm`
|
||||
`windows_hyperv_vid_preferred_numa_node_index` | _Not yet documented_ | counter | `vm`
|
||||
`windows_hyperv_vid_remote_physical_pages` | _Not yet documented_ | counter | `vm`
|
||||
`windows_hyperv_root_partition_address_spaces` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_attached_devices` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_deposited_pages` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_device_dma_errors` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_device_interrupt_errors` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_device_interrupt_mappings` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_device_interrupt_throttle_events` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_preferred_numa_node_index` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_gpa_space_modifications` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_io_tlb_flush_cost` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_io_tlb_flush` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_recommended_virtual_tlb_size` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_physical_pages_allocated` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_1G_device_pages` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_1G_gpa_pages` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_2M_device_pages` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_2M_gpa_pages` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_4K_device_pages` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_4K_gpa_pages` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_virtual_tlb_flush_entires` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_root_partition_virtual_tlb_pages` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_hypervisor_virtual_processors` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_hypervisor_logical_processors` | _Not yet documented_ | counter | None
|
||||
`windows_hyperv_host_lp_guest_run_time_percent` | _Not yet documented_ | counter | `core`
|
||||
`windows_hyperv_host_lp_hypervisor_run_time_percent` | _Not yet documented_ | counter | `core`
|
||||
`windows_hyperv_host_lp_total_run_time_percent` | _Not yet documented_ | counter | `core`
|
||||
`windows_hyperv_host_cpu_guest_run_time` | _Not yet documented_ | counter | `core`
|
||||
`windows_hyperv_host_cpu_hypervisor_run_time` | _Not yet documented_ | counter | `core`
|
||||
`windows_hyperv_host_cpu_remote_run_time` | _Not yet documented_ | counter | `core`
|
||||
`windows_hyperv_host_cpu_total_run_time` | _Not yet documented_ | counter | `core`
|
||||
`windows_hyperv_host_cpu_wait_time_per_dispatch_total` | _Not yet documented_ | counter | `core`
|
||||
`windows_hyperv_vm_cpu_guest_run_time` | _Not yet documented_ | counter | `vm`, `core`
|
||||
`windows_hyperv_vm_cpu_hypervisor_run_time` | _Not yet documented_ | counter | `vm`, `core`
|
||||
`windows_hyperv_vm_cpu_remote_run_time` | _Not yet documented_ | counter | `vm`, `core`
|
||||
`windows_hyperv_vm_cpu_wait_time_per_dispatch_total` | _Not yet documented_ | counter | `vm`, `core`
|
||||
`windows_hyperv_vm_memory_added_total` | _Not yet documented_ | counter | `vm`
|
||||
`windows_hyperv_vm_memory_pressure_average` | _Not yet documented_ | gauge | `vm`
|
||||
`windows_hyperv_vm_memory_pressure_current` | _Not yet documented_ | counter | `vm`
|
||||
`windows_hyperv_vm_memory_physical_guest_visible` | _Not yet documented_ | gauge | `vm`
|
||||
`windows_hyperv_vm_memory_pressure_maximum` | _Not yet documented_ | gauge | `vm`
|
||||
`windows_hyperv_vm_memory_add_operations_total` | _Not yet documented_ | counter | `vm`
|
||||
`windows_hyperv_vm_memory_remove_operations_total` | _Not yet documented_ | counter | `vm`
|
||||
`windows_hyperv_vm_memory_pressure_minumim` | _Not yet documented_ | gauge | `vm`
|
||||
`windows_hyperv_vm_memory_physical` | _Not yet documented_ | gauge | `vm`
|
||||
`windows_hyperv_vm_memory_removed_total` | _Not yet documented_ | counter | `vm`
|
||||
`windows_hyperv_vm_cpu_total_run_time` | _Not yet documented_ | counter | `vm`, `core`
|
||||
`windows_hyperv_vswitch_broadcast_packets_received_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_broadcast_packets_sent_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_bytes_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_bytes_received_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_bytes_sent_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_directed_packets_received_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_directed_packets_send_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_dropped_packets_incoming_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_dropped_packets_outcoming_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_extensions_dropped_packets_incoming_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_extensions_dropped_packets_outcoming_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_learned_mac_addresses_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_multicast_packets_received_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_multicast_packets_sent_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_number_of_send_channel_moves_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_number_of_vmq_moves_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_packets_flooded_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_packets_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_packets_received_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_packets_sent_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_vswitch_purged_mac_addresses_total` | _Not yet documented_ | counter | `vswitch`
|
||||
`windows_hyperv_ethernet_bytes_dropped` | _Not yet documented_ | counter | `adapter`
|
||||
`windows_hyperv_ethernet_bytes_received` | _Not yet documented_ | counter | `adapter`
|
||||
`windows_hyperv_ethernet_bytes_sent` | _Not yet documented_ | counter | `adapter`
|
||||
`windows_hyperv_ethernet_frames_dropped` | _Not yet documented_ | counter | `adapter`
|
||||
`windows_hyperv_ethernet_frames_received` | _Not yet documented_ | counter | `adapter`
|
||||
`windows_hyperv_ethernet_frames_sent` | _Not yet documented_ | counter | `adapter`
|
||||
`windows_hyperv_vm_device_error_count` | _Not yet documented_ | counter | `vm_device`
|
||||
`windows_hyperv_vm_device_queue_length` | _Not yet documented_ | counter | `vm_device`
|
||||
`windows_hyperv_vm_device_bytes_read` | _Not yet documented_ | counter | `vm_device`
|
||||
`windows_hyperv_vm_device_operations_read` | _Not yet documented_ | counter | `vm_device`
|
||||
`windows_hyperv_vm_device_bytes_written` | _Not yet documented_ | counter | `vm_device`
|
||||
`windows_hyperv_vm_device_operations_written` | _Not yet documented_ | counter | `vm_device`
|
||||
`windows_hyperv_vm_interface_bytes_received` | _Not yet documented_ | counter | `vm_interface`
|
||||
`windows_hyperv_vm_interface_bytes_sent` | _Not yet documented_ | counter | `vm_interface`
|
||||
`windows_hyperv_vm_interface_packets_incoming_dropped` | _Not yet documented_ | counter | `vm_interface`
|
||||
`windows_hyperv_vm_interface_packets_outgoing_dropped` | _Not yet documented_ | counter | `vm_interface`
|
||||
`windows_hyperv_vm_interface_packets_received` | _Not yet documented_ | counter | `vm_interface`
|
||||
`windows_hyperv_vm_interface_packets_sent` | _Not yet documented_ | counter | `vm_interface`
|
||||
### Hyper-V Datastore
|
||||
### Hyper-V Datastore Metrics Documentation
|
||||
|
||||
This documentation outlines the available metrics for monitoring Hyper-V Datastore performance and resource usage using Prometheus. All metrics are prefixed with `windows_hyperv_datastore`.
|
||||
|
||||
| Metric Name | Description | Type | Labels |
|
||||
|------------------------------------------------------------------------|---------------------------------------------------------------------------------|---------|-----------|
|
||||
| `windows_hyperv_datastore_fragmentation_ratio` | Represents the fragmentation ratio of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_sector_size_bytes` | Represents the sector size of the DataStore in bytes. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_data_alignment_bytes` | Represents the data alignment of the DataStore in bytes. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_current_replay_log_size_bytes` | Represents the current replay log size of the DataStore in bytes. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_available_entries` | Represents the number of available entries inside object tables. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_empty_entries` | Represents the number of empty entries inside object tables. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_free_bytes` | Represents the number of free bytes inside key tables. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_data_end_bytes` | Represents the data end of the DataStore in bytes. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_file_objects` | Represents the number of file objects in the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_object_tables` | Represents the number of object tables in the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_key_tables` | Represents the number of key tables in the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_file_data_size_bytes` | Represents the file data size in bytes of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_table_data_size_bytes` | Represents the table data size in bytes of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_names_size_bytes` | Represents the names size in bytes of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_number_of_keys` | Represents the number of keys in the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_reconnect_latency_microseconds` | Represents the reconnect latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_disconnect_count` | Represents the disconnect count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_write_to_file_byte_latency_microseconds` | Represents the write-to-file byte latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_write_to_file_byte_count` | Represents the write-to-file byte count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_write_to_file_count` | Represents the write-to-file count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_read_from_file_byte_latency_microseconds` | Represents the read-from-file byte latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_read_from_file_byte_count` | Represents the read-from-file byte count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_read_from_file_count` | Represents the read-from-file count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_write_to_storage_byte_latency_microseconds` | Represents the write-to-storage byte latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_write_to_storage_byte_count` | Represents the write-to-storage byte count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_write_to_storage_count` | Represents the write-to-storage count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_read_from_storage_byte_latency_microseconds` | Represents the read-from-storage byte latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_read_from_storage_byte_count` | Represents the read-from-storage byte count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_read_from_storage_count` | Represents the read-from-storage count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_commit_byte_latency_microseconds` | Represents the commit byte latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_commit_byte_count` | Represents the commit byte count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_commit_count` | Represents the commit count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_cache_update_operation_latency_microseconds` | Represents the cache update operation latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_cache_update_operation_count` | Represents the cache update operation count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_commit_operation_latency_microseconds` | Represents the commit operation latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_commit_operation_count` | Represents the commit operation count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_compact_operation_latency_microseconds` | Represents the compact operation latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_compact_operation_count` | Represents the compact operation count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_load_file_operation_latency_microseconds` | Represents the load file operation latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_load_file_operation_count` | Represents the load file operation count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_remove_operation_latency_microseconds` | Represents the remove operation latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_remove_operation_count` | Represents the remove operation count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_query_size_operation_latency_microseconds` | Represents the query size operation latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_query_size_operation_count` | Represents the query size operation count of the DataStore. | counter | datastore |
|
||||
| `windows_hyperv_datastore_set_operation_latency_microseconds` | Represents the set operation latency in microseconds of the DataStore. | gauge | datastore |
|
||||
| `windows_hyperv_datastore_set_operation_count` | Represents the set operation count of the DataStore. | counter | datastore |
|
||||
|
||||
### Hyper-V Dynamic Memory Balancer
|
||||
|
||||
Some metrics explained: https://learn.microsoft.com/en-us/archive/blogs/chrisavis/monitoring-dynamic-memory-in-windows-server-hyper-v-2012
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|-------|------------|
|
||||
| `windows_hyperv_dynamic_memory_balancer_available_memory_bytes` | Represents the amount of memory left on the node. | gauge | `balancer` |
|
||||
| `windows_hyperv_dynamic_memory_balancer_available_memory_for_balancing_bytes` | Represents the available memory for balancing purposes. | gauge | `balancer` |
|
||||
| `windows_hyperv_dynamic_memory_balancer_average_pressure_ratio` | Represents the average system pressure on the balancer node among all balanced objects. | gauge | `balancer` |
|
||||
| `windows_hyperv_dynamic_memory_balancer_system_current_pressure_ratio` | Represents the current pressure in the system. | gauge | `balancer` |
|
||||
|
||||
|
||||
### Hyper-V Dynamic Memory VM
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------------------------------------|-----------------------------------------------------------------------------------|---------|--------|
|
||||
| `windows_hyperv_dynamic_memory_vm_added_bytes_total` | Represents the cumulative amount of memory added to the VM. | counter | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_pressure_current_ratio` | Represents the current pressure in the VM. | gauge | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_guest_available_bytes` | Represents the current amount of available memory in the VM (reported by the VM). | gauge | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_guest_visible_physical_memory_bytes` | Represents the amount of memory visible in the VM | gauge | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_pressure_maximum_ratio` | Represents the maximum pressure band in the VM. | gauge | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_add_operations_total` | Represents the total number of add operations for the VM. | counter | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_remove_operations_total` | Represents the total number of remove operations for the VM. | counter | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_pressure_minimum_ratio` | Represents the minimum pressure band in the VM. | gauge | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_physical` | Represents the current amount of memory in the VM. | gauge | `vm` |
|
||||
| `windows_hyperv_dynamic_memory_vm_removed_bytes_total` | Represents the cumulative amount of memory removed from the VM. | counter | `vm` |
|
||||
|
||||
### Hyper-V Hypervisor Logical Processor
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------------------------------------|------------------------------------------------------------------------|---------|----------------|
|
||||
| `windows_hyperv_hypervisor_logical_processor_time_total` | Time that processor spent in different modes (hypervisor, guest, idle) | counter | `core`.`state` |
|
||||
| `windows_hyperv_hypervisor_logical_processor_context_switches_total` | The rate of virtual processor context switches on the processor. | counter | `core` |
|
||||
|
||||
### Hyper-V Hypervisor Root Partition
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
|
||||
| `windows_hyperv_root_partition_address_spaces` | The number of address spaces in the virtual TLB of the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_attached_devices` | The number of devices attached to the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_deposited_pages` | The number of pages deposited into the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_device_dma_errors` | An indicator of illegal DMA requests generated by all devices assigned to the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_device_interrupt_errors` | An indicator of illegal interrupt requests generated by all devices assigned to the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_device_interrupt_mappings` | The number of device interrupt mappings used by the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_device_interrupt_throttle_events` | The number of times an interrupt from a device assigned to the partition was temporarily throttled because the device was generating too many interrupts | gauge | None |
|
||||
| `windows_hyperv_root_partition_preferred_numa_node_index` | The number of pages present in the GPA space of the partition (zero for root partition) | gauge | None |
|
||||
| `windows_hyperv_root_partition_gpa_space_modifications` | The rate of modifications to the GPA space of the partition | counter | None |
|
||||
| `windows_hyperv_root_partition_io_tlb_flush_cost` | The average time (in nanoseconds) spent processing an I/O TLB flush | gauge | None |
|
||||
| `windows_hyperv_root_partition_io_tlb_flush` | The rate of flushes of I/O TLBs of the partition | counter | None |
|
||||
| `windows_hyperv_root_partition_recommended_virtual_tlb_size` | The recommended number of pages to be deposited for the virtual TLB | gauge | None |
|
||||
| `windows_hyperv_root_partition_physical_pages_allocated` | The number of timer interrupts skipped for the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_1G_device_pages` | The number of 1G pages present in the device space of the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_1G_gpa_pages` | The number of 1G pages present in the GPA space of the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_2M_device_pages` | The number of 2M pages present in the device space of the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_2M_gpa_pages` | The number of 2M pages present in the GPA space of the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_4K_device_pages` | The number of 4K pages present in the device space of the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_4K_gpa_pages` | The number of 4K pages present in the GPA space of the partition | gauge | None |
|
||||
| `windows_hyperv_root_partition_virtual_tlb_flush_entries` | The rate of flushes of the entire virtual TLB | counter | None |
|
||||
| `windows_hyperv_root_partition_virtual_tlb_pages` | The number of pages used by the virtual TLB of the partition | gauge | None |
|
||||
|
||||
|
||||
### Hyper-V Hypervisor Root Virtual Processor
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|---------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|---------|----------------|
|
||||
| `windows_hyperv_hypervisor_root_virtual_processor_time_total` | Time that processor spent in different modes (hypervisor, guest_run, guest_idle, remote, total) | counter | `core`.`state` |
|
||||
| `windows_hyperv_hypervisor_root_virtual_cpu_wait_time_per_dispatch_total` | The average time (in nanoseconds) spent waiting for a virtual processor to be dispatched onto a logical processor | counter | `core` |
|
||||
|
||||
|
||||
### Hyper-V Legacy Network Adapter
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|---------------------------------------------------------------|-------------------------------------------------------------------------|---------|-----------|
|
||||
| `windows_hyperv_legacy_network_adapter_bytes_dropped_total` | Bytes Dropped is the number of bytes dropped on the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_legacy_network_adapter_bytes_received_total` | Bytes received is the number of bytes received on the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_legacy_network_adapter_bytes_sent_total` | Bytes sent is the number of bytes sent over the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_legacy_network_adapter_frames_dropped_total` | Frames Dropped is the number of frames dropped on the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_legacy_network_adapter_frames_received_total` | Frames received is the number of frames received on the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_legacy_network_adapter_frames_sent_total` | Frames sent is the number of frames sent over the network adapter | counter | `adapter` |
|
||||
|
||||
|
||||
### Hyper-V Hypervisor Virtual Processor
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|---------|--------------|
|
||||
| `windows_hyperv_hypervisor_virtual_processor_time_total` | Time that processor spent in different modes (hypervisor, guest_run, guest_idle, remote) | counter | `vm`, `core` |
|
||||
| `windows_hyperv_hypervisor_virtual_processor_total_run_time_total` | Time that processor spent | counter | `vm`, `core` |
|
||||
| `windows_hyperv_hypervisor_virtual_processor_cpu_wait_time_per_dispatch_total` | The average time (in nanoseconds) spent waiting for a virtual processor to be dispatched onto a logical processor. | counter | `vm`, `core` |
|
||||
|
||||
### Hyper-V Virtual Network Adapter
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||
| `windows_hyperv_virtual_network_adapter_received_bytes_total` | Represents the total number of bytes received per second by the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_virtual_network_adapter_sent_bytes_total` | Represents the total number of bytes sent per second by the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_virtual_network_adapter_incoming_dropped_packets_total` | Represents the total number of dropped packets per second in the incoming direction of the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_virtual_network_adapter_outgoing_dropped_packets_total` | Represents the total number of dropped packets per second in the outgoing direction of the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_virtual_network_adapter_received_packets_total` | Represents the total number of packets received per second by the network adapter | counter | `adapter` |
|
||||
| `windows_hyperv_virtual_network_adapter_sent_packets_total` | Represents the total number of packets sent per second by the network adapter | counter | `adapter` |
|
||||
|
||||
### Hyper-V Virtual Network Adapter Drop Reasons
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|-------------------------------------------------------|----------------------------------------------|---------|--------------------------------|
|
||||
| `windows_hyperv_virtual_network_adapter_drop_reasons` | Hyper-V Virtual Network Adapter Drop Reasons | counter | `adapter`,`direction`,`reason` |
|
||||
|
||||
### Hyper-V Virtual SMB
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|-------------------------------------------------------|-----------------------------------------------------------------------------------|---------|------------|
|
||||
| `windows_hyperv_virtual_smb_direct_mapped_sections` | Represents the number of direct-mapped sections in the virtual SMB` | gauge | `instance` |
|
||||
| `windows_hyperv_virtual_smb_direct_mapped_pages` | Represents the number of direct-mapped pages in the virtual SMB` | gauge | `instance` |
|
||||
| `windows_hyperv_virtual_smb_write_bytes_rdma` | Represents the number of bytes written per second using RDMA in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_write_bytes` | Represents the number of bytes written per second in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_read_bytes_rdma` | Represents the number of bytes read per second using RDMA in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_read_bytes` | Represents the number of bytes read per second in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_flush_requests` | Represents the number of flush requests per second in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_write_requests_rdma` | Represents the number of write requests per second using RDMA in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_write_requests` | Represents the number of write requests per second in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_read_requests_rdma` | Represents the number of read requests per second using RDMA in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_read_requests` | Represents the number of read requests per second in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_current_pending_requests` | Represents the current number of pending requests in the virtual SMB` | gauge | `instance` |
|
||||
| `windows_hyperv_virtual_smb_current_open_file_count` | Represents the current number of open files in the virtual SMB` | gauge | `instance` |
|
||||
| `windows_hyperv_virtual_smb_tree_connect_count` | Represents the number of tree connects in the virtual SMB` | gauge | `instance` |
|
||||
| `windows_hyperv_virtual_smb_requests` | Represents the number of requests per second in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_sent_bytes` | Represents the number of bytes sent per second in the virtual SMB` | counter | `instance` |
|
||||
| `windows_hyperv_virtual_smb_received_bytes` | Represents the number of bytes received per second in the virtual SMB` | counter | `instance` |
|
||||
|
||||
|
||||
### Hyper-V Virtual Switch
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|---------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||
| `windows_hyperv_vswitch_broadcast_packets_received_total` | Represents the total number of broadcast packets received per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_broadcast_packets_sent_total` | Represents the total number of broadcast packets sent per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_bytes_total` | Represents the total number of bytes per second traversing the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_bytes_received_total` | Represents the total number of bytes received per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_bytes_sent_total` | Represents the total number of bytes sent per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_directed_packets_received_total` | Represents the total number of directed packets received per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_directed_packets_send_total` | Represents the total number of directed packets sent per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_dropped_packets_incoming_total` | Represents the total number of packet dropped per second by the virtual switch in the incoming direction | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_dropped_packets_outcoming_total` | Represents the total number of packet dropped per second by the virtual switch in the outgoing direction | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_extensions_dropped_packets_incoming_total` | Represents the total number of packet dropped per second by the virtual switch extensions in the incoming direction | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_extensions_dropped_packets_outcoming_total` | Represents the total number of packet dropped per second by the virtual switch extensions in the outgoing direction | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_learned_mac_addresses_total` | Represents the total number of learned MAC addresses of the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_multicast_packets_received_total` | Represents the total number of multicast packets received per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_multicast_packets_sent_total` | Represents the total number of multicast packets sent per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_number_of_send_channel_moves_total` | Represents the total number of send channel moves per second on this virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_number_of_vmq_moves_total` | Represents the total number of VMQ moves per second on this virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_packets_flooded_total` | Represents the total number of packets flooded by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_packets_total` | Represents the total number of packets per second traversing the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_packets_received_total` | Represents the total number of packets received per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_packets_sent_total` | Represents the total number of packets send per second by the virtual switch | counter | `vswitch` |
|
||||
| `windows_hyperv_vswitch_purged_mac_addresses_total` | Represents the total number of purged MAC addresses of the virtual switch | counter | `vswitch` |
|
||||
|
||||
### Hyper-V Virtual Storage Device
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|---------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|---------|----------|
|
||||
| `windows_hyperv_virtual_storage_device_error_count_total` | Represents the total number of errors that have occurred on this virtual device. | counter | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_queue_length` | Represents the average queue length on this virtual device. | gauge | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_bytes_read` | Represents the total number of bytes that have been read on this virtual device. | counter | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_operations_read_total` | Represents the total number of read operations that have occurred on this virtual device. | counter | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_bytes_written` | Represents the total number of bytes that have been written on this virtual device. | counter | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_operations_written_total` | Represents the total number of write operations that have occurred on this virtual device. | counter | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_latency_seconds` | Represents the average IO transfer latency for this virtual device. | gauge | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_throughput` | Represents the average number of 8KB IO transfers completed by this virtual device. | gauge | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_normalized_throughput` | Represents the average number of IO transfers completed by this virtual device. | gauge | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_lower_queue_length` | Represents the average queue length on the underlying storage subsystem for this device. | gauge | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_lower_latency_seconds` | Represents the average IO transfer latency on the underlying storage subsystem for this virtual device. | gauge | `device` |
|
||||
| `windows_hyperv_virtual_storage_device_io_quota_replenishment_rate` | Represents the IO quota replenishment rate for this virtual device. | gauge | `device` |
|
||||
|
||||
### Hyper-V VM Vid Partition
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------------|-------------------------------------------------------------------------|-------|--------|
|
||||
| `windows_hyperv_vid_physical_pages_allocated` | The number of physical pages allocated | gauge | `vm` |
|
||||
| `windows_hyperv_vid_preferred_numa_node_index` | The preferred NUMA node index associated with this partition | gauge | `vm` |
|
||||
| `windows_hyperv_vid_remote_physical_pages` | The number of physical pages not allocated from the preferred NUMA node | gauge | `vm` |
|
||||
|
||||
|
||||
### Hyper-V Virtual Machine Health Summary
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------------------|-------------------------------------------------------|-------|--------|
|
||||
| `windows_hyperv_virtual_machine_health_total_count` | Represents the number of virtual machines with health | gauge | None |
|
||||
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
@@ -113,19 +265,19 @@ _This collector does not yet have explained examples, we would appreciate your h
|
||||
## Useful queries
|
||||
Percent of physical CPU resources used per VM (on instance "localhost")
|
||||
```
|
||||
(sum (rate(windows_hyperv_vm_cpu_hypervisor_run_time{instance="localhost"}[1m]))) / ignoring(vm) group_left max (windows_cs_logical_processors{instance="localhost"}) / 100000
|
||||
(sum (rate(windows_hyperv_hypervisor_virtual_processor_time_total{state="hypervisor",instance="localhost"}[1m]))) / ignoring(state,vm) group_left max (windows_cpu_logical_processor{instance="localhost"}) / 100000
|
||||
```
|
||||
Percent of physical CPU resources used by all VMs (on all monitored hosts)
|
||||
```
|
||||
(sum by (instance)(rate(windows_hyperv_vm_cpu_total_run_time{}[1m]))) / max by (instance)(windows_cs_logical_processors{}) / 100000
|
||||
(sum by (instance)(rate(windows_hyperv_hypervisor_virtual_processor_total_run_time_total{}[1m]))) / max by (instance)(windows_cpu_logical_processor{}) / 100000
|
||||
```
|
||||
Percent of physical CPU resources by the hosts themselves (on all monitored hosts)
|
||||
```
|
||||
(sum by (instance)(rate(windows_hyperv_host_cpu_total_run_time{}[1m]))) / sum by (instance)(windows_cs_logical_processors{}) / 100000
|
||||
(sum by (instance)(rate(windows_hyperv_hypervisor_root_virtual_processor_total_run_time_total{state="total"}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) / 100000
|
||||
```
|
||||
Percent of physical CPU resources by the hypervisor (on all monitored hosts)
|
||||
```
|
||||
(sum by (instance)(rate(windows_hyperv_host_lp_total_run_time_percent{}[1m]))) / sum by (instance)(windows_hyperv_hypervisor_logical_processors{}) / 100000
|
||||
(sum by (instance)(rate(windows_hyperv_hypervisor_logical_processor_total_run_time_total{}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) / 100000
|
||||
```
|
||||
|
||||
## Alerting examples
|
||||
|
||||
@@ -28,108 +28,112 @@ If given, an application needs to *not* match the exclude regexp in order for th
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_iis_current_anonymous_users` | The number of users who currently have an anonymous request pending with the web service | gauge | `site`
|
||||
`windows_iis_current_blocked_async_io_requests` | _Not yet documented_ | gauge | `site`
|
||||
`windows_iis_current_cgi_requests` | The number of CGI requests that are being processed simultaneously by the web service | gauge | `site`
|
||||
`windows_iis_current_connections` | The number of active connections to the web service | gauge | `site`
|
||||
`windows_iis_current_isapi_extension_requests` | The number of [ISAPI extension](https://docs.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms525172(v=vs.90)) requests that are being processed simultaneously by the web service | gauge | `site`
|
||||
`windows_iis_current_non_anonymous_users` | The number of users who currently have a nonanonymous request pending with the web service | gauge | `site`
|
||||
`windows_iis_service_uptime` | The uptime for the web service or a Web site (seconds) | gauge | `site`
|
||||
`windows_iis_received_bytes_total` | The total bytes of data that have been received by the web service since the service started | counter | `site`
|
||||
`windows_iis_sent_bytes_total` | The number of data bytes that have been sent by the web service since the service started | counter | `site`
|
||||
`windows_iis_anonymous_users_total` | The number of users who have established an anonymous request since the web service started | counter | `site`
|
||||
`windows_iis_blocked_async_io_requests_total` | The total number of blocked asynchronous I/O requests since the start of the IIS service | counter | `site`
|
||||
`windows_iis_cgi_requests_total` | The number of all CGI requests that have been made since the web service started | counter | `site`
|
||||
`windows_iis_connection_attempts_all_instances_total` | The number of connections to the web service that have been attempted since the service started | counter | `site`
|
||||
`windows_iis_requests_total` | The number of requests that have been made since the web service was started | counter | `site`, `method`
|
||||
`windows_iis_files_received_total` | The total number of files that have been received by the FTP service since the service started | counter | `site`
|
||||
`windows_iis_files_sent_total` | The total number of files that have been sent by the FTP service since the service started | counter | `site`
|
||||
`windows_iis_ipapi_extension_requests_total` | The number of ISAPI extension requests that have been made since the web service started | counter | `site`
|
||||
`windows_iis_locked_errors_total` | The number of requests that have been made since the service started that could not be satisfied by the server because the requested document was locked. Usually reported as HTTP error 423 | counter | `site`
|
||||
`windows_iis_logon_attempts_total` | The number of attempts to log on to the web service that have occurred since the service started | counter | `site`
|
||||
`windows_iis_non_anonymous_users_total` | The number of users who have made nonanonymous requests to the web service since the service started | counter | `site`
|
||||
`windows_iis_not_found_errors_total` | The number of requests that have been made since the service started that were not satisfied by the server because the requested document was not found. Usually reported as HTTP error 404 | counter | `site`
|
||||
`windows_iis_rejected_async_io_requests_total` |The total number of rejected asynchronous I/O requests since the start of the IIS service. | counter | `site`
|
||||
`windows_iis_current_application_pool_state` | The current status of the application pool (1 - Uninitialized, 2 - Initialized, 3 - Running, 4 - Disabling, 5 - Disabled, 6 - Shutdown Pending, 7 - Delete Pending) | gauge | `app`, `state`
|
||||
`windows_iis_current_application_pool_start_time` | The unix timestamp for the application pool start time | gauge | `app`
|
||||
`windows_iis_current_worker_processes` | The current number of worker processes that are running in the application pool | gauge | `app`
|
||||
`windows_iis_maximum_worker_processes` | The maximum number of worker processes that have been created for the application pool since Windows Process Activation Service (WAS) started | gauge | `app`
|
||||
`windows_iis_recent_worker_process_failures` | The number of times that worker processes for the application pool failed during the rapid-fail protection interval | gauge | `app`
|
||||
`windows_iis_time_since_last_worker_process_failure` | The length of time, in seconds, since the last worker process failure occurred for the application pool | gauge | `app`
|
||||
`windows_iis_total_application_pool_recycles` | The number of times that the application pool has been recycled since Windows Process Activation Service (WAS) started | counter | `app`
|
||||
`windows_iis_total_application_pool_start_time` | The unix timestamp for the application pool of when the Windows Process Activation Service (WAS) started | counter | `app`
|
||||
`windows_iis_total_worker_processes_created` | The number of worker processes created for the application pool since Windows Process Activation Service (WAS) started | counter | `app`
|
||||
`windows_iis_total_worker_process_failures` | The number of times that worker processes have crashed since the application pool was started | counter | `app`
|
||||
`windows_iis_total_worker_process_ping_failures` | The number of times that Windows Process Activation Service (WAS) did not receive a response to ping messages sent to a worker process | counter | `app`
|
||||
`windows_iis_total_worker_process_shutdown_failures` | The number of times that Windows Process Activation Service (WAS) failed to shut down a worker process | counter | `app`
|
||||
`windows_iis_total_worker_process_startup_failures` | The number of times that Windows Process Activation Service (WAS) failed to start a worker process | counter | `app`
|
||||
`windows_iis_worker_cache_active_flushed_entries` | Number of file handles cached that will be closed when all current transfers complete | gauge | `app`, `pid`
|
||||
`windows_iis_worker_file_cache_memory_bytes` | Current number of bytes used by file cache | gauge | `app`, `pid`
|
||||
`windows_iis_worker_file_cache_max_memory_bytes` | Maximum number of bytes used by file cache | counter | `app`, `pid`
|
||||
`windows_iis_worker_file_cache_flushes_total` | Total number of file cache flushes (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_file_cache_queries_total` | Total file cache queries (hits + misses) | counter | `app`, `pid`
|
||||
`windows_iis_worker_file_cache_hits_total` | Total number of successful lookups in the user-mode file cache | counter | `app`, `pid`
|
||||
`windows_iis_worker_file_cache_items` | Current number of files whose contents are present in user-mode cache | gauge | `app`, `pid`
|
||||
`windows_iis_worker_file_cache_items_total` | Total number of files whose contents were ever added to the user-mode cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_file_cache_items_flushed_total` | Total number of file handles that have been removed from the user-mode cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_uri_cache_flushes_total` | Total number of URI cache flushes (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_uri_cache_queries_total` | Total number of uri cache queries (hits + misses) | counter | `app`, `pid`
|
||||
`windows_iis_worker_uri_cache_hits_total` | Total number of successful lookups in the user-mode URI cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_uri_cache_items` | Number of URI information blocks currently in the user-mode cache | gauge | `app`, `pid`
|
||||
`windows_iis_worker_uri_cache_items_total` | Total number of URI information blocks added to the user-mode cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_uri_cache_items_flushed_total` | The number of URI information blocks that have been removed from the user-mode cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_metadata_cache_items` | Number of metadata information blocks currently present in user-mode cache | gauge | `app`, `pid`
|
||||
`windows_iis_worker_metadata_cache_flushes_total` | Total number of user-mode metadata cache flushes (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_metadata_cache_queries_total` | Total metadata cache queries (hits + misses) | counter | `app`, `pid`
|
||||
`windows_iis_worker_metadata_cache_hits_total` | Total number of successful lookups in the user-mode metadata cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_metadata_cache_items_cached_total` | Total number of metadata information blocks added to the user-mode cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_metadata_cache_items_flushed_total` | Total number of metadata information blocks removed from the user-mode cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_output_cache_active_flushed_items` |The total number of active and flushed items in the output cache of the IIS worker process. Active items are those that are currently being used to serve client requests, while flushed items are those that have been removed from the cache but are still waiting to be flushed to disk. | counter | `app`, `pid`
|
||||
`windows_iis_worker_output_cache_items` | Number of items current present in output cache | counter | `app`, `pid`
|
||||
`windows_iis_worker_output_cache_memory_bytes` | Current number of bytes used by output cache | counter | `app`, `pid`
|
||||
`windows_iis_worker_output_queries_total` | Total number of output cache queries (hits + misses) | counter | `app`, `pid`
|
||||
`windows_iis_worker_output_cache_hits_total` | Total number of successful lookups in output cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_output_cache_items_flushed_total` | Total number of items flushed from output cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_output_cache_flushes_total` | Total number of flushes of output cache (since service startup) | counter | `app`, `pid`
|
||||
`windows_iis_worker_threads` | Number of threads actively processing requests in the worker process | gauge | `app`, `pid`, `state`
|
||||
`windows_iis_worker_max_threads` | Maximum number of threads to which the thread pool can grow as needed | counter | `app`, `pid`
|
||||
`windows_iis_worker_requests_total` | Total number of HTTP requests served by the worker process | counter | `app`, `pid`
|
||||
`windows_iis_worker_current_requests` | Current number of requests being processed by the worker process | counter | `app`, `pid`
|
||||
`windows_iis_worker_request_errors_total` | Total number of requests that returned an error | counter | `app`, `pid`, `status_code`
|
||||
`windows_iis_worker_current_websocket_requests` | the current number of WebSocket connections being processed by the IIS worker process. | counter | `app`, `pid`
|
||||
`windows_iis_worker_websocket_connection_attempts_total` | the total number of attempted WebSocket connections since the start of the IIS worker process | counter | `app`, `pid`
|
||||
`windows_iis_worker_websocket_connection_accepted_total` | the total number of WebSocket connections that have been successfully established since the start of the IIS worker process | counter | `app`, `pid`
|
||||
`windows_iis_worker_websocket_connection_rejected_total` | the total number of WebSocket connections that have been rejected by the server since the start of the IIS worker process. Connections can be rejected for various reasons, such as capacity limitations, authentication failures, or configuration issues | counter | `app`, `pid`
|
||||
`windows_iis_server_cache_active_flushed_entries` | Number of file handles cached that will be closed when all current transfers complete | counter | None
|
||||
`windows_iis_server_file_cache_memory_bytes` | Current number of bytes used by file cache | gauge | None
|
||||
`windows_iis_server_file_cache_max_memory_bytes` | Maximum number of bytes used by file cache | counter | None
|
||||
`windows_iis_server_file_cache_flushes_total` | Total number of file cache flushes (since service startup) | counter | None
|
||||
`windows_iis_server_file_cache_queries_total` | Total number of file cache queries (hits + misses) | counter | None
|
||||
`windows_iis_server_file_cache_hits_total` | Total number of successful lookups in the file cache | counter | None
|
||||
`windows_iis_server_file_cache_items` | Current number of files whose contents are present in cache | gauge | None
|
||||
`windows_iis_server_file_cache_items_total` | Total number of files whose contents were ever added to the cache (since service startup) | counter | None
|
||||
`windows_iis_server_file_cache_items_flushed_total` | Total number of file handles that have been removed from the cache (since service startup) | counter | None
|
||||
`windows_iis_server_uri_cache_flushes_total` | Total number of URI cache flushes (since service startup) | counter | `mode`
|
||||
`windows_iis_server_uri_cache_queries_total` | Total number of uri cache queries (hits + misses) | counter | `mode`
|
||||
`windows_iis_server_uri_cache_hits_total` | Total number of successful lookups in the URI cache (since service startup) | counter | `mode`
|
||||
`windows_iis_server_uri_cache_items` | Number of URI information blocks currently in the cache | gauge | `mode`
|
||||
`windows_iis_server_uri_cache_items_total` | Total number of URI information blocks added to the cache (since service startup) | counter | `mode`
|
||||
`windows_iis_server_uri_cache_items_flushed_total` | The number of URI information blocks that have been removed from the cache (since service startup) | counter | `mode`
|
||||
`windows_iis_server_metadata_cache_items` | Number of metadata information blocks currently present in cache | gauge | None
|
||||
`windows_iis_server_metadata_cache_flushes_total` | Total number of metadata cache flushes (since service startup) | counter | None
|
||||
`windows_iis_server_metadata_cache_queries_total` | Total metadata cache queries (hits + misses) | counter | None
|
||||
`windows_iis_server_metadata_cache_hits_total` | Total number of successful lookups in the metadata cache (since service startup) | counter | None
|
||||
`windows_iis_server_metadata_cache_items_cached_total` | Total number of metadata information blocks added to the cache (since service startup) | counter | None
|
||||
`windows_iis_server_metadata_cache_items_flushed_total` | Total number of metadata information blocks removed from the cache (since service startup) | counter | None
|
||||
`windows_iis_server_output_cache_active_flushed_items` | The total number of active and flushed items in the output cache of the IIS server | counter | None
|
||||
`windows_iis_server_output_cache_items` | Number of items current present in output cache | counter | None
|
||||
`windows_iis_server_output_cache_memory_bytes` | Current number of bytes used by output cache | counter | None
|
||||
`windows_iis_server_output_cache_queries_total` | Total output cache queries (hits + misses) | counter | None
|
||||
`windows_iis_server_output_cache_hits_total` | Total number of successful lookups in output cache (since service startup) | counter | None
|
||||
`windows_iis_server_output_cache_items_flushed_total` | Total number of items flushed from output cache (since service startup) | counter | None
|
||||
`windows_iis_server_output_cache_flushes_total` | Total number of flushes of output cache (since service startup) | counter | None
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------------------------|
|
||||
| `windows_iis_current_anonymous_users` | The number of users who currently have an anonymous request pending with the web service | gauge | `site` |
|
||||
| `windows_iis_current_blocked_async_io_requests` | _Not yet documented_ | gauge | `site` |
|
||||
| `windows_iis_current_cgi_requests` | The number of CGI requests that are being processed simultaneously by the web service | gauge | `site` |
|
||||
| `windows_iis_current_connections` | The number of active connections to the web service | gauge | `site` |
|
||||
| `windows_iis_current_isapi_extension_requests` | The number of [ISAPI extension](https://docs.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms525172(v=vs.90)) requests that are being processed simultaneously by the web service | gauge | `site` |
|
||||
| `windows_iis_current_non_anonymous_users` | The number of users who currently have a nonanonymous request pending with the web service | gauge | `site` |
|
||||
| `windows_iis_service_uptime` | The uptime for the web service or a Web site (seconds) | gauge | `site` |
|
||||
| `windows_iis_received_bytes_total` | The total bytes of data that have been received by the web service since the service started | counter | `site` |
|
||||
| `windows_iis_sent_bytes_total` | The number of data bytes that have been sent by the web service since the service started | counter | `site` |
|
||||
| `windows_iis_anonymous_users_total` | The number of users who have established an anonymous request since the web service started | counter | `site` |
|
||||
| `windows_iis_blocked_async_io_requests_total` | The total number of blocked asynchronous I/O requests since the start of the IIS service | counter | `site` |
|
||||
| `windows_iis_cgi_requests_total` | The number of all CGI requests that have been made since the web service started | counter | `site` |
|
||||
| `windows_iis_connection_attempts_all_instances_total` | The number of connections to the web service that have been attempted since the service started | counter | `site` |
|
||||
| `windows_iis_requests_total` | The number of requests that have been made since the web service was started | counter | `site`, `method` |
|
||||
| `windows_iis_files_received_total` | The total number of files that have been received by the FTP service since the service started | counter | `site` |
|
||||
| `windows_iis_files_sent_total` | The total number of files that have been sent by the FTP service since the service started | counter | `site` |
|
||||
| `windows_iis_ipapi_extension_requests_total` | The number of ISAPI extension requests that have been made since the web service started | counter | `site` |
|
||||
| `windows_iis_locked_errors_total` | The number of requests that have been made since the service started that could not be satisfied by the server because the requested document was locked. Usually reported as HTTP error 423 | counter | `site` |
|
||||
| `windows_iis_logon_attempts_total` | The number of attempts to log on to the web service that have occurred since the service started | counter | `site` |
|
||||
| `windows_iis_non_anonymous_users_total` | The number of users who have made nonanonymous requests to the web service since the service started | counter | `site` |
|
||||
| `windows_iis_not_found_errors_total` | The number of requests that have been made since the service started that were not satisfied by the server because the requested document was not found. Usually reported as HTTP error 404 | counter | `site` |
|
||||
| `windows_iis_rejected_async_io_requests_total` | The total number of rejected asynchronous I/O requests since the start of the IIS service. | counter | `site` |
|
||||
| `windows_iis_current_application_pool_state` | The current status of the application pool (1 - Uninitialized, 2 - Initialized, 3 - Running, 4 - Disabling, 5 - Disabled, 6 - Shutdown Pending, 7 - Delete Pending) | gauge | `app`, `state` |
|
||||
| `windows_iis_current_application_pool_start_time` | The unix timestamp for the application pool start time | gauge | `app` |
|
||||
| `windows_iis_current_worker_processes` | The current number of worker processes that are running in the application pool | gauge | `app` |
|
||||
| `windows_iis_maximum_worker_processes` | The maximum number of worker processes that have been created for the application pool since Windows Process Activation Service (WAS) started | gauge | `app` |
|
||||
| `windows_iis_recent_worker_process_failures` | The number of times that worker processes for the application pool failed during the rapid-fail protection interval | gauge | `app` |
|
||||
| `windows_iis_time_since_last_worker_process_failure` | The length of time, in seconds, since the last worker process failure occurred for the application pool | gauge | `app` |
|
||||
| `windows_iis_total_application_pool_recycles` | The number of times that the application pool has been recycled since Windows Process Activation Service (WAS) started | counter | `app` |
|
||||
| `windows_iis_total_application_pool_start_time` | The unix timestamp for the application pool of when the Windows Process Activation Service (WAS) started | counter | `app` |
|
||||
| `windows_iis_total_worker_processes_created` | The number of worker processes created for the application pool since Windows Process Activation Service (WAS) started | counter | `app` |
|
||||
| `windows_iis_total_worker_process_failures` | The number of times that worker processes have crashed since the application pool was started | counter | `app` |
|
||||
| `windows_iis_total_worker_process_ping_failures` | The number of times that Windows Process Activation Service (WAS) did not receive a response to ping messages sent to a worker process | counter | `app` |
|
||||
| `windows_iis_total_worker_process_shutdown_failures` | The number of times that Windows Process Activation Service (WAS) failed to shut down a worker process | counter | `app` |
|
||||
| `windows_iis_total_worker_process_startup_failures` | The number of times that Windows Process Activation Service (WAS) failed to start a worker process | counter | `app` |
|
||||
| `windows_iis_worker_cache_active_flushed_entries` | Number of file handles cached that will be closed when all current transfers complete | gauge | `app`, `pid` |
|
||||
| `windows_iis_worker_file_cache_memory_bytes` | Current number of bytes used by file cache | gauge | `app`, `pid` |
|
||||
| `windows_iis_worker_file_cache_max_memory_bytes` | Maximum number of bytes used by file cache | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_file_cache_flushes_total` | Total number of file cache flushes (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_file_cache_queries_total` | Total file cache queries (hits + misses) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_file_cache_hits_total` | Total number of successful lookups in the user-mode file cache | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_file_cache_items` | Current number of files whose contents are present in user-mode cache | gauge | `app`, `pid` |
|
||||
| `windows_iis_worker_file_cache_items_total` | Total number of files whose contents were ever added to the user-mode cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_file_cache_items_flushed_total` | Total number of file handles that have been removed from the user-mode cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_uri_cache_flushes_total` | Total number of URI cache flushes (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_uri_cache_queries_total` | Total number of uri cache queries (hits + misses) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_uri_cache_hits_total` | Total number of successful lookups in the user-mode URI cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_uri_cache_items` | Number of URI information blocks currently in the user-mode cache | gauge | `app`, `pid` |
|
||||
| `windows_iis_worker_uri_cache_items_total` | Total number of URI information blocks added to the user-mode cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_uri_cache_items_flushed_total` | The number of URI information blocks that have been removed from the user-mode cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_metadata_cache_items` | Number of metadata information blocks currently present in user-mode cache | gauge | `app`, `pid` |
|
||||
| `windows_iis_worker_metadata_cache_flushes_total` | Total number of user-mode metadata cache flushes (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_metadata_cache_queries_total` | Total metadata cache queries (hits + misses) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_metadata_cache_hits_total` | Total number of successful lookups in the user-mode metadata cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_metadata_cache_items_cached_total` | Total number of metadata information blocks added to the user-mode cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_metadata_cache_items_flushed_total` | Total number of metadata information blocks removed from the user-mode cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_output_cache_active_flushed_items` | The total number of active and flushed items in the output cache of the IIS worker process. Active items are those that are currently being used to serve client requests, while flushed items are those that have been removed from the cache but are still waiting to be flushed to disk. | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_output_cache_items` | Number of items current present in output cache | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_output_cache_memory_bytes` | Current number of bytes used by output cache | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_output_queries_total` | Total number of output cache queries (hits + misses) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_output_cache_hits_total` | Total number of successful lookups in output cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_output_cache_items_flushed_total` | Total number of items flushed from output cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_output_cache_flushes_total` | Total number of flushes of output cache (since service startup) | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_threads` | Number of threads actively processing requests in the worker process | gauge | `app`, `pid`, `state` |
|
||||
| `windows_iis_worker_max_threads` | Maximum number of threads to which the thread pool can grow as needed | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_requests_total` | Total number of HTTP requests served by the worker process | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_current_requests` | Current number of requests being processed by the worker process | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_request_errors_total` | Total number of requests that returned an error | counter | `app`, `pid`, `status_code` |
|
||||
| `windows_iis_worker_current_websocket_requests` | the current number of WebSocket connections being processed by the IIS worker process. | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_websocket_connection_attempts_total` | the total number of attempted WebSocket connections since the start of the IIS worker process | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_websocket_connection_accepted_total` | the total number of WebSocket connections that have been successfully established since the start of the IIS worker process | counter | `app`, `pid` |
|
||||
| `windows_iis_worker_websocket_connection_rejected_total` | the total number of WebSocket connections that have been rejected by the server since the start of the IIS worker process. Connections can be rejected for various reasons, such as capacity limitations, authentication failures, or configuration issues | counter | `app`, `pid` |
|
||||
| `windows_iis_server_cache_active_flushed_entries` | Number of file handles cached that will be closed when all current transfers complete | counter | None |
|
||||
| `windows_iis_server_file_cache_memory_bytes` | Current number of bytes used by file cache | gauge | None |
|
||||
| `windows_iis_server_file_cache_max_memory_bytes` | Maximum number of bytes used by file cache | counter | None |
|
||||
| `windows_iis_server_file_cache_flushes_total` | Total number of file cache flushes (since service startup) | counter | None |
|
||||
| `windows_iis_server_file_cache_queries_total` | Total number of file cache queries (hits + misses) | counter | None |
|
||||
| `windows_iis_server_file_cache_hits_total` | Total number of successful lookups in the file cache | counter | None |
|
||||
| `windows_iis_server_file_cache_items` | Current number of files whose contents are present in cache | gauge | None |
|
||||
| `windows_iis_server_file_cache_items_total` | Total number of files whose contents were ever added to the cache (since service startup) | counter | None |
|
||||
| `windows_iis_server_file_cache_items_flushed_total` | Total number of file handles that have been removed from the cache (since service startup) | counter | None |
|
||||
| `windows_iis_server_uri_cache_flushes_total` | Total number of URI cache flushes (since service startup) | counter | `mode` |
|
||||
| `windows_iis_server_uri_cache_queries_total` | Total number of uri cache queries (hits + misses) | counter | `mode` |
|
||||
| `windows_iis_server_uri_cache_hits_total` | Total number of successful lookups in the URI cache (since service startup) | counter | `mode` |
|
||||
| `windows_iis_server_uri_cache_items` | Number of URI information blocks currently in the cache | gauge | `mode` |
|
||||
| `windows_iis_server_uri_cache_items_total` | Total number of URI information blocks added to the cache (since service startup) | counter | `mode` |
|
||||
| `windows_iis_server_uri_cache_items_flushed_total` | The number of URI information blocks that have been removed from the cache (since service startup) | counter | `mode` |
|
||||
| `windows_iis_server_metadata_cache_items` | Number of metadata information blocks currently present in cache | gauge | None |
|
||||
| `windows_iis_server_metadata_cache_flushes_total` | Total number of metadata cache flushes (since service startup) | counter | None |
|
||||
| `windows_iis_server_metadata_cache_queries_total` | Total metadata cache queries (hits + misses) | counter | None |
|
||||
| `windows_iis_server_metadata_cache_hits_total` | Total number of successful lookups in the metadata cache (since service startup) | counter | None |
|
||||
| `windows_iis_server_metadata_cache_items_cached_total` | Total number of metadata information blocks added to the cache (since service startup) | counter | None |
|
||||
| `windows_iis_server_metadata_cache_items_flushed_total` | Total number of metadata information blocks removed from the cache (since service startup) | counter | None |
|
||||
| `windows_iis_server_output_cache_active_flushed_items` | The total number of active and flushed items in the output cache of the IIS server | counter | None |
|
||||
| `windows_iis_server_output_cache_items` | Number of items current present in output cache | counter | None |
|
||||
| `windows_iis_server_output_cache_memory_bytes` | Current number of bytes used by output cache | counter | None |
|
||||
| `windows_iis_server_output_cache_queries_total` | Total output cache queries (hits + misses) | counter | None |
|
||||
| `windows_iis_server_output_cache_hits_total` | Total number of successful lookups in output cache (since service startup) | counter | None |
|
||||
| `windows_iis_server_output_cache_items_flushed_total` | Total number of items flushed from output cache (since service startup) | counter | None |
|
||||
| `windows_iis_server_output_cache_flushes_total` | Total number of flushes of output cache (since service startup) | counter | None |
|
||||
| `windows_iis_http_requests_current_queue_size` | Http Request Current queue size | counter | None |
|
||||
| `windows_iis_http_request_total_rejected_request` | Http Request total rejected request | counter | None |
|
||||
| `windows_iis_http_requests_max_queue_item_age` | Http Request Max queue Item age | counter | None |
|
||||
| `windows_iis_http_requests_arrival_rate` | Http requests Arrival Rate | counter | None |
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
The logical_disk collector exposes metrics about logical disks (in contrast to physical disks)
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `logical_disk`
|
||||
Data source | Perflib
|
||||
Counters | `LogicalDisk` ([`Win32_PerfRawData_PerfDisk_LogicalDisk`](https://msdn.microsoft.com/en-us/windows/hardware/aa394307(v=vs.71)))
|
||||
Enabled by default? | Yes
|
||||
| | |
|
||||
|---------------------|------------------|
|
||||
| Metric name prefix | `logical_disk` |
|
||||
| Data source | Performance Data |
|
||||
| Counters | `LogicalDisk` |
|
||||
| Enabled by default? | Yes |
|
||||
|
||||
## Flags
|
||||
|
||||
@@ -19,25 +19,30 @@ If given, a disk needs to match the include regexp in order for the correspondin
|
||||
|
||||
If given, a disk needs to *not* match the exclude regexp in order for the corresponding disk metrics to be reported
|
||||
|
||||
### `--collector.logical_disk.enabled`
|
||||
|
||||
Comma-separated list of collectors to use. Available collectors: metrics, bitlocker_status. Defaults to metrics, if not specified.
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_logical_disk_info` | A metric with a constant '1' value labeled with logical disk information | gauge | `disk`,`filesystem`,`serial_number`,`volume`,`volume_name`,`type`
|
||||
`windows_logical_disk_requests_queued` | Number of requests outstanding on the disk at the time the performance data is collected | gauge | `volume`
|
||||
`windows_logical_disk_avg_read_requests_queued` | Average number of read requests that were queued for the selected disk during the sample interval | gauge | `volume`
|
||||
`windows_logical_disk_avg_write_requests_queued` | Average number of write requests that were queued for the selected disk during the sample interval | gauge | `volume`
|
||||
`windows_logical_disk_read_bytes_total` | Rate at which bytes are transferred from the disk during read operations | counter | `volume`
|
||||
`windows_logical_disk_reads_total` | Rate of read operations on the disk | counter | `volume`
|
||||
`windows_logical_disk_write_bytes_total` | Rate at which bytes are transferred to the disk during write operations | counter | `volume`
|
||||
`windows_logical_disk_writes_total` | Rate of write operations on the disk | counter | `volume`
|
||||
`windows_logical_disk_read_seconds_total` | Seconds the disk was busy servicing read requests | counter | `volume`
|
||||
`windows_logical_disk_write_seconds_total` | Seconds the disk was busy servicing write requests | counter | `volume`
|
||||
`windows_logical_disk_free_bytes` | Unused space of the disk in bytes (not real time, updates every 10-15 min) | gauge | `volume`
|
||||
`windows_logical_disk_size_bytes` | Total size of the disk in bytes (not real time, updates every 10-15 min) | gauge | `volume`
|
||||
`windows_logical_disk_idle_seconds_total` | Seconds the disk was idle (not servicing read/write requests) | counter | `volume`
|
||||
`windows_logical_disk_split_ios_total` | Number of I/Os to the disk split into multiple I/Os | counter | `volume`
|
||||
`windows_logical_disk_readonly` | Whether the logical disk is read-only | gauge | `volume`
|
||||
| Name | Description | Type | Labels |
|
||||
|--------------------------------------------------|----------------------------------------------------------------------------------------------------|---------|-------------------------------------------------------------------|
|
||||
| `windows_logical_disk_info` | A metric with a constant '1' value labeled with logical disk information | gauge | `disk`,`filesystem`,`serial_number`,`volume`,`volume_name`,`type` |
|
||||
| `windows_logical_disk_requests_queued` | Number of requests outstanding on the disk at the time the performance data is collected | gauge | `volume` |
|
||||
| `windows_logical_disk_avg_read_requests_queued` | Average number of read requests that were queued for the selected disk during the sample interval | gauge | `volume` |
|
||||
| `windows_logical_disk_avg_write_requests_queued` | Average number of write requests that were queued for the selected disk during the sample interval | gauge | `volume` |
|
||||
| `windows_logical_disk_read_bytes_total` | Rate at which bytes are transferred from the disk during read operations | counter | `volume` |
|
||||
| `windows_logical_disk_reads_total` | Rate of read operations on the disk | counter | `volume` |
|
||||
| `windows_logical_disk_write_bytes_total` | Rate at which bytes are transferred to the disk during write operations | counter | `volume` |
|
||||
| `windows_logical_disk_writes_total` | Rate of write operations on the disk | counter | `volume` |
|
||||
| `windows_logical_disk_read_seconds_total` | Seconds the disk was busy servicing read requests | counter | `volume` |
|
||||
| `windows_logical_disk_write_seconds_total` | Seconds the disk was busy servicing write requests | counter | `volume` |
|
||||
| `windows_logical_disk_free_bytes` | Unused space of the disk in bytes (not real time, updates every 10-15 min) | gauge | `volume` |
|
||||
| `windows_logical_disk_size_bytes` | Total size of the disk in bytes (not real time, updates every 10-15 min) | gauge | `volume` |
|
||||
| `windows_logical_disk_idle_seconds_total` | Seconds the disk was idle (not servicing read/write requests) | counter | `volume` |
|
||||
| `windows_logical_disk_split_ios_total` | Number of I/Os to the disk split into multiple I/Os | counter | `volume` |
|
||||
| `windows_logical_disk_readonly` | Whether the logical disk is read-only | gauge | `volume` |
|
||||
| `windows_logical_disk_bitlocker_status` | BitLocker status for the logical disk | gauge | `volume`,`status` |
|
||||
|
||||
### Warning about size metrics
|
||||
The `free_bytes` and `size_bytes` metrics are not updated in real time and might have a delay of 10-15min.
|
||||
@@ -69,6 +74,23 @@ Show volume usage (%)
|
||||
100.0 - 100 * (windows_logical_disk_free_bytes{instance="localhost", volume="C:"} / windows_logical_disk_size_bytes{instance="localhost", volume="C:"})
|
||||
```
|
||||
|
||||
Disk Activity
|
||||
```promql
|
||||
(
|
||||
rate(windows_logical_disk_read_seconds_total[2m])
|
||||
+
|
||||
rate(windows_logical_disk_write_seconds_total[2m])
|
||||
)
|
||||
/
|
||||
(
|
||||
rate(windows_logical_disk_read_seconds_total[2m])
|
||||
+
|
||||
rate(windows_logical_disk_write_seconds_total[2m])
|
||||
+
|
||||
rate(windows_logical_disk_idle_seconds_total[2m])
|
||||
)
|
||||
```
|
||||
|
||||
## Alerting examples
|
||||
**prometheus.rules**
|
||||
```yaml
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
# logon collector
|
||||
|
||||
The logon collector exposes metrics detailing the active user logon sessions.
|
||||
|
||||
| | |
|
||||
|---------------------|-----------|
|
||||
| Metric name prefix | `logon` |
|
||||
| Source | Win32 API |
|
||||
| Enabled by default? | No |
|
||||
|
||||
## Flags
|
||||
|
||||
None
|
||||
|
||||
## Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|-------------------------------------------|--------------------------------------------|-------|------------------------------------|
|
||||
| `windows_logon_session_logon_timestamp_seconds` | timestamp of the logon session in seconds. | gauge | `domain`, `id`, `type`, `username` |
|
||||
|
||||
### Example metric
|
||||
Query the total number of interactive logon sessions
|
||||
```
|
||||
# HELP windows_logon_session_logon_timestamp_seconds timestamp of the logon session in seconds.
|
||||
# TYPE windows_logon_session_logon_timestamp_seconds gauge
|
||||
windows_logon_session_logon_timestamp_seconds{domain="",id="0x0:0x8c54",type="System",username=""} 1.72876928e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Font Driver Host",id="0x0:0x991a",type="Interactive",username="UMFD-1"} 1.728769282e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Font Driver Host",id="0x0:0x9933",type="Interactive",username="UMFD-0"} 1.728769282e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Font Driver Host",id="0x0:0x994a",type="Interactive",username="UMFD-0"} 1.728769282e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Font Driver Host",id="0x0:0x999d",type="Interactive",username="UMFD-1"} 1.728769282e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Font Driver Host",id="0x0:0xbf25a",type="Interactive",username="UMFD-2"} 1.728769532e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Font Driver Host",id="0x0:0xbf290",type="Interactive",username="UMFD-2"} 1.728769532e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x130241",type="Network",username="vm-jok-dev$"} 1.728769625e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x24f7c9",type="Network",username="vm-jok-dev$"} 1.728770121e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x276846",type="Network",username="vm-jok-dev$"} 1.728770195e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x3e4",type="Service",username="vm-jok-dev$"} 1.728769283e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x3e7",type="System",username="vm-jok-dev$"} 1.728769279e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x71d0f",type="Network",username="vm-jok-dev$"} 1.728769324e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x720a3",type="Network",username="vm-jok-dev$"} 1.728769324e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x725cb",type="Network",username="vm-jok-dev$"} 1.728769324e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0x753d8",type="Network",username="vm-jok-dev$"} 1.728769325e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0xa3913",type="Network",username="vm-jok-dev$"} 1.728769385e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0xbe7f2",type="Network",username="jok"} 1.728769531e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="JKROEPKE",id="0x0:0xc76c4",type="RemoteInteractive",username="jok"} 1.728769533e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="NT AUTHORITY",id="0x0:0x3e3",type="Service",username="IUSR"} 1.728769295e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="NT AUTHORITY",id="0x0:0x3e5",type="Service",username="LOCAL SERVICE"} 1.728769283e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="NT Service",id="0x0:0xae4c7",type="Service",username="MSSQLSERVER"} 1.728769425e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="NT Service",id="0x0:0xb42f1",type="Service",username="SQLTELEMETRY"} 1.728769431e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Window Manager",id="0x0:0xbfbac",type="Interactive",username="DWM-2"} 1.728769532e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Window Manager",id="0x0:0xbfc72",type="Interactive",username="DWM-2"} 1.728769532e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Window Manager",id="0x0:0xdedd",type="Interactive",username="DWM-1"} 1.728769283e+09
|
||||
windows_logon_session_logon_timestamp_seconds{domain="Window Manager",id="0x0:0xdefd",type="Interactive",username="DWM-1"} 1.728769283e+09
|
||||
```
|
||||
|
||||
### Possible values for `type`
|
||||
|
||||
- System
|
||||
- Interactive
|
||||
- Network
|
||||
- Batch
|
||||
- Service
|
||||
- Proxy
|
||||
- Unlock
|
||||
- NetworkCleartext
|
||||
- NewCredentials
|
||||
- RemoteInteractive
|
||||
- CachedInteractive
|
||||
- CachedRemoteInteractive
|
||||
- CachedUnlock
|
||||
|
||||
## Useful queries
|
||||
Query the total number of local and remote (I.E. Terminal Services) interactive sessions.
|
||||
```
|
||||
count(windows_logon_logon_type{type=~"Interactive|RemoteInteractive"}) by (type)
|
||||
```
|
||||
|
||||
## Alerting examples
|
||||
_This collector doesn’t yet have alerting examples, we would appreciate your help adding them!_
|
||||
@@ -68,7 +68,7 @@ Show memory usage for instance (%)
|
||||
```yaml
|
||||
# Alert on hosts that have exhausted all available physical memory
|
||||
- alert: MemoryExhausted
|
||||
expr: windows_os_physical_memory_free_bytes == 0
|
||||
expr: windows_memory_physical_free_bytes == 0
|
||||
for: 10m
|
||||
labels:
|
||||
severity: high
|
||||
|
||||
@@ -109,7 +109,7 @@ Matching is case-sensitive.
|
||||
| `mscluster_network_Role` | Provides access to the network's Role property. The Role property describes the role of the network in the cluster. 0: None; 1: Cluster; 2: Client; 3: Both | gauge | `name` |
|
||||
| `mscluster_network_State` | Provides the current state of the network. 1-1: Unknown; 0: Unavailable; 1: Down; 2: Partitioned; 3: Up | gauge | `name` |
|
||||
|
||||
### Network
|
||||
### Node
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|--------|
|
||||
|
||||
@@ -2,26 +2,22 @@
|
||||
|
||||
The msmq collector exposes metrics about the queues on a MSMQ server
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `msmq`
|
||||
Classes | `Win32_PerfRawData_MSMQ_MSMQQueue`
|
||||
Enabled by default? | No
|
||||
| | |
|
||||
|---------------------|----------------------|
|
||||
| Metric name prefix | `msmq` |
|
||||
| Source | Performance Counters |
|
||||
| Enabled by default? | No |
|
||||
|
||||
## Flags
|
||||
|
||||
### `--collector.msmq.msmq-where`
|
||||
|
||||
A WMI filter on which queues to include. `%` is a wildcard, and can be used to match on substrings.
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_msmq_bytes_in_journal_queue` | Size of queue journal in bytes | gauge | `name`
|
||||
`windows_msmq_bytes_in_queue` | Size of queue in bytes | gauge | `name`
|
||||
`windows_msmq_messages_in_journal_queue` | Count messages in queue journal | gauge | `name`
|
||||
`windows_msmq_messages_in_queue` | Count messages in queue | gauge | `name`
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------|---------------------------------|-------|--------|
|
||||
| `windows_msmq_bytes_in_journal_queue` | Size of queue journal in bytes | gauge | `name` |
|
||||
| `windows_msmq_bytes_in_queue` | Size of queue in bytes | gauge | `name` |
|
||||
| `windows_msmq_messages_in_journal_queue` | Count messages in queue journal | gauge | `name` |
|
||||
| `windows_msmq_messages_in_queue` | Count messages in queue | gauge | `name` |
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
|
||||
@@ -10,252 +10,250 @@ Enabled by default? | No
|
||||
|
||||
## Flags
|
||||
|
||||
### `--collectors.mssql.classes-enabled`
|
||||
### `--collectors.mssql.enabled`
|
||||
|
||||
Comma-separated list of MSSQL WMI classes to use. Supported values are `accessmethods`, `availreplica`, `bufman`, `databases`, `dbreplica`, `genstats`, `locks`, `memmgr`, `sqlstats`, `sqlerrors`, `transactions`, and `waitstats`.
|
||||
|
||||
### `--collectors.mssql.class-print`
|
||||
|
||||
If true, print available mssql WMI classes and exit. Only displays if the mssql collector is enabled.
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_mssql_collector_duration_seconds` | The time taken for each sub-collector to return | gauge | `collector`, `mssql_instance`
|
||||
`windows_mssql_collector_success` | 1 if sub-collector succeeded, 0 otherwise | gauge | `collector`, `mssql_instance`
|
||||
`windows_mssql_accessmethods_au_batch_cleanups` | The total number of batches that were completed successfully by the background task that cleans up deferred dropped allocation units | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_au_cleanups` | The total number of allocation units that were successfully dropped the background task that cleans up deferred dropped allocation units. Each allocation unit drop requires multiple batches | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_by_reference_lob_creates` | The total count of large object (lob) values that were passed by reference. By-reference lobs are used in certain bulk operations to avoid the cost of passing them by value | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_by_reference_lob_uses` | The total count of by-reference lob values that were used. By-reference lobs are used in certain bulk operations to avoid the cost of passing them by-value | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_lob_read_aheads` | The total count of lob pages on which readahead was issued | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_column_value_pulls` | The total count of column values that were pulled in-row from off-row | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_column_value_pushes` | The total count of column values that were pushed from in-row to off-row | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_deferred_dropped_aus` | The total number of allocation units waiting to be dropped by the background task that cleans up deferred dropped allocation units | gauge | `mssql_instance`
|
||||
`windows_mssql_accessmethods_deferred_dropped_rowsets` | The number of rowsets created as a result of aborted online index build operations that are waiting to be dropped by the background task that cleans up deferred dropped rowsets | gauge | `mssql_instance`
|
||||
`windows_mssql_accessmethods_dropped_rowset_cleanups` | The number of rowsets per second created as a result of aborted online index build operations that were successfully dropped by the background task that cleans up deferred dropped rowsets | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_dropped_rowset_skips` | The number of rowsets per second created as a result of aborted online index build operations that were skipped by the background task that cleans up deferred dropped rowsets created | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_extent_deallocations` | Number of extents deallocated per second in all databases in this instance of SQL Server | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_extent_allocations` | Number of extents allocated per second in all databases in this instance of SQL Server | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_au_batch_cleanup_failures` | The number of batches per second that failed and required retry, by the background task that cleans up deferred dropped allocation units. Failure could be due to lack of memory or disk space, hardware failure and other reasons | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_leaf_page_cookie_failures` | The number of times that a leaf page cookie could not be used during an index search since changes happened on the leaf page. The cookie is used to speed up index search | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_tree_page_cookie_failures` | The number of times that a tree page cookie could not be used during an index search since changes happened on the parent pages of those tree pages. The cookie is used to speed up index search | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_forwarded_records` | Number of records per second fetched through forwarded record pointers | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_free_space_page_fetches` | Number of pages fetched per second by free space scans. These scans search for free space within pages already allocated to an allocation unit, to satisfy requests to insert or modify record fragments | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_free_space_scans` | Number of scans per second that were initiated to search for free space within pages already allocated to an allocation unit to insert or modify record fragment. Each scan may find multiple pages | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_full_scans` | Number of unrestricted full scans per second. These can be either base-table or full-index scans | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_index_searches` | Number of index searches per second. These are used to start a range scan, reposition a range scan, revalidate a scan point, fetch a single index record, and search down the index to locate where to insert a new row | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_insysxact_waits` | Number of times a reader needs to wait for a page because the InSysXact bit is set | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_lob_handle_creates` | Count of temporary lobs created | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_lob_handle_destroys` | Count of temporary lobs destroyed | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_lob_ss_provider_creates` | Count of LOB Storage Service Providers (LobSSP) created. One worktable created per LobSSP | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_lob_ss_provider_destroys` | Count of LobSSP destroyed | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_lob_ss_provider_truncations` | Count of LobSSP truncated | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_mixed_page_allocations` | Number of pages allocated per second from mixed extents. These could be used for storing the IAM pages and the first eight pages that are allocated to an allocation unit | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_page_compression_attempts` | Number of pages evaluated for page-level compression. Includes pages that were not compressed because significant savings could be achieved. Includes all objects in the instance of SQL Server | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_page_deallocations` | Number of pages deallocated per second in all databases in this instance of SQL Server. These include pages from mixed extents and uniform extents | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_page_allocations` | Number of pages allocated per second in all databases in this instance of SQL Server. These include pages allocations from both mixed extents and uniform extents | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_page_compressions` | Number of data pages that are compressed by using PAGE compression. Includes all objects in the instance of SQL Server | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_page_splits` | Number of page splits per second that occur as the result of overflowing index pages | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_probe_scans` | Number of probe scans per second that are used to find at most one single qualified row in an index or base table directly | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_range_scans` | Number of qualified range scans through indexes per second | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_scan_point_revalidations` | Number of times per second that the scan point had to be revalidated to continue the scan | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_ghost_record_skips` | Number of ghosted records per second skipped during scans | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_table_lock_escalations` | Number of times locks on a table were escalated to the TABLE or HoBT granularity | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_leaf_page_cookie_uses` | Number of times a leaf page cookie is used successfully during an index search since no change happened on the leaf page. The cookie is used to speed up index search | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_tree_page_cookie_uses` | Number of times a tree page cookie is used successfully during an index search since no change happened on the parent page of the tree page. The cookie is used to speed up index search | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_workfile_creates` | Number of work files created per second. For example, work files could be used to store temporary results for hash joins and hash aggregates | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_worktables_creates` | Number of work tables created per second. For example, work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors | counter | `mssql_instance`
|
||||
`windows_mssql_accessmethods_worktables_from_cache_ratio` | Percentage of work tables created where the initial two pages of the work table were not allocated but were immediately available from the work table cache | counter | `mssql_instance`
|
||||
`windows_mssql_availreplica_received_from_replica_bytes` | Number of bytes received from the availability replica per second. Pings and status updates will generate network traffic even on databases with no user updates | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_availreplica_sent_to_replica_bytes` | Number of bytes sent to the remote availability replica per second. On the primary replica this is the number of bytes sent to the secondary replica. On the secondary replica this is the number of bytes sent to the primary replica | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_availreplica_sent_to_transport_bytes` | Actual number of bytes sent per second over the network to the remote availability replica. On the primary replica this is the number of bytes sent to the secondary replica. On the secondary replica this is the number of bytes sent to the primary replica | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_availreplica_initiated_flow_controls` | Time in milliseconds that log stream messages waited for send flow control, in the last second | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_availreplica_flow_control_wait_seconds` | Number of times flow-control initiated in the last second. Flow Control Time (ms/sec) divided by Flow Control/sec is the average time per wait | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_availreplica_receives_from_replica` | Number of Always On messages received from thereplica per second | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_availreplica_resent_messages` | Number of Always On messages resent in the last second | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_availreplica_sends_to_replica` | Number of Always On messages sent to this availability replica per second | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_availreplica_sends_to_transport` | Actual number of Always On messages sent per second over the network to the remote availability replica | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_bufman_background_writer_pages` | Number of pages flushed to enforce the recovery interval settings | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_buffer_cache_hit_ratio` | Indicates the percentage of pages found in the buffer cache without having to read from disk. The ratio is the total number of cache hits divided by the total number of cache lookups over the last few thousand page accesses | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_checkpoint_pages` | Indicates the number of pages flushed to disk per second by a checkpoint or other operation that require all dirty pages to be flushed | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_database_pages` | Indicates the number of pages in the buffer pool with database content | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_extension_allocated_pages` | Total number of non-free cache pages in the buffer pool extension file | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_extension_free_pages` | Total number of free cache pages in the buffer pool extension file | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_extension_in_use_as_percentage` | _Not yet documented_ | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_extension_outstanding_io` | Percentage of the buffer pool extension paging file occupied by buffer manager pages | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_extension_page_evictions` | Number of pages evicted from the buffer pool extension file per second | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_extension_page_reads` | Number of pages read from the buffer pool extension file per second | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_extension_page_unreferenced_seconds` | Average seconds a page will stay in the buffer pool extension without references to it | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_extension_page_writes` | Number of pages written to the buffer pool extension file per second | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_free_list_stalls` | Indicates the number of requests per second that had to wait for a free page | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_integral_controller_slope` | The slope that integral controller for the buffer pool last used, times -10 billion | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_lazywrites` | Indicates the number of buffers written per second by the buffer manager's lazy writer | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_page_life_expectancy_seconds` | Indicates the number of seconds a page will stay in the buffer pool without references | gauge | `mssql_instance`
|
||||
`windows_mssql_bufman_page_lookups` | Indicates the number of requests per second to find a page in the buffer pool | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_page_reads` | Indicates the number of physical database page reads that are issued per second | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_page_writes` | Indicates the number of physical database page writes that are issued per second | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_read_ahead_pages` | Indicates the number of pages read per second in anticipation of use | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_read_ahead_issuing_seconds` | Time (microseconds) spent issuing readahead | counter | `mssql_instance`
|
||||
`windows_mssql_bufman_target_pages` | Ideal number of pages in the buffer pool | gauge | `mssql_instance`
|
||||
`windows_mssql_dbreplica_database_flow_control_wait_seconds` | _Not yet documented_ | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_database_initiated_flow_controls` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_received_file_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_group_commits` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_group_commit_stall_seconds` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_apply_pending_queue` | _Not yet documented_ | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_apply_ready_queue` | _Not yet documented_ | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_compressed_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_decompressed_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_received_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_compression_cachehits` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_compression_cachemisses` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_compressions` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_decompressions` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_remaining_for_undo` | The amount of log, in bytes, remaining to complete the undo phase | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_log_send_queue` | Amount of log records in the log files of the primary database, in kilobytes, that haven't been sent to the secondary replica | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_mirrored_write_transactions` | Number of transactions that were written to the primary database and then waited to commit until the log was sent to the secondary database, in the last second | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_recovery_queue_records` | Amount of log records in the log files of the secondary replica that have not been redone | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_redo_blocks` | Number of times the redo thread was blocked on locks held by readers of the database | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_redo_remaining_bytes` | The amount of log, in kilobytes, remaining to be redone to finish the reverting phase | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_redone_bytes` | Amount of log records redone on the secondary database in the last second | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_redones` | _Not yet documented_ | counter | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_total_log_requiring_undo` | Total kilobytes of log that must be undone | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_dbreplica_transaction_delay_seconds` | Delay in waiting for unterminated commit acknowledgment for all the current transactions | gauge | `mssql_instance`, `replica`
|
||||
`windows_mssql_databases_active_transactions` | Number of active transactions for the database | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_backup_restore_operations` | Read/write throughput for backup and restore operations of a database per second | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_bulk_copy_rows` | Number of rows bulk copied per second | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_bulk_copy_bytes` | Amount of data bulk copied (in kilobytes) per second | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_commit_table_entries` | he size (row count) of the in-memory portion of the commit table for the database | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_data_files_size_bytes` | Cumulative size (in kilobytes) of all the data files in the database including any automatic growth. Monitoring this counter is useful, for example, for determining the correct size of tempdb | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_dbcc_logical_scan_bytes` | Number of logical read scan bytes per second for database console commands (DBCC) | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_group_commit_stall_seconds` | Group stall time (microseconds) per second | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_flushed_bytes` | Total number of log bytes flushed | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_cache_hit_ratio` | Percentage of log cache reads satisfied from the log cache | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_cache_reads` | Reads performed per second through the log manager cache | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_files_size_bytes` | Cumulative size (in kilobytes) of all the transaction log files in the database | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_files_used_size_bytes` | The cumulative used size of all the log files in the database | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_flushes` | Total wait time (in milliseconds) to flush the log. On an Always On secondary database, this value indicates the wait time for log records to be hardened to disk | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_flush_waits` | Number of commits per second waiting for the log flush | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_flush_wait_seconds` | Number of commits per second waiting for the log flush | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_flush_write_seconds` | Time in milliseconds for performing writes of log flushes that were completed in the last second | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_growths` | Total number of times the transaction log for the database has been expanded | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_cache_misses` | Number of requests for which the log block was not available in the log pool | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_disk_reads` | Number of disk reads that the log pool issued to fetch log blocks | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_hash_deletes` | Rate of raw hash entry deletes from the Log Pool | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_hash_inserts` | Rate of raw hash entry inserts into the Log Pool | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_invalid_hash_entries` | Rate of hash lookups failing due to being invalid | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_log_scan_pushes` | Rate of Log block pushes by log scans, which may come from disk or memory | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_log_writer_pushes` | Rate of Log block pushes by log writer thread | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_empty_free_pool_pushes` | Rate of Log block push fails due to empty free pool | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_low_memory_pushes` | Rate of Log block push fails due to being low on memory | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_no_free_buffer_pushes` | Rate of Log block push fails due to free buffer unavailable | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_req_behind_trunc` | Log pool cache misses due to block requested being behind truncation LSN | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_requests_old_vlf` | Log Pool requests that were not in the last VLF of the log | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_requests` | The number of log-block requests processed by the log pool | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_total_active_log_bytes` | Current total active log stored in the shared cache buffer manager in bytes | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_pool_total_shared_pool_bytes` | Current total memory usage of the shared cache buffer manager in bytes | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_shrinks` | Total number of log shrinks for this database | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_truncations` | The number of times the transaction log has been truncated (in Simple Recovery Model) | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_log_used_percent` | Percentage of space in the log that is in use | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_pending_repl_transactions` | Number of transactions in the transaction log of the publication database marked for replication, but not yet delivered to the distribution database | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_repl_transactions` | Number of transactions per second read out of the transaction log of the publication database and delivered to the distribution database | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_shrink_data_movement_bytes` | Amount of data being moved per second by autoshrink operations, or DBCC SHRINKDATABASE or DBCC SHRINKFILE statements | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_tracked_transactions` | Number of committed transactions recorded in the commit table for the database | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_transactions` | Number of transactions started for the database per second | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_write_transactions` | Number of transactions that wrote to the database and committed, in the last second | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_xtp_controller_dlc_fetch_latency_seconds` | Average latency in microseconds between log blocks entering the Direct Log Consumer and being retrieved by the XTP controller, per second | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_xtp_controller_dlc_peak_latency_seconds` | The largest recorded latency, in microseconds, of a fetch from the Direct Log Consumer by the XTP controller | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_xtp_controller_log_processed_bytes` | The amount of log bytes processed by the XTP controller thread, per second | counter | `mssql_instance`, `database`
|
||||
`windows_mssql_databases_xtp_memory_used_bytes` | The amount of memory used by XTP in the database | gauge | `mssql_instance`, `database`
|
||||
`windows_mssql_genstats_active_temp_tables` | Number of temporary tables/table variables in use | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_connection_resets` | Total number of logins started from the connection pool | counter | `mssql_instance`
|
||||
`windows_mssql_genstats_event_notifications_delayed_drop` | Number of event notifications waiting to be dropped by a system thread | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_http_authenticated_requests` | Number of authenticated HTTP requests started per second | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_logical_connections` | Number of logical connections to the system | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_logins` | Total number of logins started per second. This does not include pooled connections | counter | `mssql_instance`
|
||||
`windows_mssql_genstats_logouts` | Total number of logout operations started per second | counter | `mssql_instance`
|
||||
`windows_mssql_genstats_mars_deadlocks` | Number of MARS deadlocks detected | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_non_atomic_yields` | Number of non-atomic yields per second | counter | `mssql_instance`
|
||||
`windows_mssql_genstats_blocked_processes` | Number of currently blocked processes | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_soap_empty_requests` | Number of empty SOAP requests started per second | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_soap_method_invocations` | Number of SOAP method invocations started per second | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_soap_session_initiate_requests` | Number of SOAP Session initiate requests started per second | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_soap_session_terminate_requests` | Number of SOAP Session terminate requests started per second | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_soapsql_requests` | Number of SOAP SQL requests started per second | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_soapwsdl_requests` | Number of SOAP Web Service Description Language requests started per second | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_sql_trace_io_provider_lock_waits` | Number of waits for the File IO Provider lock per second | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_tempdb_recovery_unit_ids_generated` | Number of duplicate tempdb recovery unit id generated | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_tempdb_rowset_ids_generated` | Number of duplicate tempdb rowset id generated | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_temp_tables_creations` | Number of temporary tables/table variables created per second | counter | `mssql_instance`
|
||||
`windows_mssql_genstats_temp_tables_awaiting_destruction` | Number of temporary tables/table variables waiting to be destroyed by the cleanup system thread | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_trace_event_notification_queue_size` | Number of trace event notification instances waiting in the internal queue to be sent through Service Broker | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_transactions` | Number of transaction enlistments (local, DTC, bound all combined) | gauge | `mssql_instance`
|
||||
`windows_mssql_genstats_user_connections` | Counts the number of users currently connected to SQL Server | gauge | `mssql_instance`
|
||||
`windows_mssql_locks_average_wait_seconds` | Average amount of wait time (in milliseconds) for each lock request that resulted in a wait | gauge | `mssql_instance`, `resource`
|
||||
`windows_mssql_locks_lock_requests` | Number of new locks and lock conversions per second requested from the lock manager | counter | `mssql_instance`, `resource`
|
||||
`windows_mssql_locks_lock_timeouts` | Number of lock requests per second that timed out, including requests for NOWAIT locks | counter | `mssql_instance`, `resource`
|
||||
`windows_mssql_locks_lock_timeouts_excluding_NOWAIT` | Number of lock requests per second that timed out, but excluding requests for NOWAIT locks | counter | `mssql_instance`, `resource`
|
||||
`windows_mssql_locks_lock_waits` | Total wait time (in milliseconds) for locks in the last second | counter | `mssql_instance`, `resource`
|
||||
`windows_mssql_locks_lock_wait_seconds` | Number of lock requests per second that required the caller to wait | gauge | `mssql_instance`, `resource`
|
||||
`windows_mssql_locks_deadlocks` | Number of lock requests per second that resulted in a deadlock | counter | `mssql_instance`, `resource`
|
||||
`windows_mssql_memmgr_connection_memory_bytes` | Specifies the total amount of dynamic memory the server is using for maintaining connections | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_database_cache_memory_bytes` | Specifies the amount of memory the server is currently using for the database pages cache | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_external_benefit_of_memory` | An internal estimation of the performance benefit from adding memory to a specific cache | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_free_memory_bytes` | Specifies the amount of committed memory currently not used by the server | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_granted_workspace_memory_bytes` | Specifies the total amount of memory currently granted to executing processes, such as hash, sort, bulk copy, and index creation operations | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_lock_blocks` | Specifies the current number of lock blocks in use on the server (refreshed periodically). A lock block represents an individual locked resource, such as a table, page, or row | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_allocated_lock_blocks` | Specifies the current number of allocated lock blocks. At server startup, the number of allocated lock blocks plus the number of allocated lock owner blocks depends on the SQL Server Locks configuration option. If more lock blocks are needed, the value increases | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_lock_memory_bytes` | Specifies the total amount of dynamic memory the server is using for locks | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_lock_owner_blocks` | Specifies the current number of allocated lock owner blocks. At server startup, the number of allocated lock owner blocks and the number of allocated lock blocks depend on the SQL Server Locks configuration option. If more lock owner blocks are needed, the value increases dynamically | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_allocated_lock_owner_blocks` | _Not yet documented_ | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_log_pool_memory_bytes` | Total amount of dynamic memory the server is using for Log Pool | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_maximum_workspace_memory_bytes` | Indicates the maximum amount of memory available for executing processes, such as hash, sort, bulk copy, and index creation operations | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_outstanding_memory_grants` | Specifies the total number of processes that have successfully acquired a workspace memory grant | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_pending_memory_grants` | Specifies the total number of processes waiting for a workspace memory grant | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_optimizer_memory_bytes` | Specifies the total amount of dynamic memory the server is using for query optimization | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_reserved_server_memory_bytes` | ndicates the amount of memory the server has reserved for future usage. This counter shows the current unused amount of memory initially granted that is shown in Granted Workspace Memory | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_sql_cache_memory_bytes` | Specifies the total amount of dynamic memory the server is using for the dynamic SQL cache | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_stolen_server_memory_bytes` | Specifies the amount of memory the server is using for purposes other than database pages | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_target_server_memory_bytes` | Indicates the ideal amount of memory the server can consume | gauge | `mssql_instance`
|
||||
`windows_mssql_memmgr_total_server_memory_bytes` | Specifies the amount of memory the server has committed using the memory manager | gauge | `mssql_instance`
|
||||
`windows_mssql_sqlstats_auto_parameterization_attempts` | Number of failed auto-parameterization attempts per second. This should be small. Note that auto-parameterizations are also known as simple parameterizations in later versions of SQL Server | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_batch_requests` | _Not yet documented_ | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_failed_auto_parameterization_attempts` | _Not yet documented_ | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_forced_parameterizations` | Number of successful forced parameterizations per second | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_guided_plan_executions` | Number of plan executions per second in which the query plan has been generated by using a plan guide | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_misguided_plan_executions` | Number of plan executions per second in which a plan guide could not be honored during plan generation | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_safe_auto_parameterization_attempts` | Number of safe auto-parameterization attempts per second | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_sql_attentions` | Number of attentions per second | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_sql_compilations` | Number of SQL compilations per second | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_sql_recompilations` | Number of statement recompiles per second | counter | `mssql_instance`
|
||||
`windows_mssql_sqlstats_unsafe_auto_parameterization_attempts` | Number of unsafe auto-parameterization attempts per second. | counter | `mssql_instance`
|
||||
`windows_mssql_sql_errors_total` | Information for all errors | counter | `mssql_instance`, `resource`
|
||||
`windows_mssql_transactions_tempdb_free_space_bytes` | The amount of space (in kilobytes) available in tempdb | gauge | `mssql_instance`
|
||||
`windows_mssql_transactions_longest_transaction_running_seconds` | The length of time (in seconds) since the start of the transaction that has been active longer than any other current transaction | gauge | `mssql_instance`
|
||||
`windows_mssql_transactions_nonsnapshot_version_active_total` | The number of currently active transactions that are not using snapshot isolation level and have made data modifications that have generated row versions in the tempdb version store | counter | `mssql_instance`
|
||||
`windows_mssql_transactions_snapshot_active_total` | The number of currently active transactions using the snapshot isolation level | counter | `mssql_instance`
|
||||
`windows_mssql_transactions_active` | The number of currently active transactions of all types | gauge | `mssql_instance`
|
||||
`windows_mssql_transactions_update_conflicts_total` | The percentage of those transactions using the snapshot isolation level that have encountered update conflicts within the last second | counter | `mssql_instance`
|
||||
`windows_mssql_transactions_update_snapshot_active_total` | The number of currently active transactions using the snapshot isolation level and have modified data | counter | `mssql_instance`
|
||||
`windows_mssql_transactions_version_cleanup_rate_bytes` | The rate (in kilobytes per second) at which row versions are removed from the snapshot isolation version store in tempdb | gauge | `mssql_instance`
|
||||
`windows_mssql_transactions_version_generation_rate_bytes` | The rate (in kilobytes per second) at which new row versions are added to the snapshot isolation version store in tempdb | gauge | `mssql_instance`
|
||||
`windows_mssql_transactions_version_store_size_bytes` | he amount of space (in kilobytes) in tempdb being used to store snapshot isolation level row versions | gauge | `mssql_instance`
|
||||
`windows_mssql_transactions_version_store_units` | The number of active allocation units in the snapshot isolation version store in tempdb | counter | `mssql_instance`
|
||||
`windows_mssql_transactions_version_store_creation_units` | The number of allocation units that have been created in the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance`
|
||||
`windows_mssql_transactions_version_store_truncation_units` | The number of allocation units that have been removed from the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance`
|
||||
`windows_mssql_waitstats_lock_waits` | Statistics for processes waiting on a lock | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_memory_grant_queue_waits` | Statistics for processes waiting for memory grant to become available | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_thread_safe_memory_objects_waits` | Statistics for processes waiting on thread-safe memory allocators | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_log_write_waits` | Statistics for processes waiting for log buffer to be written | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_log_buffer_waits` | Statistics for processes waiting for log buffer to be available | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_network_io_waits` | Statistics relevant to wait on network I/O | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_page_io_latch_waits` | Statistics relevant to page I/O latches | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_page_latch_waits` | Statistics relevant to page latches, not including I/O latches | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_nonpage_latch_waits` | Statistics relevant to non-page latches | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_wait_for_the_worker_waits` | Statistics relevant to processes waiting for worker to become available | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_workspace_synchronization_waits` | Statistics relevant to processes synchronizing access to workspace | gauge | `mssql_instance`, `item`
|
||||
`windows_mssql_waitstats_transaction_ownership_waits` | Statistics relevant to processes synchronizing access to transaction | gauge | `mssql_instance`, `item`
|
||||
| Name | Description | Type | Labels |
|
||||
|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-------------------------------|
|
||||
| `windows_mssql_collector_duration_seconds` | The time taken for each sub-collector to return | gauge | `collector`, `mssql_instance` |
|
||||
| `windows_mssql_collector_success` | 1 if sub-collector succeeded, 0 otherwise | gauge | `collector`, `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_au_batch_cleanups` | The total number of batches that were completed successfully by the background task that cleans up deferred dropped allocation units | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_au_cleanups` | The total number of allocation units that were successfully dropped the background task that cleans up deferred dropped allocation units. Each allocation unit drop requires multiple batches | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_by_reference_lob_creates` | The total count of large object (lob) values that were passed by reference. By-reference lobs are used in certain bulk operations to avoid the cost of passing them by value | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_by_reference_lob_uses` | The total count of by-reference lob values that were used. By-reference lobs are used in certain bulk operations to avoid the cost of passing them by-value | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_lob_read_aheads` | The total count of lob pages on which readahead was issued | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_column_value_pulls` | The total count of column values that were pulled in-row from off-row | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_column_value_pushes` | The total count of column values that were pushed from in-row to off-row | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_deferred_dropped_aus` | The total number of allocation units waiting to be dropped by the background task that cleans up deferred dropped allocation units | gauge | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_deferred_dropped_rowsets` | The number of rowsets created as a result of aborted online index build operations that are waiting to be dropped by the background task that cleans up deferred dropped rowsets | gauge | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_dropped_rowset_cleanups` | The number of rowsets per second created as a result of aborted online index build operations that were successfully dropped by the background task that cleans up deferred dropped rowsets | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_dropped_rowset_skips` | The number of rowsets per second created as a result of aborted online index build operations that were skipped by the background task that cleans up deferred dropped rowsets created | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_extent_deallocations` | Number of extents deallocated per second in all databases in this instance of SQL Server | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_extent_allocations` | Number of extents allocated per second in all databases in this instance of SQL Server | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_au_batch_cleanup_failures` | The number of batches per second that failed and required retry, by the background task that cleans up deferred dropped allocation units. Failure could be due to lack of memory or disk space, hardware failure and other reasons | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_leaf_page_cookie_failures` | The number of times that a leaf page cookie could not be used during an index search since changes happened on the leaf page. The cookie is used to speed up index search | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_tree_page_cookie_failures` | The number of times that a tree page cookie could not be used during an index search since changes happened on the parent pages of those tree pages. The cookie is used to speed up index search | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_forwarded_records` | Number of records per second fetched through forwarded record pointers | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_free_space_page_fetches` | Number of pages fetched per second by free space scans. These scans search for free space within pages already allocated to an allocation unit, to satisfy requests to insert or modify record fragments | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_free_space_scans` | Number of scans per second that were initiated to search for free space within pages already allocated to an allocation unit to insert or modify record fragment. Each scan may find multiple pages | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_full_scans` | Number of unrestricted full scans per second. These can be either base-table or full-index scans | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_index_searches` | Number of index searches per second. These are used to start a range scan, reposition a range scan, revalidate a scan point, fetch a single index record, and search down the index to locate where to insert a new row | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_insysxact_waits` | Number of times a reader needs to wait for a page because the InSysXact bit is set | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_lob_handle_creates` | Count of temporary lobs created | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_lob_handle_destroys` | Count of temporary lobs destroyed | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_lob_ss_provider_creates` | Count of LOB Storage Service Providers (LobSSP) created. One worktable created per LobSSP | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_lob_ss_provider_destroys` | Count of LobSSP destroyed | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_lob_ss_provider_truncations` | Count of LobSSP truncated | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_mixed_page_allocations` | Number of pages allocated per second from mixed extents. These could be used for storing the IAM pages and the first eight pages that are allocated to an allocation unit | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_page_compression_attempts` | Number of pages evaluated for page-level compression. Includes pages that were not compressed because significant savings could be achieved. Includes all objects in the instance of SQL Server | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_page_deallocations` | Number of pages deallocated per second in all databases in this instance of SQL Server. These include pages from mixed extents and uniform extents | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_page_allocations` | Number of pages allocated per second in all databases in this instance of SQL Server. These include pages allocations from both mixed extents and uniform extents | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_page_compressions` | Number of data pages that are compressed by using PAGE compression. Includes all objects in the instance of SQL Server | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_page_splits` | Number of page splits per second that occur as the result of overflowing index pages | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_probe_scans` | Number of probe scans per second that are used to find at most one single qualified row in an index or base table directly | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_range_scans` | Number of qualified range scans through indexes per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_scan_point_revalidations` | Number of times per second that the scan point had to be revalidated to continue the scan | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_ghost_record_skips` | Number of ghosted records per second skipped during scans | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_table_lock_escalations` | Number of times locks on a table were escalated to the TABLE or HoBT granularity | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_leaf_page_cookie_uses` | Number of times a leaf page cookie is used successfully during an index search since no change happened on the leaf page. The cookie is used to speed up index search | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_tree_page_cookie_uses` | Number of times a tree page cookie is used successfully during an index search since no change happened on the parent page of the tree page. The cookie is used to speed up index search | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_workfile_creates` | Number of work files created per second. For example, work files could be used to store temporary results for hash joins and hash aggregates | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_worktables_creates` | Number of work tables created per second. For example, work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors | counter | `mssql_instance` |
|
||||
| `windows_mssql_accessmethods_worktables_from_cache_ratio` | Percentage of work tables created where the initial two pages of the work table were not allocated but were immediately available from the work table cache | counter | `mssql_instance` |
|
||||
| `windows_mssql_availreplica_received_from_replica_bytes` | Number of bytes received from the availability replica per second. Pings and status updates will generate network traffic even on databases with no user updates | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_availreplica_sent_to_replica_bytes` | Number of bytes sent to the remote availability replica per second. On the primary replica this is the number of bytes sent to the secondary replica. On the secondary replica this is the number of bytes sent to the primary replica | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_availreplica_sent_to_transport_bytes` | Actual number of bytes sent per second over the network to the remote availability replica. On the primary replica this is the number of bytes sent to the secondary replica. On the secondary replica this is the number of bytes sent to the primary replica | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_availreplica_initiated_flow_controls` | Time in milliseconds that log stream messages waited for send flow control, in the last second | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_availreplica_flow_control_wait_seconds` | Number of times flow-control initiated in the last second. Flow Control Time (ms/sec) divided by Flow Control/sec is the average time per wait | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_availreplica_receives_from_replica` | Number of Always On messages received from thereplica per second | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_availreplica_resent_messages` | Number of Always On messages resent in the last second | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_availreplica_sends_to_replica` | Number of Always On messages sent to this availability replica per second | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_availreplica_sends_to_transport` | Actual number of Always On messages sent per second over the network to the remote availability replica | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_bufman_background_writer_pages` | Number of pages flushed to enforce the recovery interval settings | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_buffer_cache_hit_ratio` | Indicates the percentage of pages found in the buffer cache without having to read from disk. The ratio is the total number of cache hits divided by the total number of cache lookups over the last few thousand page accesses | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_checkpoint_pages` | Indicates the number of pages flushed to disk per second by a checkpoint or other operation that require all dirty pages to be flushed | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_database_pages` | Indicates the number of pages in the buffer pool with database content | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_extension_allocated_pages` | Total number of non-free cache pages in the buffer pool extension file | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_extension_free_pages` | Total number of free cache pages in the buffer pool extension file | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_extension_in_use_as_percentage` | _Not yet documented_ | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_extension_outstanding_io` | Percentage of the buffer pool extension paging file occupied by buffer manager pages | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_extension_page_evictions` | Number of pages evicted from the buffer pool extension file per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_extension_page_reads` | Number of pages read from the buffer pool extension file per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_extension_page_unreferenced_seconds` | Average seconds a page will stay in the buffer pool extension without references to it | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_extension_page_writes` | Number of pages written to the buffer pool extension file per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_free_list_stalls` | Indicates the number of requests per second that had to wait for a free page | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_integral_controller_slope` | The slope that integral controller for the buffer pool last used, times -10 billion | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_lazywrites` | Indicates the number of buffers written per second by the buffer manager's lazy writer | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_page_life_expectancy_seconds` | Indicates the number of seconds a page will stay in the buffer pool without references | gauge | `mssql_instance` |
|
||||
| `windows_mssql_bufman_page_lookups` | Indicates the number of requests per second to find a page in the buffer pool | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_page_reads` | Indicates the number of physical database page reads that are issued per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_page_writes` | Indicates the number of physical database page writes that are issued per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_read_ahead_pages` | Indicates the number of pages read per second in anticipation of use | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_read_ahead_issuing_seconds` | Time (microseconds) spent issuing readahead | counter | `mssql_instance` |
|
||||
| `windows_mssql_bufman_target_pages` | Ideal number of pages in the buffer pool | gauge | `mssql_instance` |
|
||||
| `windows_mssql_dbreplica_database_flow_control_wait_seconds` | _Not yet documented_ | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_database_initiated_flow_controls` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_received_file_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_group_commits` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_group_commit_stall_seconds` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_apply_pending_queue` | _Not yet documented_ | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_apply_ready_queue` | _Not yet documented_ | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_compressed_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_decompressed_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_received_bytes` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_compression_cachehits` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_compression_cachemisses` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_compressions` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_decompressions` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_remaining_for_undo` | The amount of log, in bytes, remaining to complete the undo phase | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_log_send_queue` | Amount of log records in the log files of the primary database, in kilobytes, that haven't been sent to the secondary replica | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_mirrored_write_transactions` | Number of transactions that were written to the primary database and then waited to commit until the log was sent to the secondary database, in the last second | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_recovery_queue_records` | Amount of log records in the log files of the secondary replica that have not been redone | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_redo_blocks` | Number of times the redo thread was blocked on locks held by readers of the database | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_redo_remaining_bytes` | The amount of log, in kilobytes, remaining to be redone to finish the reverting phase | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_redone_bytes` | Amount of log records redone on the secondary database in the last second | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_redones` | _Not yet documented_ | counter | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_total_log_requiring_undo` | Total kilobytes of log that must be undone | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_dbreplica_transaction_delay_seconds` | Delay in waiting for unterminated commit acknowledgment for all the current transactions | gauge | `mssql_instance`, `replica` |
|
||||
| `windows_mssql_databases_active_transactions` | Number of active transactions for the database | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_backup_restore_operations` | Read/write throughput for backup and restore operations of a database per second | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_bulk_copy_rows` | Number of rows bulk copied per second | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_bulk_copy_bytes` | Amount of data bulk copied (in kilobytes) per second | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_commit_table_entries` | he size (row count) of the in-memory portion of the commit table for the database | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_data_files_size_bytes` | Cumulative size (in kilobytes) of all the data files in the database including any automatic growth. Monitoring this counter is useful, for example, for determining the correct size of tempdb | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_dbcc_logical_scan_bytes` | Number of logical read scan bytes per second for database console commands (DBCC) | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_group_commit_stall_seconds` | Group stall time (microseconds) per second | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_flushed_bytes` | Total number of log bytes flushed | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_cache_hit_ratio` | Percentage of log cache reads satisfied from the log cache | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_cache_reads` | Reads performed per second through the log manager cache | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_files_size_bytes` | Cumulative size (in kilobytes) of all the transaction log files in the database | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_files_used_size_bytes` | The cumulative used size of all the log files in the database | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_flushes` | Total wait time (in milliseconds) to flush the log. On an Always On secondary database, this value indicates the wait time for log records to be hardened to disk | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_flush_waits` | Number of commits per second waiting for the log flush | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_flush_wait_seconds` | Number of commits per second waiting for the log flush | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_flush_write_seconds` | Time in milliseconds for performing writes of log flushes that were completed in the last second | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_growths` | Total number of times the transaction log for the database has been expanded | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_cache_misses` | Number of requests for which the log block was not available in the log pool | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_disk_reads` | Number of disk reads that the log pool issued to fetch log blocks | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_hash_deletes` | Rate of raw hash entry deletes from the Log Pool | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_hash_inserts` | Rate of raw hash entry inserts into the Log Pool | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_invalid_hash_entries` | Rate of hash lookups failing due to being invalid | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_log_scan_pushes` | Rate of Log block pushes by log scans, which may come from disk or memory | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_log_writer_pushes` | Rate of Log block pushes by log writer thread | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_empty_free_pool_pushes` | Rate of Log block push fails due to empty free pool | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_low_memory_pushes` | Rate of Log block push fails due to being low on memory | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_no_free_buffer_pushes` | Rate of Log block push fails due to free buffer unavailable | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_req_behind_trunc` | Log pool cache misses due to block requested being behind truncation LSN | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_requests_old_vlf` | Log Pool requests that were not in the last VLF of the log | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_requests` | The number of log-block requests processed by the log pool | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_total_active_log_bytes` | Current total active log stored in the shared cache buffer manager in bytes | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_pool_total_shared_pool_bytes` | Current total memory usage of the shared cache buffer manager in bytes | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_shrinks` | Total number of log shrinks for this database | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_truncations` | The number of times the transaction log has been truncated (in Simple Recovery Model) | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_log_used_percent` | Percentage of space in the log that is in use | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_pending_repl_transactions` | Number of transactions in the transaction log of the publication database marked for replication, but not yet delivered to the distribution database | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_repl_transactions` | Number of transactions per second read out of the transaction log of the publication database and delivered to the distribution database | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_shrink_data_movement_bytes` | Amount of data being moved per second by autoshrink operations, or DBCC SHRINKDATABASE or DBCC SHRINKFILE statements | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_tracked_transactions` | Number of committed transactions recorded in the commit table for the database | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_transactions` | Number of transactions started for the database per second | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_write_transactions` | Number of transactions that wrote to the database and committed, in the last second | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_xtp_controller_dlc_fetch_latency_seconds` | Average latency in microseconds between log blocks entering the Direct Log Consumer and being retrieved by the XTP controller, per second | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_xtp_controller_dlc_peak_latency_seconds` | The largest recorded latency, in microseconds, of a fetch from the Direct Log Consumer by the XTP controller | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_xtp_controller_log_processed_bytes` | The amount of log bytes processed by the XTP controller thread, per second | counter | `mssql_instance`, `database` |
|
||||
| `windows_mssql_databases_xtp_memory_used_bytes` | The amount of memory used by XTP in the database | gauge | `mssql_instance`, `database` |
|
||||
| `windows_mssql_genstats_active_temp_tables` | Number of temporary tables/table variables in use | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_connection_resets` | Total number of logins started from the connection pool | counter | `mssql_instance` |
|
||||
| `windows_mssql_genstats_event_notifications_delayed_drop` | Number of event notifications waiting to be dropped by a system thread | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_http_authenticated_requests` | Number of authenticated HTTP requests started per second | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_logical_connections` | Number of logical connections to the system | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_logins` | Total number of logins started per second. This does not include pooled connections | counter | `mssql_instance` |
|
||||
| `windows_mssql_genstats_logouts` | Total number of logout operations started per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_genstats_mars_deadlocks` | Number of MARS deadlocks detected | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_non_atomic_yields` | Number of non-atomic yields per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_genstats_blocked_processes` | Number of currently blocked processes | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_soap_empty_requests` | Number of empty SOAP requests started per second | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_soap_method_invocations` | Number of SOAP method invocations started per second | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_soap_session_initiate_requests` | Number of SOAP Session initiate requests started per second | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_soap_session_terminate_requests` | Number of SOAP Session terminate requests started per second | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_soapsql_requests` | Number of SOAP SQL requests started per second | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_soapwsdl_requests` | Number of SOAP Web Service Description Language requests started per second | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_sql_trace_io_provider_lock_waits` | Number of waits for the File IO Provider lock per second | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_tempdb_recovery_unit_ids_generated` | Number of duplicate tempdb recovery unit id generated | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_tempdb_rowset_ids_generated` | Number of duplicate tempdb rowset id generated | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_temp_tables_creations` | Number of temporary tables/table variables created per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_genstats_temp_tables_awaiting_destruction` | Number of temporary tables/table variables waiting to be destroyed by the cleanup system thread | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_trace_event_notification_queue_size` | Number of trace event notification instances waiting in the internal queue to be sent through Service Broker | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_transactions` | Number of transaction enlistments (local, DTC, bound all combined) | gauge | `mssql_instance` |
|
||||
| `windows_mssql_genstats_user_connections` | Counts the number of users currently connected to SQL Server | gauge | `mssql_instance` |
|
||||
| `windows_mssql_instance_info ` | Returns information about the MSSQL server running on port 1433 | gauge | `version` |
|
||||
| `windows_mssql_locks_average_wait_seconds` | Average amount of wait time (in milliseconds) for each lock request that resulted in a wait | gauge | `mssql_instance`, `resource` |
|
||||
| `windows_mssql_locks_lock_requests` | Number of new locks and lock conversions per second requested from the lock manager | counter | `mssql_instance`, `resource` |
|
||||
| `windows_mssql_locks_lock_timeouts` | Number of lock requests per second that timed out, including requests for NOWAIT locks | counter | `mssql_instance`, `resource` |
|
||||
| `windows_mssql_locks_lock_timeouts_excluding_NOWAIT` | Number of lock requests per second that timed out, but excluding requests for NOWAIT locks | counter | `mssql_instance`, `resource` |
|
||||
| `windows_mssql_locks_lock_waits` | Total wait time (in milliseconds) for locks in the last second | counter | `mssql_instance`, `resource` |
|
||||
| `windows_mssql_locks_lock_wait_seconds` | Number of lock requests per second that required the caller to wait | gauge | `mssql_instance`, `resource` |
|
||||
| `windows_mssql_locks_deadlocks` | Number of lock requests per second that resulted in a deadlock | counter | `mssql_instance`, `resource` |
|
||||
| `windows_mssql_memmgr_connection_memory_bytes` | Specifies the total amount of dynamic memory the server is using for maintaining connections | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_database_cache_memory_bytes` | Specifies the amount of memory the server is currently using for the database pages cache | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_external_benefit_of_memory` | An internal estimation of the performance benefit from adding memory to a specific cache | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_free_memory_bytes` | Specifies the amount of committed memory currently not used by the server | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_granted_workspace_memory_bytes` | Specifies the total amount of memory currently granted to executing processes, such as hash, sort, bulk copy, and index creation operations | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_lock_blocks` | Specifies the current number of lock blocks in use on the server (refreshed periodically). A lock block represents an individual locked resource, such as a table, page, or row | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_allocated_lock_blocks` | Specifies the current number of allocated lock blocks. At server startup, the number of allocated lock blocks plus the number of allocated lock owner blocks depends on the SQL Server Locks configuration option. If more lock blocks are needed, the value increases | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_lock_memory_bytes` | Specifies the total amount of dynamic memory the server is using for locks | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_lock_owner_blocks` | Specifies the current number of allocated lock owner blocks. At server startup, the number of allocated lock owner blocks and the number of allocated lock blocks depend on the SQL Server Locks configuration option. If more lock owner blocks are needed, the value increases dynamically | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_allocated_lock_owner_blocks` | _Not yet documented_ | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_log_pool_memory_bytes` | Total amount of dynamic memory the server is using for Log Pool | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_maximum_workspace_memory_bytes` | Indicates the maximum amount of memory available for executing processes, such as hash, sort, bulk copy, and index creation operations | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_outstanding_memory_grants` | Specifies the total number of processes that have successfully acquired a workspace memory grant | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_pending_memory_grants` | Specifies the total number of processes waiting for a workspace memory grant | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_optimizer_memory_bytes` | Specifies the total amount of dynamic memory the server is using for query optimization | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_reserved_server_memory_bytes` | ndicates the amount of memory the server has reserved for future usage. This counter shows the current unused amount of memory initially granted that is shown in Granted Workspace Memory | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_sql_cache_memory_bytes` | Specifies the total amount of dynamic memory the server is using for the dynamic SQL cache | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_stolen_server_memory_bytes` | Specifies the amount of memory the server is using for purposes other than database pages | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_target_server_memory_bytes` | Indicates the ideal amount of memory the server can consume | gauge | `mssql_instance` |
|
||||
| `windows_mssql_memmgr_total_server_memory_bytes` | Specifies the amount of memory the server has committed using the memory manager | gauge | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_auto_parameterization_attempts` | Number of failed auto-parameterization attempts per second. This should be small. Note that auto-parameterizations are also known as simple parameterizations in later versions of SQL Server | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_batch_requests` | _Not yet documented_ | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_failed_auto_parameterization_attempts` | _Not yet documented_ | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_forced_parameterizations` | Number of successful forced parameterizations per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_guided_plan_executions` | Number of plan executions per second in which the query plan has been generated by using a plan guide | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_misguided_plan_executions` | Number of plan executions per second in which a plan guide could not be honored during plan generation | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_safe_auto_parameterization_attempts` | Number of safe auto-parameterization attempts per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_sql_attentions` | Number of attentions per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_sql_compilations` | Number of SQL compilations per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_sql_recompilations` | Number of statement recompiles per second | counter | `mssql_instance` |
|
||||
| `windows_mssql_sqlstats_unsafe_auto_parameterization_attempts` | Number of unsafe auto-parameterization attempts per second. | counter | `mssql_instance` |
|
||||
| `windows_mssql_sql_errors_total` | Information for all errors | counter | `mssql_instance`, `resource` |
|
||||
| `windows_mssql_transactions_tempdb_free_space_bytes` | The amount of space (in kilobytes) available in tempdb | gauge | `mssql_instance` |
|
||||
| `windows_mssql_transactions_longest_transaction_running_seconds` | The length of time (in seconds) since the start of the transaction that has been active longer than any other current transaction | gauge | `mssql_instance` |
|
||||
| `windows_mssql_transactions_nonsnapshot_version_active_total` | The number of currently active transactions that are not using snapshot isolation level and have made data modifications that have generated row versions in the tempdb version store | counter | `mssql_instance` |
|
||||
| `windows_mssql_transactions_snapshot_active_total` | The number of currently active transactions using the snapshot isolation level | counter | `mssql_instance` |
|
||||
| `windows_mssql_transactions_active` | The number of currently active transactions of all types | gauge | `mssql_instance` |
|
||||
| `windows_mssql_transactions_update_conflicts_total` | The percentage of those transactions using the snapshot isolation level that have encountered update conflicts within the last second | counter | `mssql_instance` |
|
||||
| `windows_mssql_transactions_update_snapshot_active_total` | The number of currently active transactions using the snapshot isolation level and have modified data | counter | `mssql_instance` |
|
||||
| `windows_mssql_transactions_version_cleanup_rate_bytes` | The rate (in kilobytes per second) at which row versions are removed from the snapshot isolation version store in tempdb | gauge | `mssql_instance` |
|
||||
| `windows_mssql_transactions_version_generation_rate_bytes` | The rate (in kilobytes per second) at which new row versions are added to the snapshot isolation version store in tempdb | gauge | `mssql_instance` |
|
||||
| `windows_mssql_transactions_version_store_size_bytes` | he amount of space (in kilobytes) in tempdb being used to store snapshot isolation level row versions | gauge | `mssql_instance` |
|
||||
| `windows_mssql_transactions_version_store_units` | The number of active allocation units in the snapshot isolation version store in tempdb | counter | `mssql_instance` |
|
||||
| `windows_mssql_transactions_version_store_creation_units` | The number of allocation units that have been created in the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance` |
|
||||
| `windows_mssql_transactions_version_store_truncation_units` | The number of allocation units that have been removed from the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance` |
|
||||
| `windows_mssql_waitstats_lock_waits` | Statistics for processes waiting on a lock | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_memory_grant_queue_waits` | Statistics for processes waiting for memory grant to become available | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_thread_safe_memory_objects_waits` | Statistics for processes waiting on thread-safe memory allocators | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_log_write_waits` | Statistics for processes waiting for log buffer to be written | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_log_buffer_waits` | Statistics for processes waiting for log buffer to be available | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_network_io_waits` | Statistics relevant to wait on network I/O | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_page_io_latch_waits` | Statistics relevant to page I/O latches | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_page_latch_waits` | Statistics relevant to page latches, not including I/O latches | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_nonpage_latch_waits` | Statistics relevant to non-page latches | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_wait_for_the_worker_waits` | Statistics relevant to processes waiting for worker to become available | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_workspace_synchronization_waits` | Statistics relevant to processes synchronizing access to workspace | gauge | `mssql_instance`, `item` |
|
||||
| `windows_mssql_waitstats_transaction_ownership_waits` | Statistics relevant to processes synchronizing access to transaction | gauge | `mssql_instance`, `item` |
|
||||
|
||||
### Example metric
|
||||
|
||||
@@ -311,4 +309,4 @@ groups:
|
||||
summary: "SQl EXpress Database size exceeded 10GB"
|
||||
description: "The database size has grown larger than 10GB. Instance: {{ $labels.instance }}"
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
@@ -19,23 +19,31 @@ If given, an interface name needs to match the include regexp in order for the c
|
||||
|
||||
If given, an interface name needs to *not* match the exclude regexp in order for the corresponding metrics to be reported
|
||||
|
||||
### `--collector.net.enabled`
|
||||
|
||||
Comma-separated list of collectors to use. Defaults to all, if not specified. Supported values are: `metrics`, `nic_addresses`.
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_net_bytes_received_total` | Total bytes received by interface | counter | `nic`
|
||||
`windows_net_bytes_sent_total` | Total bytes transmitted by interface | counter | `nic`
|
||||
`windows_net_bytes_total` | Total bytes received and transmitted by interface | counter | `nic`
|
||||
`windows_net_output_queue_length_packets` | Length of the output packet queue (in packets). If this is longer than 2, delays occur. | gauge | `nic`
|
||||
`windows_net_packets_outbound_discarded_total` | Total outbound packets that were chosen to be discarded even though no errors had been detected to prevent transmission | counter | `nic`
|
||||
`windows_net_packets_outbound_errors_total` | Total packets that could not be transmitted due to errors | counter | `nic`
|
||||
`windows_net_packets_received_discarded_total` | Total inbound packets that were chosen to be discarded even though no errors had been detected to prevent delivery | counter | `nic`
|
||||
`windows_net_packets_received_errors_total` | Total packets that could not be received due to errors | counter | `nic`
|
||||
`windows_net_packets_received_total` | Total packets received by interface | counter | `nic`
|
||||
`windows_net_packets_received_unknown_total` | Total packets received by interface that were discarded because of an unknown or unsupported protocol | counter | `nic`
|
||||
`windows_net_packets_total` | Total packets received and transmitted by interface | counter | `nic`
|
||||
`windows_net_packets_sent_total` | Total packets transmitted by interface | counter | `nic`
|
||||
`windows_net_current_bandwidth_bytes` | Estimate of the interface's current bandwidth in bytes per second | gauge | `nic`
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|---------|--------------------------------|
|
||||
| `windows_net_bytes_received_total` | Total bytes received by interface | counter | `nic` |
|
||||
| `windows_net_bytes_sent_total` | Total bytes transmitted by interface | counter | `nic` |
|
||||
| `windows_net_bytes_total` | Total bytes received and transmitted by interface | counter | `nic` |
|
||||
| `windows_net_output_queue_length_packets` | Length of the output packet queue (in packets). If this is longer than 2, delays occur. | gauge | `nic` |
|
||||
| `windows_net_packets_outbound_discarded_total` | Total outbound packets that were chosen to be discarded even though no errors had been detected to prevent transmission | counter | `nic` |
|
||||
| `windows_net_packets_outbound_errors_total` | Total packets that could not be transmitted due to errors | counter | `nic` |
|
||||
| `windows_net_packets_received_discarded_total` | Total inbound packets that were chosen to be discarded even though no errors had been detected to prevent delivery | counter | `nic` |
|
||||
| `windows_net_packets_received_errors_total` | Total packets that could not be received due to errors | counter | `nic` |
|
||||
| `windows_net_packets_received_total` | Total packets received by interface | counter | `nic` |
|
||||
| `windows_net_packets_received_unknown_total` | Total packets received by interface that were discarded because of an unknown or unsupported protocol | counter | `nic` |
|
||||
| `windows_net_packets_total` | Total packets received and transmitted by interface | counter | `nic` |
|
||||
| `windows_net_packets_sent_total` | Total packets transmitted by interface | counter | `nic` |
|
||||
| `windows_net_current_bandwidth_bytes` | Estimate of the interface's current bandwidth in bytes per second | gauge | `nic` |
|
||||
| `windows_net_nic_address_info` | A metric with a constant '1' value labeled with the network interface's address information. | gauge | `nic`, `address`, `family` |
|
||||
| `windows_net_nic_info` | A metric with a constant '1' value labeled with the network interface's general information. | gauge | `nic`, `friendly_name`, `mac` |
|
||||
| `windows_net_nic_operation_status` | The operational status for the interface as defined in RFC 2863 as IfOperStatus. | gauge | `nic`, `status` |
|
||||
| `windows_net_route_info` | A metric with a constant '1' value labeled with the network interface's route information. | gauge | `nic`, `src`, `dest`, `metric` |
|
||||
|
||||
### Example metric
|
||||
Query the rate of transmitted network traffic
|
||||
|
||||
@@ -10,7 +10,9 @@ The netframework collector exposes metrics about dotnet framework.
|
||||
|
||||
## Flags
|
||||
|
||||
None
|
||||
### `--collector.netframework.enabled`
|
||||
|
||||
Comma-separated list of collectors to use. Defaults to all, if not specified.
|
||||
|
||||
## Metrics
|
||||
|
||||
@@ -70,18 +72,18 @@ None
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------|
|
||||
| `windows_netframework_clrmemory_allocated_bytes_total` | Displays the total number of bytes allocated on the garbage collection heap. | counter | `process` |
|
||||
| `windows_netframework_clrmemory_finalization_survivors` | Displays the number of garbage-collected objects that survive a collection because they are waiting to be finalized. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_heap_size_bytes` | Displays the maximum bytes that can be allocated; it does not indicate the current number of bytes allocated. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_promoted_bytes` | Displays the bytes that were promoted from the generation to the next one during the last GC. Memory is promoted when it survives a garbage collection. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_number_gc_handles` | Displays the current number of garbage collection handles in use. Garbage collection handles are handles to resources external to the common language runtime and the managed environment. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_collections_total` | Displays the number of times the generation objects are garbage collected since the application started. | counter | `process` |
|
||||
| `windows_netframework_clrmemory_induced_gc_total` | Displays the peak number of times garbage collection was performed because of an explicit call to GC.Collect. | counter | `process` |
|
||||
| `windows_netframework_clrmemory_number_pinned_objects` | Displays the number of pinned objects encountered in the last garbage collection. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_number_sink_blocksinuse` | Displays the current number of synchronization blocks in use. Synchronization blocks are per-object data structures allocated for storing synchronization information. They hold weak references to managed objects and must be scanned by the garbage collector. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_committed_bytes` | Displays the amount of virtual memory, in bytes, currently committed by the garbage collector. Committed memory is the physical memory for which space has been reserved in the disk paging file. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_reserved_bytes` | Displays the amount of virtual memory, in bytes, currently reserved by the garbage collector. Reserved memory is the virtual memory space reserved for the application when no disk or main memory pages have been used. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_gc_time_percent` | Displays the percentage of time that was spent performing a garbage collection in the last sample. | gauge | `process` |
|
||||
| `windows_netframework_clrmemory_allocated_bytes_total` | Displays the total number of bytes allocated on the garbage collection heap. | counter | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_finalization_survivors` | Displays the number of garbage-collected objects that survive a collection because they are waiting to be finalized. | gauge | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_heap_size_bytes` | Displays the maximum bytes that can be allocated; it does not indicate the current number of bytes allocated. | gauge | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_promoted_bytes` | Displays the bytes that were promoted from the generation to the next one during the last GC. Memory is promoted when it survives a garbage collection. | gauge | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_number_gc_handles` | Displays the current number of garbage collection handles in use. Garbage collection handles are handles to resources external to the common language runtime and the managed environment. | gauge | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_collections_total` | Displays the number of times the generation objects are garbage collected since the application started. | counter | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_induced_gc_total` | Displays the peak number of times garbage collection was performed because of an explicit call to GC.Collect. | counter | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_number_pinned_objects` | Displays the number of pinned objects encountered in the last garbage collection. | gauge | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_number_sink_blocksinuse` | Displays the current number of synchronization blocks in use. Synchronization blocks are per-object data structures allocated for storing synchronization information. They hold weak references to managed objects and must be scanned by the garbage collector. | gauge | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_committed_bytes` | Displays the amount of virtual memory, in bytes, currently committed by the garbage collector. Committed memory is the physical memory for which space has been reserved in the disk paging file. | gauge | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_reserved_bytes` | Displays the amount of virtual memory, in bytes, currently reserved by the garbage collector. Reserved memory is the virtual memory space reserved for the application when no disk or main memory pages have been used. | gauge | `process`, `process_id` |
|
||||
| `windows_netframework_clrmemory_gc_time_percent` | Displays the percentage of time that was spent performing a garbage collection in the last sample. | gauge | `process`, `process_id` |
|
||||
|
||||
### CLR Remoting
|
||||
|
||||
|
||||
@@ -14,10 +14,11 @@ None
|
||||
|
||||
## Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------|
|
||||
| `windows_os_hostname` | Labelled system hostname information as provided by ComputerSystem.DNSHostName and ComputerSystem.Domain | gauge | `domain`, `fqdn`, `hostname` |
|
||||
| `windows_os_info` | Contains full product name & version in labels. Note that the `major_version` for Windows 11 is "10"; a build number greater than 22000 represents Windows 11. | gauge | `product`, `version`, `major_version`, `minor_version`, `build_number` |
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|-----------------------------------------------------------------------------------------------------------------|
|
||||
| `windows_os_hostname` | Labelled system hostname information as provided by ComputerSystem.DNSHostName and ComputerSystem.Domain | gauge | `domain`, `fqdn`, `hostname` |
|
||||
| `windows_os_info` | Contains full product name & version in labels. Note that the `major_version` for Windows 11 is "10"; a build number greater than 22000 represents Windows 11. | gauge | `product`, `version`, `major_version`, `minor_version`, `build_number`, `revision`, `installation_type` |
|
||||
| `windows_os_install_time_timestamp_seconds` | Unix timestamp of OS installation time | gauge | None |
|
||||
|
||||
### Example metric
|
||||
|
||||
@@ -27,7 +28,10 @@ None
|
||||
windows_os_hostname{domain="",fqdn="PC",hostname="PC"} 1
|
||||
# HELP windows_os_info Contains full product name & version in labels. Note that the "major_version" for Windows 11 is \\"10\\"; a build number greater than 22000 represents Windows 11.
|
||||
# TYPE windows_os_info gauge
|
||||
windows_os_info{build_number="19045",major_version="10",minor_version="0",product="Windows 10 Pro",revision="4842",version="10.0.19045"} 1
|
||||
windows_os_info{build_number="19045",installation_type="Client",major_version="10",minor_version="0",product="Windows 10 Pro",revision="4842",version="10.0.19045"} 1
|
||||
# HELP windows_os_install_time_timestamp_seconds Unix timestamp of OS installation time
|
||||
# TYPE windows_os_install_time_timestamp_seconds gauge
|
||||
windows_os_install_time_timestamp_seconds 1.6725312e+09
|
||||
```
|
||||
|
||||
## Useful queries
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
# Perfdata collector
|
||||
|
||||
The perfdata collector exposes any configured metric.
|
||||
|
||||
| | |
|
||||
|---------------------|-------------------------|
|
||||
| Metric name prefix | `perfdata` |
|
||||
| Data source | Performance Data Helper |
|
||||
| Enabled by default? | No |
|
||||
|
||||
## Flags
|
||||
|
||||
|
||||
### `--collector.perfdata.objects`
|
||||
|
||||
Objects is a list of objects to collect metrics from. The value takes the form of a JSON array of strings. YAML is also supported.
|
||||
|
||||
The collector supports only english named counter. Localized counter-names are not supported.
|
||||
|
||||
#### Schema
|
||||
|
||||
YAML:
|
||||
```yaml
|
||||
- object: "Processor Information"
|
||||
instances: ["*"]
|
||||
instance_label: "core"
|
||||
counters:
|
||||
"% Processor Time": {}
|
||||
- object: "Memory"
|
||||
counters:
|
||||
"Cache Faults/sec":
|
||||
type: "counter"
|
||||
```
|
||||
|
||||
JSON:
|
||||
|
||||
```json
|
||||
[
|
||||
{"object":"Processor Information","instance_label": "core","instances":["*"],"counters": {"% Processor Time": {}}},
|
||||
{"object":"Memory","counters": {"Cache Faults/sec": {"type": "counter"}}}
|
||||
]
|
||||
```
|
||||
|
||||
#### name
|
||||
|
||||
ObjectName is the Object to query for, like Processor, DirectoryServices, LogicalDisk or similar.
|
||||
|
||||
The collector supports only english named counter. Localized counter-names are not supported.
|
||||
|
||||
#### instances
|
||||
|
||||
The instances key (this is an array) declares the instances of a counter you would like returned, it can be one or more values.
|
||||
|
||||
Example: Instances = `["C:","D:","E:"]`
|
||||
|
||||
This will return only for the instances C:, D: and E: where relevant. To get all instances of a Counter, use `["*"]` only.
|
||||
|
||||
Some Objects like `Memory` do not have instances to select from at all. In this case, the `instances` key can be omitted.
|
||||
|
||||
#### counters
|
||||
|
||||
The Counters key (this is an object) declares the counters of the ObjectName you would like returned, it can also be one or more values.
|
||||
|
||||
Example: Counters = `{"% Idle Time": {}, "% Disk Read Time": {}, "% Disk Write Time": {}}`
|
||||
|
||||
This must be specified for every counter you want the results. Wildcards are not supported.
|
||||
|
||||
#### counters Sub-Schema
|
||||
|
||||
##### type
|
||||
|
||||
This key is optional. It indicates the type of the counter. The value can be `counter` or `gauge`.
|
||||
If not specified, the windows_exporter will try to determine the type based on the counter type.
|
||||
|
||||
### Example
|
||||
|
||||
```
|
||||
# HELP windows_perfdata_memory_cache_faults_sec
|
||||
# TYPE windows_perfdata_memory_cache_faults_sec counter
|
||||
windows_perfdata_memory_cache_faults_sec 2.369977e+07
|
||||
# HELP windows_perfdata_processor_information__processor_time
|
||||
# TYPE windows_perfdata_processor_information__processor_time gauge
|
||||
windows_perfdata_processor_information__processor_time{instance="0,0"} 1.7259640625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,1"} 1.7576796875e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,10"} 2.2704234375e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,11"} 2.3069296875e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,12"} 2.3302265625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,13"} 2.32851875e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,14"} 2.3282421875e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,15"} 2.3271234375e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,16"} 2.329590625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,17"} 2.32800625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,18"} 2.3194359375e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,19"} 2.32380625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,2"} 1.954765625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,20"} 2.3259765625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,21"} 2.3268515625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,22"} 2.3301765625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,23"} 2.3264328125e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,3"} 1.94745625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,4"} 2.2011453125e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,5"} 2.27244375e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,6"} 2.25501875e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,7"} 2.2995265625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,8"} 2.2929890625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,9"} 2.313540625e+11
|
||||
windows_perfdata_processor_information__processor_time{instance="0,_Total"} 2.23009459635e+11
|
||||
```
|
||||
|
||||
## Metrics
|
||||
|
||||
The perfdata collector returns metrics based on the user configuration.
|
||||
The metrics are named based on the object name and the counter name.
|
||||
The instance name is added as a label to the metric.
|
||||
286
docs/collector.performancecounter.md
Normal file
286
docs/collector.performancecounter.md
Normal file
@@ -0,0 +1,286 @@
|
||||
# performancecounter collector
|
||||
|
||||
The performancecounter collector exposes any configured metric.
|
||||
|
||||
| | |
|
||||
|---------------------|-------------------------|
|
||||
| Metric name prefix | `performancecounter` |
|
||||
| Data source | Performance Data Helper |
|
||||
| Enabled by default? | No |
|
||||
|
||||
## Flags
|
||||
|
||||
|
||||
### `--collector.performancecounter.objects`
|
||||
|
||||
Objects is a list of objects to collect metrics from. The value takes the form of a JSON array of strings.
|
||||
YAML is supported.
|
||||
|
||||
The collector supports only English-named counter. Localized counter-names aren’t supported.
|
||||
|
||||
> [!CAUTION]
|
||||
> If you are using a configuration file, the value must be kept as a string.
|
||||
>
|
||||
> Use a `|-` to keep the value as a string.
|
||||
|
||||
#### Example
|
||||
|
||||
```yaml
|
||||
collector:
|
||||
performancecounter:
|
||||
objects: |-
|
||||
- name: memory
|
||||
object: "Memory"
|
||||
counters:
|
||||
- name: "Cache Faults/sec"
|
||||
type: "counter" # optional
|
||||
```
|
||||
|
||||
#### Schema
|
||||
|
||||
YAML:
|
||||
|
||||
<details>
|
||||
<summary>Click to expand YAML schema</summary>
|
||||
|
||||
```yaml
|
||||
- name: cpu # free text name
|
||||
object: "Processor Information" # Performance counter object name
|
||||
instances: ["*"]
|
||||
instance_label: "core"
|
||||
counters:
|
||||
- name: "% Processor Time"
|
||||
metric: windows_performancecounter_processor_information_processor_time # optional
|
||||
labels:
|
||||
state: active
|
||||
- name: "% Idle Time"
|
||||
metric: windows_performancecounter_processor_information_processor_time # optional
|
||||
labels:
|
||||
state: idle
|
||||
- name: memory
|
||||
object: "Memory"
|
||||
type: "formatted"
|
||||
counters:
|
||||
- name: "Cache Faults/sec"
|
||||
type: "counter" # optional
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Click to expand JSON schema</summary>
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "cpu",
|
||||
"object": "Processor Information",
|
||||
"instances": [
|
||||
"*"
|
||||
],
|
||||
"instance_label": "core",
|
||||
"counters": [
|
||||
{
|
||||
"name": "% Processor Time",
|
||||
"metric": "windows_performancecounter_processor_information_processor_time",
|
||||
"labels": {
|
||||
"state": "active"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "% Idle Time",
|
||||
"metric": "windows_performancecounter_processor_information_processor_time",
|
||||
"labels": {
|
||||
"state": "idle"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "memory",
|
||||
"object": "Memory",
|
||||
"type": "formatted",
|
||||
"counters": [
|
||||
{
|
||||
"name": "Cache Faults/sec",
|
||||
"type": "counter"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
</details>
|
||||
|
||||
#### name
|
||||
|
||||
The name is used to identify the object in the logs and metrics.
|
||||
Must unique across all objects.
|
||||
|
||||
#### object
|
||||
|
||||
ObjectName is the Object to query for, like Processor, DirectoryServices, LogicalDisk or similar.
|
||||
|
||||
The collector supports only english named counter. Localized counter-names are not supported.
|
||||
|
||||
#### type
|
||||
|
||||
The counter-type. The value can be `raw` or `formatted`. Optional and defaults to `raw`.
|
||||
|
||||
- `raw` returns the raw value of the counter. This is the default.
|
||||
- `formatted` returns the formatted value of the counter. This is useful for counters like `Processor Information` where the value is a percentage.
|
||||
|
||||
The difference between a raw Windows Performance Counter and a formatted Windows Performance Counter is about how the data is presented and processed:
|
||||
|
||||
1. Raw Windows Performance Counter:
|
||||
|
||||
This provides the counter's data in its basic, unprocessed form.
|
||||
The values may represent cumulative counts, time intervals, or other uncalibrated metrics.
|
||||
Interpreting these values often requires more calculations or context, such as calculating deltas or normalizing values over time.
|
||||
|
||||
2. Formatted Windows Performance Counter:
|
||||
|
||||
This presents data that has already been processed and interpreted according to the counter type (e.g., rates per second, averages, percentages).
|
||||
Formatted counters are easier to understand directly since the necessary calculations have been applied.
|
||||
These are often what monitoring tools display to users because they are meaningful at a glance.
|
||||
|
||||
For example:
|
||||
|
||||
* A raw counter for CPU time might give the total number of clock ticks used since the system started.
|
||||
* A formatted counter would convert this into a percentage of CPU utilization over a specific time interval.
|
||||
|
||||
|
||||
#### instances
|
||||
|
||||
The instances key (this is an array) declares the instances of a counter you would like returned, it can be one or more values.
|
||||
|
||||
Example: Instances = `["C:","D:","E:"]`
|
||||
|
||||
This will return only for the instances C:, D: and E: where relevant. To get all instances of a Counter, use `["*"]` only.
|
||||
|
||||
Some Objects like `Memory` do not have instances to select from at all. In this case, the `instances` key can be omitted.
|
||||
|
||||
#### counters
|
||||
|
||||
List of counters to collect from the object. See the counters sub-schema for more information.
|
||||
|
||||
#### counters Sub-Schema
|
||||
|
||||
##### name
|
||||
|
||||
The name of the counter to collect.
|
||||
|
||||
##### metric
|
||||
|
||||
It indicates the name of the metric to be exposed. If not specified, the metric name will be generated based on the object name and the counter name.
|
||||
|
||||
This key is optional.
|
||||
|
||||
##### type
|
||||
|
||||
It indicates the type of the counter. The value can be `counter` or `gauge`.
|
||||
If not specified, the windows_exporter will try to determine the type based on the counter type.
|
||||
|
||||
This key is optional.
|
||||
|
||||
##### labels
|
||||
|
||||
Labels is a map of key-value pairs that will be added as labels to the metric.
|
||||
|
||||
### Example
|
||||
|
||||
```
|
||||
# HELP windows_performancecounter_memory_cache_faults_sec
|
||||
# TYPE windows_performancecounter_memory_cache_faults_sec counter
|
||||
windows_performancecounter_memory_cache_faults_sec 7.028097e+06
|
||||
# HELP windows_performancecounter_processor_information_processor_time
|
||||
# TYPE windows_performancecounter_processor_information_processor_time counter
|
||||
windows_performancecounter_processor_information_processor_time{core="0,0",state="active"} 8.3809375e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,0",state="idle"} 8380.9375
|
||||
windows_performancecounter_processor_information_processor_time{core="0,1",state="active"} 8.2868125e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,1",state="idle"} 8286.8125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,10",state="active"} 9.720046875e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,10",state="idle"} 9720.046875
|
||||
windows_performancecounter_processor_information_processor_time{core="0,11",state="active"} 9.994921875e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,11",state="idle"} 9994.921875
|
||||
windows_performancecounter_processor_information_processor_time{core="0,12",state="active"} 1.014403125e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,12",state="idle"} 10144.03125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,13",state="active"} 1.0155453125e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,13",state="idle"} 10155.453125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,14",state="active"} 1.01290625e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,14",state="idle"} 10129.0625
|
||||
windows_performancecounter_processor_information_processor_time{core="0,15",state="active"} 1.0134890625e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,15",state="idle"} 10134.890625
|
||||
windows_performancecounter_processor_information_processor_time{core="0,16",state="active"} 1.01405625e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,16",state="idle"} 10140.5625
|
||||
windows_performancecounter_processor_information_processor_time{core="0,17",state="active"} 1.0153421875e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,17",state="idle"} 10153.421875
|
||||
windows_performancecounter_processor_information_processor_time{core="0,18",state="active"} 1.0086390625e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,18",state="idle"} 10086.390625
|
||||
windows_performancecounter_processor_information_processor_time{core="0,19",state="active"} 1.0123453125e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,19",state="idle"} 10123.453125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,2",state="active"} 8.3548125e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,2",state="idle"} 8354.8125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,20",state="active"} 1.011703125e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,20",state="idle"} 10117.03125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,21",state="active"} 1.0140984375e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,21",state="idle"} 10140.984375
|
||||
windows_performancecounter_processor_information_processor_time{core="0,22",state="active"} 1.014615625e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,22",state="idle"} 10146.15625
|
||||
windows_performancecounter_processor_information_processor_time{core="0,23",state="active"} 1.0145125e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,23",state="idle"} 10145.125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,3",state="active"} 8.488953125e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,3",state="idle"} 8488.953125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,4",state="active"} 9.338234375e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,4",state="idle"} 9338.234375
|
||||
windows_performancecounter_processor_information_processor_time{core="0,5",state="active"} 9.776453125e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,5",state="idle"} 9776.453125
|
||||
windows_performancecounter_processor_information_processor_time{core="0,6",state="active"} 9.736265625e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,6",state="idle"} 9736.265625
|
||||
windows_performancecounter_processor_information_processor_time{core="0,7",state="active"} 9.959375e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,7",state="idle"} 9959.375
|
||||
windows_performancecounter_processor_information_processor_time{core="0,8",state="active"} 9.939421875e+10
|
||||
windows_performancecounter_processor_information_processor_time{core="0,8",state="idle"} 9939.421875
|
||||
windows_performancecounter_processor_information_processor_time{core="0,9",state="active"} 1.0059484375e+11
|
||||
windows_performancecounter_processor_information_processor_time{core="0,9",state="idle"} 10059.484375
|
||||
```
|
||||
> [!NOTE]
|
||||
> If you are using a configuration file, the value must be keep as string.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
collector:
|
||||
performancecounter:
|
||||
objects: |
|
||||
```
|
||||
|
||||
|
||||
## Metrics
|
||||
|
||||
The perfdata collector returns metrics based on the user configuration.
|
||||
The metrics are named based on the object name and the counter name.
|
||||
The instance name is added as a label to the metric.
|
||||
|
||||
# Examples
|
||||
|
||||
## thermalzone collector
|
||||
|
||||
```yaml
|
||||
collector:
|
||||
performancecounter:
|
||||
objects: |-
|
||||
- name: thermalzone
|
||||
object: "Thermal Zone Information"
|
||||
instances: ["*"]
|
||||
type: formatted
|
||||
counters:
|
||||
- name: "Temperature"
|
||||
type: "gauge"
|
||||
metric: windows_thermalzone_percent_passive_limit
|
||||
- name: "% Passive Limit"
|
||||
type: "gauge"
|
||||
metric: windows_thermalzone_temperature_celsius
|
||||
- name: "Throttle Reasons"
|
||||
type: "gauge"
|
||||
metric: windows_thermalzone_throttle_reasons
|
||||
```
|
||||
@@ -21,19 +21,21 @@ If given, a disk needs to *not* match the exclude regexp in order for the corres
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`requests_queued` | Number of requests outstanding on the disk at the time the performance data is collected | gauge | `disk`
|
||||
`read_bytes_total` | Rate at which bytes are transferred from the disk during read operations | counter | `disk`
|
||||
`reads_total` | Rate of read operations on the disk | counter | `disk`
|
||||
`write_bytes_total` | Rate at which bytes are transferred to the disk during write operations | counter | `disk`
|
||||
`writes_total` | Rate of write operations on the disk | counter | `disk`
|
||||
`read_seconds_total` | Seconds the disk was busy servicing read requests | counter | `disk`
|
||||
`write_seconds_total` | Seconds the disk was busy servicing write requests | counter | `disk`
|
||||
`free_bytes` | Unused space of the disk in bytes (not real time, updates every 10-15 min) | gauge | `disk`
|
||||
`size_bytes` | Total size of the disk in bytes (not real time, updates every 10-15 min) | gauge | `disk`
|
||||
`idle_seconds_total` | Seconds the disk was idle (not servicing read/write requests) | counter | `disk`
|
||||
`split_ios_total` | Number of I/Os to the disk split into multiple I/Os | counter | `disk`
|
||||
| Name | Description | Type | Labels |
|
||||
|--------------------------------------------------------|---------------------------------------------------------------------------------------------------------|---------|--------|
|
||||
| windows_physical_disk_requests_queued | The number of requests queued to the disk (PhysicalDisk.CurrentDiskQueueLength) | Gauge | disk |
|
||||
| windows_physical_disk_read_bytes_total | The number of bytes transferred from the disk during read operations (PhysicalDisk.DiskReadBytesPerSec) | Counter | disk |
|
||||
| windows_physical_disk_reads_total | The number of read operations on the disk (PhysicalDisk.DiskReadsPerSec) | Counter | disk |
|
||||
| windows_physical_disk_write_bytes_total | The number of bytes transferred to the disk during write operations (PhysicalDisk.DiskWriteBytesPerSec) | Counter | disk |
|
||||
| windows_physical_disk_writes_total | The number of write operations on the disk (PhysicalDisk.DiskWritesPerSec) | Counter | disk |
|
||||
| windows_physical_disk_read_seconds_total | Seconds that the disk was busy servicing read requests (PhysicalDisk.PercentDiskReadTime) | Counter | disk |
|
||||
| windows_physical_disk_write_seconds_total | Seconds that the disk was busy servicing write requests (PhysicalDisk.PercentDiskWriteTime) | Counter | disk |
|
||||
| windows_physical_disk_idle_seconds_total | Seconds that the disk was idle (PhysicalDisk.PercentIdleTime) | Counter | disk |
|
||||
| windows_physical_disk_split_ios_total | The number of I/Os to the disk that were split into multiple I/Os (PhysicalDisk.SplitIOPerSec) | Counter | disk |
|
||||
| windows_physical_disk_read_latency_seconds_total | The average time, in seconds, of a read operation from the disk (PhysicalDisk.AvgDiskSecPerRead) | Counter | disk |
|
||||
| windows_physical_disk_write_latency_seconds_total | The average time, in seconds, of a write operation to the disk (PhysicalDisk.AvgDiskSecPerWrite) | Counter | disk |
|
||||
| windows_physical_disk_read_write_latency_seconds_total | The time, in seconds, of the average disk transfer (PhysicalDisk.AvgDiskSecPerTransfer) | Counter | disk |
|
||||
|
||||
|
||||
### Warning about size metrics
|
||||
The `free_bytes` and `size_bytes` metrics are not updated in real time and might have a delay of 10-15min.
|
||||
@@ -52,29 +54,4 @@ rate(windows_physical_disk_reads_total{instance="localhost", disk=~"0"}[2m]) + r
|
||||
```
|
||||
|
||||
## Alerting examples
|
||||
**prometheus.rules**
|
||||
```yaml
|
||||
groups:
|
||||
- name: Windows Disk Alerts
|
||||
rules:
|
||||
|
||||
# Sends an alert when disk space usage is above 95%
|
||||
- alert: DiskSpaceUsage
|
||||
expr: 100.0 - 100 * (windows_physical_disk_free_bytes / windows_physical_disk_size_bytes) > 95
|
||||
for: 10m
|
||||
labels:
|
||||
severity: high
|
||||
annotations:
|
||||
summary: "Disk Space Usage (instance {{ $labels.instance }})"
|
||||
description: "Disk Space on Drive is used more than 95%\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
|
||||
|
||||
# Alerts on disks with over 85% space usage predicted to fill within the next four days
|
||||
- alert: DiskFilling
|
||||
expr: 100 * (windows_physical_disk_free_bytes / windows_physical_disk_size_bytes) < 15 and predict_linear(windows_physical_disk_free_bytes[6h], 4 * 24 * 3600) < 0
|
||||
for: 10m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Disk full in four days (instance {{ $labels.instance }})"
|
||||
description: "{{ $labels.disk }} is expected to fill up within four days. Currently {{ $value | humanize }}% is available.\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
|
||||
```
|
||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||
|
||||
@@ -37,6 +37,16 @@ Enables IIS process name queries. IIS process names are combined with their app
|
||||
|
||||
Disabled by default, and can be enabled with `--collector.process.iis`. NOTE: Just plain parameter without `true`.
|
||||
|
||||
### `--collector.process.counter-version`
|
||||
|
||||
Version of the process collector to use. 1 for Process V1, 2 for Process V2.
|
||||
Defaults to 0 which will use the latest version available.
|
||||
|
||||
### `--collector.process.cmdline`
|
||||
|
||||
Enables the `cmdline` label for the process metrics.
|
||||
This label contains the command line used to start the process.
|
||||
Enabled by default, and can be turned off with `--no-collector.process.cmdline`.
|
||||
|
||||
### Example
|
||||
To match all firefox processes: `--collector.process.include="firefox.*"`.
|
||||
@@ -69,30 +79,35 @@ w3wp_Test
|
||||
|
||||
## Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|---------------------------------------------------------------------------------------|
|
||||
| `windows_process_info` | A metric with a constant '1' value labeled with process information | gauge | `process`, `process_id`, `creating_process_id`, `process_group_id`,`owner`, `cmdline` |
|
||||
| `windows_process_start_time` | Time of process start | gauge | `process`, `process_id` |
|
||||
| `windows_process_cpu_time_total` | Returns elapsed time that all of the threads of this process used the processor to execute instructions by mode (privileged, user). An instruction is the basic unit of execution in a computer, a thread is the object that executes instructions, and a process is the object created when a program is run. Code executed to handle some hardware interrupts and trap conditions is included in this count. | counter | `process`, `process_id`, `mode` |
|
||||
| `windows_process_handles` | Total number of handles the process has open. This number is the sum of the handles currently open by each thread in the process. | gauge | `process`, `process_id` |
|
||||
| `windows_process_io_bytes_total` | Bytes issued to I/O operations in different modes (read, write, other). This property counts all I/O activity generated by the process to include file, network, and device I/Os. Read and write mode includes data operations; other mode includes those that do not involve data, such as control operations. | counter | `process`, `process_id`, `mode` |
|
||||
| `windows_process_io_operations_total` | I/O operations issued in different modes (read, write, other). This property counts all I/O activity generated by the process to include file, network, and device I/Os. Read and write mode includes data operations; other mode includes those that do not involve data, such as control operations. | counter | `process`, `process_id`, `mode` |
|
||||
| `windows_process_page_faults_total` | Page faults by the threads executing in this process. A page fault occurs when a thread refers to a virtual memory page that is not in its working set in main memory. This can cause the page not to be fetched from disk if it is on the standby list and hence already in main memory, or if it is in use by another process with which the page is shared. | counter | `process`, `process_id` |
|
||||
| `windows_process_page_file_bytes` | Current number of bytes this process has used in the paging file(s). Paging files are used to store pages of memory used by the process that are not contained in other files. Paging files are shared by all processes, and lack of space in paging files can prevent other processes from allocating memory. | gauge | `process`, `process_id` |
|
||||
| `windows_process_pool_bytes` | Pool Bytes is the last observed number of bytes in the paged or nonpaged pool. The nonpaged pool is an area of system memory (physical memory used by the operating system) for objects that cannot be written to disk, but must remain in physical memory as long as they are allocated. The paged pool is an area of system memory (physical memory used by the operating system) for objects that can be written to disk when they are not being used. Nonpaged pool bytes is calculated differently than paged pool bytes, so it might not equal the total of paged pool bytes. | gauge | `process`, `process_id`, `pool` |
|
||||
| `windows_process_priority_base` | Current base priority of this process. Threads within a process can raise and lower their own base priority relative to the process base priority of the process. | gauge | `process`, `process_id` |
|
||||
| `windows_process_private_bytes` | Current number of bytes this process has allocated that cannot be shared with other processes. | gauge | `process`, `process_id` |
|
||||
| `windows_process_threads` | Number of threads currently active in this process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes instructions. Every running process has at least one thread. | gauge | `process`, `process_id` |
|
||||
| `windows_process_virtual_bytes` | Current size, in bytes, of the virtual address space that the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite and, by using too much, the process can limit its ability to load libraries. | gauge | `process`, `process_id` |
|
||||
| `windows_process_working_set_private_bytes` | Size of the working set, in bytes, that is use for this process only and not shared nor shareable by other processes. | gauge | `process`, `process_id` |
|
||||
| `windows_process_working_set_peak_bytes` | Maximum size, in bytes, of the Working Set of this process at any point in time. The Working Set is the set of memory pages touched recently by the threads in the process. If free memory in the computer is above a threshold, pages are left in the Working Set of a process even if they are not in use. When free memory falls below a threshold, pages are trimmed from Working Sets. If they are needed they will then be soft-faulted back into the Working Set before they leave main memory. | gauge | `process`, `process_id` |
|
||||
| `windows_process_working_set_bytes` | Maximum number of bytes in the working set of this process at any point in time. The working set is the set of memory pages touched recently by the threads in the process. If free memory in the computer is above a threshold, pages are left in the working set of a process even if they are not in use. When free memory falls below a threshold, pages are trimmed from working sets. If they are needed, they are then soft-faulted back into the working set before they leave main memory. | gauge | `process`, `process_id` |
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|---------------------------------------------------------------------------------------|
|
||||
| `windows_process_info` | A metric with a constant '1' value labeled with process information | gauge | `process`, `process_id`, `creating_process_id`, `process_group_id`,`owner`, `cmdline` |
|
||||
| `windows_process_start_time_seconds_timestamp` | Epoch time (seconds since 1970/1/1) of process start. | gauge | `process`, `process_id` |
|
||||
| `windows_process_cpu_time_total` | Returns elapsed time that all of the threads of this process used the processor to execute instructions by mode (privileged, user). An instruction is the basic unit of execution in a computer, a thread is the object that executes instructions, and a process is the object created when a program is run. Code executed to handle some hardware interrupts and trap conditions is included in this count. | counter | `process`, `process_id`, `mode` |
|
||||
| `windows_process_handles` | Total number of handles the process has open. This number is the sum of the handles currently open by each thread in the process. | gauge | `process`, `process_id` |
|
||||
| `windows_process_io_bytes_total` | Bytes issued to I/O operations in different modes (read, write, other). This property counts all I/O activity generated by the process to include file, network, and device I/Os. Read and write mode includes data operations; other mode includes those that do not involve data, such as control operations. | counter | `process`, `process_id`, `mode` |
|
||||
| `windows_process_io_operations_total` | I/O operations issued in different modes (read, write, other). This property counts all I/O activity generated by the process to include file, network, and device I/Os. Read and write mode includes data operations; other mode includes those that do not involve data, such as control operations. | counter | `process`, `process_id`, `mode` |
|
||||
| `windows_process_page_faults_total` | Page faults by the threads executing in this process. A page fault occurs when a thread refers to a virtual memory page that is not in its working set in main memory. This can cause the page not to be fetched from disk if it is on the standby list and hence already in main memory, or if it is in use by another process with which the page is shared. | counter | `process`, `process_id` |
|
||||
| `windows_process_page_file_bytes` | Current number of bytes this process has used in the paging file(s). Paging files are used to store pages of memory used by the process that are not contained in other files. Paging files are shared by all processes, and lack of space in paging files can prevent other processes from allocating memory. | gauge | `process`, `process_id` |
|
||||
| `windows_process_pool_bytes` | Pool Bytes is the last observed number of bytes in the paged or nonpaged pool. The nonpaged pool is an area of system memory (physical memory used by the operating system) for objects that cannot be written to disk, but must remain in physical memory as long as they are allocated. The paged pool is an area of system memory (physical memory used by the operating system) for objects that can be written to disk when they are not being used. Nonpaged pool bytes is calculated differently than paged pool bytes, so it might not equal the total of paged pool bytes. | gauge | `process`, `process_id`, `pool` |
|
||||
| `windows_process_priority_base` | Current base priority of this process. Threads within a process can raise and lower their own base priority relative to the process base priority of the process. | gauge | `process`, `process_id` |
|
||||
| `windows_process_private_bytes` | Current number of bytes this process has allocated that cannot be shared with other processes. | gauge | `process`, `process_id` |
|
||||
| `windows_process_threads` | Number of threads currently active in this process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes instructions. Every running process has at least one thread. | gauge | `process`, `process_id` |
|
||||
| `windows_process_virtual_bytes` | Current size, in bytes, of the virtual address space that the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite and, by using too much, the process can limit its ability to load libraries. | gauge | `process`, `process_id` |
|
||||
| `windows_process_working_set_private_bytes` | Size of the working set, in bytes, that is use for this process only and not shared nor shareable by other processes. | gauge | `process`, `process_id` |
|
||||
| `windows_process_working_set_peak_bytes` | Maximum size, in bytes, of the Working Set of this process at any point in time. The Working Set is the set of memory pages touched recently by the threads in the process. If free memory in the computer is above a threshold, pages are left in the Working Set of a process even if they are not in use. When free memory falls below a threshold, pages are trimmed from Working Sets. If they are needed they will then be soft-faulted back into the Working Set before they leave main memory. | gauge | `process`, `process_id` |
|
||||
| `windows_process_working_set_bytes` | Maximum number of bytes in the working set of this process at any point in time. The working set is the set of memory pages touched recently by the threads in the process. If free memory in the computer is above a threshold, pages are left in the working set of a process even if they are not in use. When free memory falls below a threshold, pages are trimmed from working sets. If they are needed, they are then soft-faulted back into the working set before they leave main memory. | gauge | `process`, `process_id` |
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
Add extended information like cmdline or owner to other process metrics.
|
||||
|
||||
```
|
||||
windows_process_working_set_bytes * on(process_id) group_left(owner, cmdline) windows_process_info
|
||||
```
|
||||
|
||||
## Alerting examples
|
||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||
|
||||
@@ -14,16 +14,16 @@ None
|
||||
|
||||
## Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
|
||||
| `windows_system_context_switches_total` | Total number of [context switches](https://en.wikipedia.org/wiki/Context_switch) | counter | None |
|
||||
| `windows_system_exception_dispatches_total` | Total exceptions dispatched by the system | counter | None |
|
||||
| `windows_system_processes` | Number of process contexts currently loaded or running on the operating system | gauge | None |
|
||||
| `windows_system_process_limit` | The size of the user-mode portion of the virtual address space of the calling process, in bytes. This value depends on the type of process, the type of processor, and the configuration of the operating system. | gauge | None |
|
||||
| `windows_system_processor_queue_length` | Number of threads in the processor queue. There is a single queue for processor time even on computers with multiple processors. | gauge | None |
|
||||
| `windows_system_system_calls_total` | Total combined calls to Windows NT system service routines by all processes running on the computer | counter | None |
|
||||
| `windows_system_system_up_time` | Time of last boot of system | gauge | None |
|
||||
| `windows_system_threads` | Number of Windows system [threads](https://en.wikipedia.org/wiki/Thread_(computing)) | gauge | None |
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
|
||||
| `windows_system_boot_time_timestamp` | Unix timestamp of last system boot | gauge | None |
|
||||
| `windows_system_context_switches_total` | Total number of [context switches](https://en.wikipedia.org/wiki/Context_switch) | counter | None |
|
||||
| `windows_system_exception_dispatches_total` | Total exceptions dispatched by the system | counter | None |
|
||||
| `windows_system_processes` | Number of process contexts currently loaded or running on the operating system | gauge | None |
|
||||
| `windows_system_process_limit` | The size of the user-mode portion of the virtual address space of the calling process, in bytes. This value depends on the type of process, the type of processor, and the configuration of the operating system. | gauge | None |
|
||||
| `windows_system_processor_queue_length` | Number of threads in the processor queue. There is a single queue for processor time even on computers with multiple processors. | gauge | None |
|
||||
| `windows_system_system_calls_total` | Total combined calls to Windows NT system service routines by all processes running on the computer | counter | None |
|
||||
| `windows_system_threads` | Number of Windows system [threads](https://en.wikipedia.org/wiki/Thread_(computing)) | gauge | None |
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ windows_system_processes{instance="localhost"}
|
||||
## Useful queries
|
||||
Find hosts that have rebooted in the last 24 hours
|
||||
```
|
||||
time() - windows_system_system_up_time < 86400
|
||||
time() - windows_system_boot_time_timestamp < 86400
|
||||
```
|
||||
|
||||
## Alerting examples
|
||||
|
||||
@@ -10,13 +10,8 @@ Enabled by default? | No
|
||||
|
||||
## Flags
|
||||
|
||||
### `--collector.textfile.directory`
|
||||
:warning: DEPRECATED Use `--collector.textfile.directories`
|
||||
|
||||
<br>
|
||||
|
||||
### `--collector.textfile.directories`
|
||||
One or multiple directories containing the files to be ingested.
|
||||
One or multiple directories containing the files to be ingested.
|
||||
|
||||
E.G. `--collector.textfile.directories="C:\MyDir1,C:\MyDir2"`
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
# thermalzone collector
|
||||
|
||||
The thermalzone collector exposes metrics about system temps. Note that temperature is given in Kelvin
|
||||
|
||||
|||
|
||||
-|-
|
||||
Metric name prefix | `thermalzone`
|
||||
Classes | [`Win32_PerfRawData_Counters_ThermalZoneInformation`](https://wutils.com/wmi/root/cimv2/win32_perfrawdata_counters_thermalzoneinformation/#temperature_properties)
|
||||
Enabled by default? | No
|
||||
|
||||
## Flags
|
||||
|
||||
None
|
||||
|
||||
## Metrics
|
||||
|
||||
Name | Description | Type | Labels
|
||||
-----|-------------|------|-------
|
||||
`windows_thermalzone_percent_passive_limit` | % Passive Limit is the current limit this thermal zone is placing on the devices it controls. A limit of 100% indicates the devices are unconstrained. A limit of 0% indicates the devices are fully constrained. | gauge | None
|
||||
`windows_thermalzone_temperature_celsius ` | Temperature of the thermal zone, in degrees Celsius. | gauge | None
|
||||
`windows_thermalzone_throttle_reasons ` | Throttle Reasons indicate reasons why the thermal zone is limiting performance of the devices it controls. 0x0 - The zone is not throttled. 0x1 - The zone is throttled for thermal reasons. 0x2 - The zone is throttled to limit electrical current. | gauge | None
|
||||
|
||||
[`Throttle reasons` source](https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/examples--requirements-and-diagnostics)
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
## Alerting examples
|
||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||
@@ -1,6 +1,6 @@
|
||||
# time collector
|
||||
|
||||
The time collector exposes the Windows Time Service metrics. Note that the Windows Time Service must be running, else metric collection will fail.
|
||||
The time collector exposes the Windows Time Service and other time related metrics.
|
||||
If the Windows Time Service is stopped after collection has started, collector metric values will reset to 0.
|
||||
|
||||
Please note the Time Service perflib counters are only available on [Windows Server 2016 or newer](https://docs.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-server-2016-improvements).
|
||||
@@ -21,19 +21,32 @@ Matching is case-sensitive.
|
||||
|
||||
## Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|-----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|------------|
|
||||
| `windows_time_clock_frequency_adjustment_ppb_total` | Total adjustment made to the local system clock frequency by W32Time in parts per billion (PPB) units. 1 PPB adjustment implies the system clock was adjusted at a rate of 1 nanosecond per second (1 ns/s). The smallest possible adjustment can vary and is expected to be in the order of 100's of PPB. | counter | None |
|
||||
| `windows_time_computed_time_offset_seconds` | The absolute time offset between the system clock and the chosen time source, as computed by the W32Time service in microseconds. When a new valid sample is available, the computed time is updated with the time offset indicated by the sample. This time is the actual time offset of the local clock. W32Time initiates clock correction by using this offset and updates the computed time in between samples with the remaining time offset that needs to be applied to the local clock. Clock accuracy can be tracked by using this performance counter with a low polling interval (for example, 256 seconds or less) and looking for the counter value to be smaller than the desired clock accuracy limit. | gauge | None |
|
||||
| `windows_time_ntp_client_time_sources` | Active number of NTP Time sources being used by the client. This is a count of active, distinct IP addresses of time servers that are responding to this client's requests. | gauge | None |
|
||||
| `windows_time_ntp_round_trip_delay_seconds` | Total roundtrip delay experienced by the NTP client in receiving a response from the server for the most recent request, in seconds. This is the time elapsed on the NTP client between transmitting a request to the NTP server and receiving a valid response from the server. | gauge | None |
|
||||
| `windows_time_ntp_server_outgoing_responses_total` | Total number of requests responded to by the NTP server. | counter | None |
|
||||
| `windows_time_ntp_server_incoming_requests_total` | Total number of requests received by the NTP server. | counter | None |
|
||||
| `windows_time_current_timestamp_seconds` | Current time as reported by the operating system, in [Unix time](https://en.wikipedia.org/wiki/Unix_time). See [time.Unix()](https://golang.org/pkg/time/#Unix) for details | gauge | None |
|
||||
| `windows_time_timezone` | Current timezone as reported by the operating system. | gauge | `timezone` |
|
||||
| Name | Description | Type | Labels |
|
||||
|----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|------------|
|
||||
| `windows_time_clock_frequency_adjustment` | Adjustment made to the local system clock frequency by W32Time in parts per billion (PPB) units. 1 PPB adjustment implies the system clock was adjusted at a rate of 1 nanosecond per second (1 ns/s). The smallest possible adjustment can vary and is expected to be in the order of 100's of PPB. | gauge | None |
|
||||
| `windows_time_clock_frequency_adjustment_ppb` | Adjustment made to the local system clock frequency by W32Time in parts per billion (PPB) units. 1 PPB adjustment implies the system clock was adjusted at a rate of 1 nanosecond per second (1 ns/s). The smallest possible adjustment can vary and is expected to be in the order of 100's of PPB. | gauge | None |
|
||||
| `windows_time_computed_time_offset_seconds` | The absolute time offset between the system clock and the chosen time source, as computed by the W32Time service in microseconds. When a new valid sample is available, the computed time is updated with the time offset indicated by the sample. This time is the actual time offset of the local clock. W32Time initiates clock correction by using this offset and updates the computed time in between samples with the remaining time offset that needs to be applied to the local clock. Clock accuracy can be tracked by using this performance counter with a low polling interval (for example, 256 seconds or less) and looking for the counter value to be smaller than the desired clock accuracy limit. | gauge | None |
|
||||
| `windows_time_ntp_client_time_sources` | Active number of NTP Time sources being used by the client. This is a count of active, distinct IP addresses of time servers that are responding to this client's requests. | gauge | None |
|
||||
| `windows_time_ntp_round_trip_delay_seconds` | Total roundtrip delay experienced by the NTP client in receiving a response from the server for the most recent request, in seconds. This is the time elapsed on the NTP client between transmitting a request to the NTP server and receiving a valid response from the server. | gauge | None |
|
||||
| `windows_time_ntp_server_outgoing_responses_total` | Total number of requests responded to by the NTP server. | counter | None |
|
||||
| `windows_time_ntp_server_incoming_requests_total` | Total number of requests received by the NTP server. | counter | None |
|
||||
| `windows_time_current_timestamp_seconds` | Current time as reported by the operating system, in [Unix time](https://en.wikipedia.org/wiki/Unix_time). See [time.UnixMicro()](https://golang.org/pkg/time/#UnixMicro) for details | gauge | None |
|
||||
| `windows_time_timezone` | Current timezone as reported by the operating system. | gauge | `timezone` |
|
||||
| `windows_time_clock_sync_source` | This value reflects the sync source of the system clock. | gauge | `type` |
|
||||
|
||||
### Example metric
|
||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
||||
```
|
||||
# HELP windows_time_clock_sync_source This value reflects the sync source of the system clock.
|
||||
# TYPE windows_time_clock_sync_source gauge
|
||||
windows_time_clock_sync_source{type="AllSync"} 0
|
||||
windows_time_clock_sync_source{type="Local CMOS Clock"} 0
|
||||
windows_time_clock_sync_source{type="NT5DS"} 0
|
||||
windows_time_clock_sync_source{type="NTP"} 1
|
||||
windows_time_clock_sync_source{type="NoSync"} 0
|
||||
# HELP windows_time_current_timestamp_seconds OperatingSystem.LocalDateTime
|
||||
# TYPE windows_time_current_timestamp_seconds gauge
|
||||
windows_time_current_timestamp_seconds 1.74862554e+09
|
||||
```
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
@@ -11,38 +11,50 @@ The Windows Update service is responsible for managing the installation of updat
|
||||
| Data source | Windows Update service |
|
||||
| Enabled by default? | No |
|
||||
|
||||
|
||||
## Flags
|
||||
|
||||
### `--collector.updates.online`
|
||||
Whether to search for updates online. If set to `false`, the collector will only list updates that are already found by the Windows Update service.
|
||||
Set to `true` to search for updates online, which will take longer to complete.
|
||||
### `--collector.update.online`
|
||||
Whether to search for updates online. If set to `false` via `--no-collector.update.online`, the collector will only list updates that are already found by the Windows Update service.
|
||||
Set to `true` via `--collector.update.online` to search for updates online, which will take longer to complete.
|
||||
|
||||
### `--collector.updates.scrape-interval`
|
||||
### `--collector.update.scrape-interval`
|
||||
Define the interval of scraping Windows Update information
|
||||
|
||||
## Metrics
|
||||
|
||||
| Name | Description | Type | Labels |
|
||||
|--------------------------------|-----------------------------------------------|-------|-------------------------------|
|
||||
| `windows_updates_pending_info` | Expose information single pending update item | gauge | `category`,`severity`,`title` |
|
||||
| `windows_updates_scrape_query_duration_seconds` | Duration of the last scrape query to the Windows Update API | gauge | |
|
||||
| `windows_updates_scrape_timestamp_seconds` | Timestamp of the last scrape | gauge | |
|
||||
| Name | Description | Type | Labels |
|
||||
|------------------------------------------------|------------------------------------------------------------------|-------|-------------------------------|
|
||||
| `windows_update_pending_info` | Expose information for a single pending update item | gauge | `category`,`severity`,`title` |
|
||||
| `windows_update_pending_published_timestamp` | Expose last published timestamp for a single pending update item | gauge | `title` |
|
||||
| `windows_update_scrape_query_duration_seconds` | Duration of the last scrape query to the Windows Update API | gauge | |
|
||||
| `windows_update_scrape_timestamp_seconds` | Timestamp of the last scrape | gauge | |
|
||||
|
||||
### Example metrics
|
||||
```
|
||||
# HELP windows_updates_pending Pending Windows Updates
|
||||
# TYPE windows_updates_pending gauge
|
||||
windows_updates_pending{category="Drivers",severity="",title="Intel Corporation - Bluetooth - 23.60.5.10"} 1
|
||||
# HELP windows_updates_scrape_query_duration_seconds Duration of the last scrape query to the Windows Update API
|
||||
# TYPE windows_updates_scrape_query_duration_seconds gauge
|
||||
windows_updates_scrape_query_duration_seconds 2.8161838
|
||||
# HELP windows_updates_scrape_timestamp_seconds Timestamp of the last scrape
|
||||
# TYPE windows_updates_scrape_timestamp_seconds gauge
|
||||
windows_updates_scrape_timestamp_seconds 1.727539734e+09
|
||||
# HELP windows_update_pending_info Expose information for a single pending update item
|
||||
# TYPE windows_update_pending_info gauge
|
||||
windows_update_pending_info{category="Definition Updates",id="a32ca1d0-ddd4-486b-b708-d941db4f1051",revision="204",severity="",title="Update for Windows Security platform - KB5007651 (Version 10.0.27840.1000)"} 1
|
||||
windows_update_pending_info{category="Definition Updates",id="b50a64de-a0bb-465b-9842-9963b6eee21e",revision="200",severity="",title="Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.429.146.0) - Current Channel (Broad)"} 1
|
||||
# HELP windows_update_pending_published_timestamp Expose last published timestamp for a single pending update item
|
||||
# TYPE windows_update_pending_published_timestamp gauge
|
||||
windows_update_pending_published_timestamp{id="a32ca1d0-ddd4-486b-b708-d941db4f1051",revision="204"} 1.747872e+09
|
||||
windows_update_pending_published_timestamp{id="b50a64de-a0bb-465b-9842-9963b6eee21e",revision="200"} 1.7479584e+09
|
||||
# HELP windows_update_scrape_query_duration_seconds Duration of the last scrape query to the Windows Update API
|
||||
# TYPE windows_update_scrape_query_duration_seconds gauge
|
||||
windows_update_scrape_query_duration_seconds 2.8161838
|
||||
# HELP windows_update_scrape_timestamp_seconds Timestamp of the last scrape
|
||||
# TYPE windows_update_scrape_timestamp_seconds gauge
|
||||
windows_update_scrape_timestamp_seconds 1.727539734e+09
|
||||
```
|
||||
|
||||
## Useful queries
|
||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||
|
||||
Add extended information like cmdline or owner to other process metrics.
|
||||
|
||||
```
|
||||
windows_update_pending_published_timestamp * on(id, revision) group_left(severity, title) windows_update_pending_info
|
||||
```
|
||||
|
||||
## Alerting examples
|
||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
# Note this is not an exhaustive list of all configuration values
|
||||
collectors:
|
||||
enabled: cpu,cs,logical_disk,net,os,service,system
|
||||
enabled: cpu,logical_disk,net,os,service,system
|
||||
collector:
|
||||
service:
|
||||
include: "windows_exporter"
|
||||
@@ -13,6 +13,5 @@ scrape:
|
||||
timeout-margin: 0.5
|
||||
telemetry:
|
||||
path: /metrics
|
||||
max-requests: 5
|
||||
web:
|
||||
listen-address: ":9182"
|
||||
|
||||
57
go.mod
57
go.mod
@@ -1,55 +1,44 @@
|
||||
module github.com/prometheus-community/windows_exporter
|
||||
|
||||
go 1.23
|
||||
go 1.25
|
||||
|
||||
require (
|
||||
github.com/Microsoft/hcsshim v0.12.9
|
||||
github.com/alecthomas/kingpin/v2 v2.4.0
|
||||
github.com/bmatcuk/doublestar/v4 v4.7.1
|
||||
github.com/bmatcuk/doublestar/v4 v4.10.0
|
||||
github.com/dimchansky/utfbom v1.1.1
|
||||
github.com/go-ole/go-ole v1.3.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/prometheus/client_golang v1.20.5
|
||||
github.com/prometheus/client_model v0.6.1
|
||||
github.com/prometheus/common v0.60.1
|
||||
github.com/prometheus/exporter-toolkit v0.13.1
|
||||
github.com/stretchr/testify v1.9.0
|
||||
golang.org/x/sys v0.27.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
github.com/prometheus/client_golang v1.23.2
|
||||
github.com/prometheus/client_model v0.6.2
|
||||
github.com/prometheus/common v0.67.5
|
||||
github.com/prometheus/exporter-toolkit v0.15.1
|
||||
github.com/stretchr/testify v1.11.1
|
||||
go.yaml.in/yaml/v3 v3.0.4
|
||||
golang.org/x/sys v0.40.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/containerd/cgroups/v3 v3.0.3 // indirect
|
||||
github.com/containerd/errdefs v0.3.0 // indirect
|
||||
github.com/containerd/errdefs/pkg v0.3.0 // indirect
|
||||
github.com/containerd/typeurl/v2 v2.2.0 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.7.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/jpillora/backoff v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/mdlayher/socket v0.5.1 // indirect
|
||||
github.com/mdlayher/vsock v1.2.1 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/prometheus/procfs v0.19.2 // indirect
|
||||
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
golang.org/x/crypto v0.28.0 // indirect
|
||||
golang.org/x/net v0.30.0 // indirect
|
||||
golang.org/x/oauth2 v0.23.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/text v0.19.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
|
||||
google.golang.org/grpc v1.67.1 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||
golang.org/x/crypto v0.47.0 // indirect
|
||||
golang.org/x/net v0.49.0 // indirect
|
||||
golang.org/x/oauth2 v0.34.0 // indirect
|
||||
golang.org/x/sync v0.19.0 // indirect
|
||||
golang.org/x/text v0.33.0 // indirect
|
||||
golang.org/x/time v0.14.0 // indirect
|
||||
google.golang.org/protobuf v1.36.11 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
208
go.sum
208
go.sum
@@ -1,77 +1,32 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
|
||||
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
||||
github.com/Microsoft/hcsshim v0.12.9 h1:2zJy5KA+l0loz1HzEGqyNnjd3fyZA31ZBCGKacp6lLg=
|
||||
github.com/Microsoft/hcsshim v0.12.9/go.mod h1:fJ0gkFAna6ukt0bLdKB8djt4XIJhF/vEPuoIWYVvZ8Y=
|
||||
github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY=
|
||||
github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE=
|
||||
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vSQ6PWWSL9lK8qwHozUj03+zLoEB8O0=
|
||||
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q=
|
||||
github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs=
|
||||
github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/containerd/cgroups/v3 v3.0.3 h1:S5ByHZ/h9PMe5IOQoN7E+nMc2UcLEM/V48DGDJ9kip0=
|
||||
github.com/containerd/cgroups/v3 v3.0.3/go.mod h1:8HBe7V3aWGLFPd/k03swSIsGjZhHI2WzJmticMgVuz0=
|
||||
github.com/containerd/errdefs v0.3.0 h1:FSZgGOeK4yuT/+DnF07/Olde/q4KBoMsaamhXxIMDp4=
|
||||
github.com/containerd/errdefs v0.3.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
|
||||
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
|
||||
github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk=
|
||||
github.com/containerd/typeurl/v2 v2.2.0 h1:6NBDbQzr7I5LHgp34xAXYF5DOTQDn05X58lsPEmzLso=
|
||||
github.com/containerd/typeurl/v2 v2.2.0/go.mod h1:8XOOxnyatxSWuG8OfsZXVnAF4iZfedjS/8UHSPJnX4g=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA=
|
||||
github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
|
||||
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
|
||||
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
@@ -86,130 +41,59 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
|
||||
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
|
||||
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
|
||||
github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc=
|
||||
github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
|
||||
github.com/prometheus/exporter-toolkit v0.13.1 h1:Evsh0gWQo2bdOHlnz9+0Nm7/OFfIwhE2Ws4A2jIlR04=
|
||||
github.com/prometheus/exporter-toolkit v0.13.1/go.mod h1:ujdv2YIOxtdFxxqtloLpbqmxd5J0Le6IITUvIRSWjj0=
|
||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
|
||||
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
|
||||
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
||||
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
||||
github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4=
|
||||
github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw=
|
||||
github.com/prometheus/exporter-toolkit v0.15.1 h1:XrGGr/qWl8Gd+pqJqTkNLww9eG8vR/CoRk0FubOKfLE=
|
||||
github.com/prometheus/exporter-toolkit v0.15.1/go.mod h1:P/NR9qFRGbCFgpklyhix9F6v6fFr/VQB/CVsrMDGKo4=
|
||||
github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws=
|
||||
github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
|
||||
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
||||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
|
||||
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
|
||||
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
|
||||
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
|
||||
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
|
||||
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
|
||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
|
||||
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
|
||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
||||
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
|
||||
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
|
||||
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
|
||||
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
||||
@@ -28,7 +28,7 @@ Copy-Item -Force $PathToExecutable Work/windows_exporter.exe
|
||||
Write-Verbose "Creating windows_exporter-${Version}-${Arch}.msi"
|
||||
$wixArch = @{"amd64" = "x64"; "arm64" = "arm64"}[$Arch]
|
||||
|
||||
Invoke-Expression "wix build -arch $wixArch -o .\windows_exporter-$($Version)-$($Arch).msi .\files.wxs .\main.wxs -d ProductName=windows_exporter -d Version=$($MsiVersion) -ext WixToolset.Firewall.wixext -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext"
|
||||
Invoke-Expression "wix build -sw1149 -arch $wixArch -o .\windows_exporter-$($Version)-$($Arch).msi .\files.wxs .\main.wxs -d ProductName=windows_exporter -d Version=$($MsiVersion) -ext WixToolset.Firewall.wixext -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext"
|
||||
|
||||
Write-Verbose "Done!"
|
||||
Pop-Location
|
||||
|
||||
BIN
installer/codesign.cer
Normal file
BIN
installer/codesign.cer
Normal file
Binary file not shown.
@@ -1,9 +1,34 @@
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
|
||||
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<Wix xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"
|
||||
xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||
<Fragment>
|
||||
<DirectoryRef Id="APPLICATIONFOLDER">
|
||||
<Component Transitive="yes">
|
||||
<File Id="windows_exporter.exe" Name="windows_exporter.exe" Source="Work\windows_exporter.exe" KeyPath="yes" Vital="yes" Checksum="yes"/>
|
||||
|
||||
<!-- The "Name" field must match the argument to eventlog.Open() -->
|
||||
<util:EventSource Log="Application" Name="windows_exporter"
|
||||
EventMessageFile="%SystemRoot%\System32\EventCreate.exe"
|
||||
SupportsErrors="yes"
|
||||
SupportsInformationals="yes"
|
||||
SupportsWarnings="yes"/>
|
||||
|
||||
<ServiceInstall
|
||||
Id="InstallExporterService"
|
||||
Name="windows_exporter"
|
||||
@@ -12,10 +37,15 @@
|
||||
ErrorControl="normal"
|
||||
Start="auto"
|
||||
Type="ownProcess"
|
||||
Interactive="no"
|
||||
Vital="yes"
|
||||
Arguments="--log.file eventlog [ConfigFileFlag] [CollectorsFlag] [ListenFlag] [MetricsPathFlag] [TextfileDirsFlag] [ExtraFlags]">
|
||||
Arguments="[ConfigFileFlag] [CollectorsFlag] [ListenFlag] [MetricsPathFlag] [TextfileDirsFlag] [ExtraFlags]">
|
||||
<ServiceConfig
|
||||
DelayedAutoStart="yes"
|
||||
OnInstall="yes"
|
||||
OnReinstall="yes" />
|
||||
<util:ServiceConfig
|
||||
ResetPeriodInDays="1"
|
||||
ResetPeriodInDays="0"
|
||||
FirstFailureActionType="restart"
|
||||
SecondFailureActionType="restart"
|
||||
ThirdFailureActionType="restart"
|
||||
@@ -23,7 +53,8 @@
|
||||
/>
|
||||
<ServiceDependency Id="wmiApSrv" />
|
||||
</ServiceInstall>
|
||||
<ServiceControl Id="ServiceStateControl" Name="windows_exporter" Remove="uninstall" Start="install" Stop="both"/>
|
||||
<ServiceControl Id="StartService" Name="windows_exporter" Start="install" Wait="no" />
|
||||
<ServiceControl Id="StopService" Name="windows_exporter" Remove="uninstall" Stop="both" Wait="yes" />
|
||||
</Component>
|
||||
<Component Id="CreateTextfileDirectory" Directory="textfile_inputs" Guid="d03ef58a-9cbf-4165-ad39-d143e9b27e14">
|
||||
<CreateFolder />
|
||||
|
||||
BIN
installer/icon.ico
Normal file
BIN
installer/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
@@ -9,9 +9,26 @@
|
||||
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
|
||||
<?endif?>
|
||||
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
|
||||
xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall"
|
||||
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<Wix xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall"
|
||||
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"
|
||||
xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||
<Package UpgradeCode="66a6eb5b-1fc2-4b14-a362-5ceec6413308" Name="$(var.ProductName)" Version="$(var.Version)"
|
||||
Manufacturer="prometheus-community" Language="1033" Scope="perMachine">
|
||||
<SummaryInformation Manufacturer="prometheus-community" Description="$(var.ProductName) $(var.Version) installer" />
|
||||
@@ -28,43 +45,6 @@
|
||||
Property="OLDERVERSIONBEINGUPGRADED" />
|
||||
</Upgrade>
|
||||
|
||||
<CustomAction Id="set_maintenance" Property="MAINTENANCE" Value="true" />
|
||||
|
||||
<!-- Set to reinstall all features. -->
|
||||
<CustomAction Id="set_reinstall_all_property"
|
||||
Property="REINSTALL"
|
||||
Value="ALL" />
|
||||
<!-- "amus" will force reinstall all files.
|
||||
See https://docs.microsoft.com/en-us/windows/desktop/Msi/reinstallmode -->
|
||||
<CustomAction Id="set_reinstallmode_property"
|
||||
Property="REINSTALLMODE"
|
||||
Value="amus" />
|
||||
<SetProperty
|
||||
Id="CreateConfigFile"
|
||||
Value=""[%ComSpec]" /c TYPE NUL >>"[ConfigFile_NonDefault][ConfigFile_Default]""
|
||||
Before="CreateConfigFile"
|
||||
Sequence="execute"
|
||||
Condition="ConfigFile_NonDefault OR ConfigFile_Default"
|
||||
/>
|
||||
<CustomAction
|
||||
Id="CreateConfigFile"
|
||||
BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
|
||||
DllEntry="WixQuietExec"
|
||||
Execute="deferred"
|
||||
Return="check"
|
||||
Impersonate="no"
|
||||
/>
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<!-- Set REINSTALL=all and REINSTALLMODE=amus if the user reruns the
|
||||
MSI, which will force reinstalling all files and services. -->
|
||||
<Custom Action="set_maintenance" Before="set_reinstall_all_property"
|
||||
Condition="Installed AND (NOT REMOVE) AND (NOT UPGRADINGPRODUCTCODE)"/>
|
||||
<Custom Action="set_reinstall_all_property" Before="set_reinstallmode_property" Condition="MAINTENANCE"/>
|
||||
<Custom Action="set_reinstallmode_property" Before="LaunchConditions" Condition="MAINTENANCE"/>
|
||||
<Custom Action="CreateConfigFile" Before="InstallServices" Condition="ConfigFile_NonDefault OR ConfigFile_Default" />
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<Media Id="1" Cabinet="windows_exporter.cab" EmbedCab="yes" />
|
||||
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." AllowSameVersionUpgrades="yes" />
|
||||
|
||||
@@ -80,25 +60,110 @@
|
||||
<SetProperty Id="ConfigFileFlag" After="InstallFiles" Sequence="execute" Value="--config.file="[ConfigFile_NonDefault][ConfigFile_Default]"" Condition="ConfigFile_NonDefault OR ConfigFile_Default" />
|
||||
|
||||
<Property Id="LISTEN_PORT" Secure="yes" Value="9182" />
|
||||
<SetProperty Id="ListenFlag" After="InstallFiles" Sequence="execute" Value="--web.listen-address [LISTEN_ADDR]:[LISTEN_PORT]" Condition="LISTEN_ADDR<>"" OR LISTEN_PORT<>9182" />
|
||||
<SetProperty Id="ListenFlag" After="InstallFiles" Sequence="execute" Value="--web.listen-address="[LISTEN_ADDR]:[LISTEN_PORT]"" Condition="LISTEN_ADDR<>"" OR LISTEN_PORT<>9182" />
|
||||
|
||||
<Property Id="METRICS_PATH" Secure="yes" />
|
||||
<SetProperty Id="MetricsPathFlag" After="InstallFiles" Sequence="execute" Value="--telemetry.path [METRICS_PATH]" Condition="METRICS_PATH" />
|
||||
<SetProperty Id="MetricsPathFlag" After="InstallFiles" Sequence="execute" Value="--telemetry.path="[METRICS_PATH]"" Condition="METRICS_PATH" />
|
||||
|
||||
<Property Id="REMOTE_ADDR" Secure="yes" />
|
||||
<SetProperty Id="RemoteAddressFlag" After="InstallFiles" Sequence="execute" Value="[REMOTE_ADDR]" Condition="REMOTE_ADDR" />
|
||||
|
||||
<Property Id="TEXTFILE_DIRS" Secure="yes" />
|
||||
<SetProperty Id="TextfileDirsFlag" After="InstallFiles" Sequence="execute" Value="--collector.textfile.directories [TEXTFILE_DIRS]" Condition="TEXTFILE_DIRS" />
|
||||
<SetProperty Id="TextfileDirsFlag" After="InstallFiles" Sequence="execute" Value="--collector.textfile.directories="[TEXTFILE_DIRS]"" Condition="TEXTFILE_DIRS" />
|
||||
|
||||
<!-- Configuration for how the installer shows in Add/Remove Programs. -->
|
||||
<Icon Id="icon.ico" SourceFile=".\icon.ico"/>
|
||||
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
|
||||
<Property Id="ARPHELPLINK" Value="https://github.com/prometheus-community/windows_exporter/issues" />
|
||||
<Property Id="ARPSIZE" Value="9000" />
|
||||
<Property Id="ARPURLINFOABOUT" Value="https://github.com/prometheus-community/windows_exporter" />
|
||||
<!--<Property Id="ARPNOMODIFY" Value="0" />-->
|
||||
<!--<Property Id="ARPNOREPAIR" Value="1" />-->
|
||||
<Property Id="ARPCOMMENTS" Value="Prometheus exporter for Windows machines" />
|
||||
<!-- Disable the repair option; the functionality is available through Change instead. -->
|
||||
<Property Id="ARPNOREPAIR" Value="1" />
|
||||
<Property Id="ARPSIZE" Value="10000" />
|
||||
|
||||
<Property Id="START_MENU_FOLDER" Value="0" />
|
||||
<Property Id="NOSTART" Value="0" />
|
||||
|
||||
<CustomAction Id="CheckExtraFlags"
|
||||
Error="The parameter '--config.file' must not be included in EXTRA_FLAGS. Use CONFIG_FILE instead. Please remove it and try again." />
|
||||
|
||||
<CustomAction Id="set_maintenance" Property="MAINTENANCE" Value="true" />
|
||||
|
||||
<!-- Set to reinstall all features. -->
|
||||
<CustomAction Id="set_reinstall_all_property"
|
||||
Property="REINSTALL"
|
||||
Value="ALL" />
|
||||
<!-- "amus" will force reinstall all files.
|
||||
See https://docs.microsoft.com/en-us/windows/desktop/Msi/reinstallmode -->
|
||||
<CustomAction Id="set_reinstallmode_property"
|
||||
Property="REINSTALLMODE"
|
||||
Value="amus" />
|
||||
<!-- START CUSTOM ACTION FOR CONFIG FILE CREATION -->
|
||||
<SetProperty
|
||||
Id="CreateConfigFile"
|
||||
Value=""[%ComSpec]" /c TYPE NUL >>"[ConfigFile_NonDefault][ConfigFile_Default]""
|
||||
Before="CreateConfigFile"
|
||||
Sequence="execute"
|
||||
/>
|
||||
<CustomAction
|
||||
Id="CreateConfigFile"
|
||||
BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
|
||||
DllEntry="WixQuietExec"
|
||||
Execute="deferred"
|
||||
Return="check"
|
||||
Impersonate="no"
|
||||
/>
|
||||
<!-- END CUSTOM ACTION FOR CONFIG FILE CREATION -->
|
||||
|
||||
<!-- START CUSTOM ACTION FOR KILLING THE PROCESS -->
|
||||
<SetProperty
|
||||
Id="KillProcess"
|
||||
Value=""[WindowsFolder]System32\taskkill.exe" /T /F /IM windows_exporter.exe"
|
||||
Before="KillProcess"
|
||||
Sequence="execute"
|
||||
/>
|
||||
<CustomAction
|
||||
Id="KillProcess"
|
||||
BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
|
||||
DllEntry="WixQuietExec"
|
||||
Execute="deferred"
|
||||
Return="ignore"
|
||||
Impersonate="no"
|
||||
/>
|
||||
<!-- END CUSTOM ACTION FOR KILLING THE PROCESS -->
|
||||
|
||||
<!-- START CUSTOM ACTION FOR SET SERVICE FAILUREFLAG -->
|
||||
<SetProperty
|
||||
Id="ConfigureServiceRecovery"
|
||||
Value=""[WindowsFolder]System32\sc.exe" failureflag "windows_exporter" 1"
|
||||
Before="ConfigureServiceRecovery"
|
||||
Sequence="execute"
|
||||
/>
|
||||
<CustomAction
|
||||
Id="ConfigureServiceRecovery"
|
||||
BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
|
||||
DllEntry="WixQuietExec"
|
||||
Execute="deferred"
|
||||
Return="ignore"
|
||||
Impersonate="no"
|
||||
/>
|
||||
<!-- END CUSTOM ACTION FFOR SET SERVICE FAILUREFLAG -->
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<!-- Set REINSTALL=all and REINSTALLMODE=amus if the user reruns the
|
||||
MSI, which will force reinstalling all files and services. -->
|
||||
<Custom Action="set_maintenance" Before="set_reinstall_all_property"
|
||||
Condition="Installed AND (NOT REMOVE) AND (NOT UPGRADINGPRODUCTCODE)"/>
|
||||
<Custom Action="set_reinstall_all_property" Before="set_reinstallmode_property" Condition="MAINTENANCE"/>
|
||||
<Custom Action="set_reinstallmode_property" Before="LaunchConditions" Condition="MAINTENANCE"/>
|
||||
<Custom Action="CreateConfigFile" Before="InstallServices" Condition="ConfigFile_Default" />
|
||||
<Custom Action="ConfigureServiceRecovery" After="InstallServices" Condition="NOT REMOVE" />
|
||||
<Custom Action="KillProcess" Before="RemoveFiles" />
|
||||
|
||||
<Custom Action="CheckExtraFlags" Before="InstallInitialize"
|
||||
Condition="EXTRA_FLAGS AND (EXTRA_FLAGS><"--config.file")" />
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<Feature
|
||||
Id="DefaultFeature"
|
||||
Level="1"
|
||||
@@ -136,7 +201,7 @@
|
||||
<Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}windows_exporter configuration" />
|
||||
|
||||
<!-- Edit box for property input -->
|
||||
<!-- cpu,cs,logical_disk,physical_disk,net,os,service,system -->
|
||||
<!-- cpu,logical_disk,physical_disk,net,os,service,system -->
|
||||
<Control Id="PropertyEdit_ENABLED_COLLECTORS_Title1" Type="Text" X="25" Y="55" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Text="Comma-separated list of collectors to use. Use '[\[]defaults[\]]' as a placeholder for all" />
|
||||
<Control Id="PropertyEdit_ENABLED_COLLECTORS_Title2" Type="Text" X="25" Y="65" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Text="the collectors enabled by default. If value is empty, the exporter default will be used." />
|
||||
<Control Id="PropertyEdit_ENABLED_COLLECTORS" Type="Edit" X="24" Y="77" Width="300" Height="18" Property="ENABLED_COLLECTORS" Text="[ENABLED_COLLECTORS]" Indirect="no" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,18 @@
|
||||
// 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 ad_test
|
||||
@@ -12,3 +27,7 @@ import (
|
||||
func BenchmarkCollector(b *testing.B) {
|
||||
testutils.FuncBenchmarkCollector(b, ad.Name, ad.NewWithFlags)
|
||||
}
|
||||
|
||||
func TestCollector(t *testing.T) {
|
||||
testutils.TestCollector(t, ad.New, nil)
|
||||
}
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
package ad
|
||||
|
||||
const (
|
||||
abANRPerSec = "AB ANR/sec"
|
||||
abBrowsesPerSec = "AB Browses/sec"
|
||||
abClientSessions = "AB Client Sessions"
|
||||
abMatchesPerSec = "AB Matches/sec"
|
||||
abPropertyReadsPerSec = "AB Property Reads/sec"
|
||||
abProxyLookupsPerSec = "AB Proxy Lookups/sec"
|
||||
abSearchesPerSec = "AB Searches/sec"
|
||||
approximateHighestDNT = "Approximate highest DNT"
|
||||
atqEstimatedQueueDelay = "ATQ Estimated Queue Delay"
|
||||
atqOutstandingQueuedRequests = "ATQ Outstanding Queued Requests"
|
||||
_ = "ATQ Queue Latency"
|
||||
atqRequestLatency = "ATQ Request Latency"
|
||||
atqThreadsLDAP = "ATQ Threads LDAP"
|
||||
atqThreadsOther = "ATQ Threads Other"
|
||||
atqThreadsTotal = "ATQ Threads Total"
|
||||
baseSearchesPerSec = "Base searches/sec"
|
||||
databaseAddsPerSec = "Database adds/sec"
|
||||
databaseDeletesPerSec = "Database deletes/sec"
|
||||
databaseModifiesPerSec = "Database modifys/sec"
|
||||
databaseRecyclesPerSec = "Database recycles/sec"
|
||||
digestBindsPerSec = "Digest Binds/sec"
|
||||
_ = "DirSync session throttling rate"
|
||||
_ = "DirSync sessions in progress"
|
||||
draHighestUSNCommittedHighPart = "DRA Highest USN Committed (High part)"
|
||||
draHighestUSNCommittedLowPart = "DRA Highest USN Committed (Low part)"
|
||||
draHighestUSNIssuedHighPart = "DRA Highest USN Issued (High part)"
|
||||
draHighestUSNIssuedLowPart = "DRA Highest USN Issued (Low part)"
|
||||
draInboundBytesCompressedBetweenSitesAfterCompressionSinceBoot = "DRA Inbound Bytes Compressed (Between Sites, After Compression) Since Boot"
|
||||
draInboundBytesCompressedBetweenSitesAfterCompressionPerSec = "DRA Inbound Bytes Compressed (Between Sites, After Compression)/sec"
|
||||
draInboundBytesCompressedBetweenSitesBeforeCompressionSinceBoot = "DRA Inbound Bytes Compressed (Between Sites, Before Compression) Since Boot"
|
||||
draInboundBytesCompressedBetweenSitesBeforeCompressionPerSec = "DRA Inbound Bytes Compressed (Between Sites, Before Compression)/sec"
|
||||
draInboundBytesNotCompressedWithinSiteSinceBoot = "DRA Inbound Bytes Not Compressed (Within Site) Since Boot"
|
||||
draInboundBytesNotCompressedWithinSitePerSec = "DRA Inbound Bytes Not Compressed (Within Site)/sec"
|
||||
draInboundBytesTotalSinceBoot = "DRA Inbound Bytes Total Since Boot"
|
||||
draInboundBytesTotalPerSec = "DRA Inbound Bytes Total/sec"
|
||||
draInboundFullSyncObjectsRemaining = "DRA Inbound Full Sync Objects Remaining"
|
||||
draInboundLinkValueUpdatesRemainingInPacket = "DRA Inbound Link Value Updates Remaining in Packet"
|
||||
_ = "DRA Inbound Link Values/sec"
|
||||
draInboundObjectUpdatesRemainingInPacket = "DRA Inbound Object Updates Remaining in Packet"
|
||||
draInboundObjectsAppliedPerSec = "DRA Inbound Objects Applied/sec"
|
||||
draInboundObjectsFilteredPerSec = "DRA Inbound Objects Filtered/sec"
|
||||
draInboundObjectsPerSec = "DRA Inbound Objects/sec"
|
||||
draInboundPropertiesAppliedPerSec = "DRA Inbound Properties Applied/sec"
|
||||
draInboundPropertiesFilteredPerSec = "DRA Inbound Properties Filtered/sec"
|
||||
draInboundPropertiesTotalPerSec = "DRA Inbound Properties Total/sec"
|
||||
_ = "DRA Inbound Sync Link Deletion/sec"
|
||||
draInboundTotalUpdatesRemainingInPacket = "DRA Inbound Total Updates Remaining in Packet"
|
||||
draInboundValuesDNsOnlyPerSec = "DRA Inbound Values (DNs only)/sec"
|
||||
draInboundValuesTotalPerSec = "DRA Inbound Values Total/sec"
|
||||
_ = "DRA number of NC replication calls since boot"
|
||||
_ = "DRA number of successful NC replication calls since boot"
|
||||
draOutboundBytesCompressedBetweenSitesAfterCompressionSinceBoot = "DRA Outbound Bytes Compressed (Between Sites, After Compression) Since Boot"
|
||||
draOutboundBytesCompressedBetweenSitesAfterCompressionPerSec = "DRA Outbound Bytes Compressed (Between Sites, After Compression)/sec"
|
||||
draOutboundBytesCompressedBetweenSitesBeforeCompressionSinceBoot = "DRA Outbound Bytes Compressed (Between Sites, Before Compression) Since Boot"
|
||||
draOutboundBytesCompressedBetweenSitesBeforeCompressionPerSec = "DRA Outbound Bytes Compressed (Between Sites, Before Compression)/sec"
|
||||
draOutboundBytesNotCompressedWithinSiteSinceBoot = "DRA Outbound Bytes Not Compressed (Within Site) Since Boot"
|
||||
draOutboundBytesNotCompressedWithinSitePerSec = "DRA Outbound Bytes Not Compressed (Within Site)/sec"
|
||||
draOutboundBytesTotalSinceBoot = "DRA Outbound Bytes Total Since Boot"
|
||||
draOutboundBytesTotalPerSec = "DRA Outbound Bytes Total/sec"
|
||||
draOutboundObjectsFilteredPerSec = "DRA Outbound Objects Filtered/sec"
|
||||
draOutboundObjectsPerSec = "DRA Outbound Objects/sec"
|
||||
draOutboundPropertiesPerSec = "DRA Outbound Properties/sec"
|
||||
draOutboundValuesDNsOnlyPerSec = "DRA Outbound Values (DNs only)/sec"
|
||||
draOutboundValuesTotalPerSec = "DRA Outbound Values Total/sec"
|
||||
draPendingReplicationOperations = "DRA Pending Replication Operations"
|
||||
draPendingReplicationSynchronizations = "DRA Pending Replication Synchronizations"
|
||||
draSyncFailuresOnSchemaMismatch = "DRA Sync Failures on Schema Mismatch"
|
||||
draSyncRequestsMade = "DRA Sync Requests Made"
|
||||
draSyncRequestsSuccessful = "DRA Sync Requests Successful"
|
||||
draThreadsGettingNCChanges = "DRA Threads Getting NC Changes"
|
||||
draThreadsGettingNCChangesHoldingSemaphore = "DRA Threads Getting NC Changes Holding Semaphore"
|
||||
_ = "DRA total number of Busy failures since boot"
|
||||
_ = "DRA total number of MissingParent failures since boot"
|
||||
_ = "DRA total number of NotEnoughAttrs/MissingObject failures since boot"
|
||||
_ = "DRA total number of Preempted failures since boot"
|
||||
_ = "DRA total time of applying replication package since boot"
|
||||
_ = "DRA total time of NC replication calls since boot"
|
||||
_ = "DRA total time of successful NC replication calls since boot"
|
||||
_ = "DRA total time of successfully applying replication package since boot"
|
||||
_ = "DRA total time on waiting async replication packages since boot"
|
||||
_ = "DRA total time on waiting sync replication packages since boot"
|
||||
dsPercentReadsFromDRA = "DS % Reads from DRA"
|
||||
dsPercentReadsFromKCC = "DS % Reads from KCC"
|
||||
dsPercentReadsFromLSA = "DS % Reads from LSA"
|
||||
dsPercentReadsFromNSPI = "DS % Reads from NSPI"
|
||||
dsPercentReadsFromNTDSAPI = "DS % Reads from NTDSAPI"
|
||||
dsPercentReadsFromSAM = "DS % Reads from SAM"
|
||||
dsPercentReadsOther = "DS % Reads Other"
|
||||
dsPercentSearchesFromDRA = "DS % Searches from DRA"
|
||||
dsPercentSearchesFromKCC = "DS % Searches from KCC"
|
||||
dsPercentSearchesFromLDAP = "DS % Searches from LDAP"
|
||||
dsPercentSearchesFromLSA = "DS % Searches from LSA"
|
||||
dsPercentSearchesFromNSPI = "DS % Searches from NSPI"
|
||||
dsPercentSearchesFromNTDSAPI = "DS % Searches from NTDSAPI"
|
||||
dsPercentSearchesFromSAM = "DS % Searches from SAM"
|
||||
dsPercentSearchesOther = "DS % Searches Other"
|
||||
dsPercentWritesFromDRA = "DS % Writes from DRA"
|
||||
dsPercentWritesFromKCC = "DS % Writes from KCC"
|
||||
dsPercentWritesFromLDAP = "DS % Writes from LDAP"
|
||||
dsPercentWritesFromLSA = "DS % Writes from LSA"
|
||||
dsPercentWritesFromNSPI = "DS % Writes from NSPI"
|
||||
dsPercentWritesFromNTDSAPI = "DS % Writes from NTDSAPI"
|
||||
dsPercentWritesFromSAM = "DS % Writes from SAM"
|
||||
dsPercentWritesOther = "DS % Writes Other"
|
||||
dsClientBindsPerSec = "DS Client Binds/sec"
|
||||
dsClientNameTranslationsPerSec = "DS Client Name Translations/sec"
|
||||
dsDirectoryReadsPerSec = "DS Directory Reads/sec"
|
||||
dsDirectorySearchesPerSec = "DS Directory Searches/sec"
|
||||
dsDirectoryWritesPerSec = "DS Directory Writes/sec"
|
||||
dsMonitorListSize = "DS Monitor List Size"
|
||||
dsNameCacheHitRate = "DS Name Cache hit rate"
|
||||
dsNotifyQueueSize = "DS Notify Queue Size"
|
||||
dsSearchSubOperationsPerSec = "DS Search sub-operations/sec"
|
||||
dsSecurityDescriptorPropagationsEvents = "DS Security Descriptor Propagations Events"
|
||||
dsSecurityDescriptorPropagatorAverageExclusionTime = "DS Security Descriptor Propagator Average Exclusion Time"
|
||||
dsSecurityDescriptorPropagatorRuntimeQueue = "DS Security Descriptor Propagator Runtime Queue"
|
||||
dsSecurityDescriptorSubOperationsPerSec = "DS Security Descriptor sub-operations/sec"
|
||||
dsServerBindsPerSec = "DS Server Binds/sec"
|
||||
dsServerNameTranslationsPerSec = "DS Server Name Translations/sec"
|
||||
dsThreadsInUse = "DS Threads in Use"
|
||||
_ = "Error eventlogs since boot"
|
||||
_ = "Error events since boot"
|
||||
externalBindsPerSec = "External Binds/sec"
|
||||
fastBindsPerSec = "Fast Binds/sec"
|
||||
_ = "Fatal events since boot"
|
||||
_ = "Info eventlogs since boot"
|
||||
ldapActiveThreads = "LDAP Active Threads"
|
||||
_ = "LDAP Add Operations"
|
||||
_ = "LDAP Add Operations/sec"
|
||||
_ = "LDAP batch slots available"
|
||||
ldapBindTime = "LDAP Bind Time"
|
||||
_ = "LDAP busy retries"
|
||||
_ = "LDAP busy retries/sec"
|
||||
ldapClientSessions = "LDAP Client Sessions"
|
||||
ldapClosedConnectionsPerSec = "LDAP Closed Connections/sec"
|
||||
_ = "LDAP Delete Operations"
|
||||
_ = "LDAP Delete Operations/sec"
|
||||
_ = "LDAP Modify DN Operations"
|
||||
_ = "LDAP Modify DN Operations/sec"
|
||||
_ = "LDAP Modify Operations"
|
||||
_ = "LDAP Modify Operations/sec"
|
||||
ldapNewConnectionsPerSec = "LDAP New Connections/sec"
|
||||
ldapNewSSLConnectionsPerSec = "LDAP New SSL Connections/sec"
|
||||
_ = "LDAP Outbound Bytes"
|
||||
_ = "LDAP Outbound Bytes/sec"
|
||||
_ = "LDAP Page Search Cache entries count"
|
||||
_ = "LDAP Page Search Cache size"
|
||||
ldapSearchesPerSec = "LDAP Searches/sec"
|
||||
ldapSuccessfulBindsPerSec = "LDAP Successful Binds/sec"
|
||||
_ = "LDAP Threads Sleeping on BUSY"
|
||||
ldapUDPOperationsPerSec = "LDAP UDP operations/sec"
|
||||
ldapWritesPerSec = "LDAP Writes/sec"
|
||||
linkValuesCleanedPerSec = "Link Values Cleaned/sec"
|
||||
_ = "Links added"
|
||||
_ = "Links added/sec"
|
||||
_ = "Links visited"
|
||||
_ = "Links visited/sec"
|
||||
_ = "Logical link deletes"
|
||||
_ = "Logical link deletes/sec"
|
||||
negotiatedBindsPerSec = "Negotiated Binds/sec"
|
||||
ntlmBindsPerSec = "NTLM Binds/sec"
|
||||
_ = "Objects returned"
|
||||
_ = "Objects returned/sec"
|
||||
_ = "Objects visited"
|
||||
_ = "Objects visited/sec"
|
||||
oneLevelSearchesPerSec = "Onelevel searches/sec"
|
||||
_ = "PDC failed password update notifications"
|
||||
_ = "PDC password update notifications/sec"
|
||||
_ = "PDC successful password update notifications"
|
||||
phantomsCleanedPerSec = "Phantoms Cleaned/sec"
|
||||
phantomsVisitedPerSec = "Phantoms Visited/sec"
|
||||
_ = "Physical link deletes"
|
||||
_ = "Physical link deletes/sec"
|
||||
_ = "Replicate Single Object operations"
|
||||
_ = "Replicate Single Object operations/sec"
|
||||
_ = "RID Pool invalidations since boot"
|
||||
_ = "RID Pool request failures since boot"
|
||||
_ = "RID Pool request successes since boot"
|
||||
samAccountGroupEvaluationLatency = "SAM Account Group Evaluation Latency"
|
||||
samDisplayInformationQueriesPerSec = "SAM Display Information Queries/sec"
|
||||
samDomainLocalGroupMembershipEvaluationsPerSec = "SAM Domain Local Group Membership Evaluations/sec"
|
||||
samEnumerationsPerSec = "SAM Enumerations/sec"
|
||||
samGCEvaluationsPerSec = "SAM GC Evaluations/sec"
|
||||
samGlobalGroupMembershipEvaluationsPerSec = "SAM Global Group Membership Evaluations/sec"
|
||||
samMachineCreationAttemptsPerSec = "SAM Machine Creation Attempts/sec"
|
||||
samMembershipChangesPerSec = "SAM Membership Changes/sec"
|
||||
samNonTransitiveMembershipEvaluationsPerSec = "SAM Non-Transitive Membership Evaluations/sec"
|
||||
samPasswordChangesPerSec = "SAM Password Changes/sec"
|
||||
samResourceGroupEvaluationLatency = "SAM Resource Group Evaluation Latency"
|
||||
samSuccessfulComputerCreationsPerSecIncludesAllRequests = "SAM Successful Computer Creations/sec: Includes all requests"
|
||||
samSuccessfulUserCreationsPerSec = "SAM Successful User Creations/sec"
|
||||
samTransitiveMembershipEvaluationsPerSec = "SAM Transitive Membership Evaluations/sec"
|
||||
samUniversalGroupMembershipEvaluationsPerSec = "SAM Universal Group Membership Evaluations/sec"
|
||||
samUserCreationAttemptsPerSec = "SAM User Creation Attempts/sec"
|
||||
simpleBindsPerSec = "Simple Binds/sec"
|
||||
subtreeSearchesPerSec = "Subtree searches/sec"
|
||||
tombstonesGarbageCollectedPerSec = "Tombstones Garbage Collected/sec"
|
||||
tombstonesVisitedPerSec = "Tombstones Visited/sec"
|
||||
transitiveOperationsMillisecondsRun = "Transitive operations milliseconds run"
|
||||
transitiveOperationsPerSec = "Transitive operations/sec"
|
||||
transitiveSubOperationsPerSec = "Transitive suboperations/sec"
|
||||
_ = "Warning eventlogs since boot"
|
||||
_ = "Warning events since boot"
|
||||
)
|
||||
225
internal/collector/ad/types.go
Normal file
225
internal/collector/ad/types.go
Normal file
@@ -0,0 +1,225 @@
|
||||
// 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 ad
|
||||
|
||||
type perfDataCounterValues struct {
|
||||
AbANRPerSec float64 `perfdata:"AB ANR/sec"`
|
||||
AbBrowsesPerSec float64 `perfdata:"AB Browses/sec"`
|
||||
AbClientSessions float64 `perfdata:"AB Client Sessions"`
|
||||
AbMatchesPerSec float64 `perfdata:"AB Matches/sec"`
|
||||
AbPropertyReadsPerSec float64 `perfdata:"AB Property Reads/sec"`
|
||||
AbProxyLookupsPerSec float64 `perfdata:"AB Proxy Lookups/sec"`
|
||||
AbSearchesPerSec float64 `perfdata:"AB Searches/sec"`
|
||||
ApproximateHighestDNT float64 `perfdata:"Approximate highest DNT"`
|
||||
AtqEstimatedQueueDelay float64 `perfdata:"ATQ Estimated Queue Delay"`
|
||||
AtqOutstandingQueuedRequests float64 `perfdata:"ATQ Outstanding Queued Requests"`
|
||||
_ float64 `perfdata:"ATQ Queue Latency"`
|
||||
AtqRequestLatency float64 `perfdata:"ATQ Request Latency"`
|
||||
AtqThreadsLDAP float64 `perfdata:"ATQ Threads LDAP"`
|
||||
AtqThreadsOther float64 `perfdata:"ATQ Threads Other"`
|
||||
AtqThreadsTotal float64 `perfdata:"ATQ Threads Total"`
|
||||
BaseSearchesPerSec float64 `perfdata:"Base searches/sec"`
|
||||
DatabaseAddsPerSec float64 `perfdata:"Database adds/sec"`
|
||||
DatabaseDeletesPerSec float64 `perfdata:"Database deletes/sec"`
|
||||
DatabaseModifiesPerSec float64 `perfdata:"Database modifys/sec"`
|
||||
DatabaseRecyclesPerSec float64 `perfdata:"Database recycles/sec"`
|
||||
DigestBindsPerSec float64 `perfdata:"Digest Binds/sec"`
|
||||
_ float64 `perfdata:"DirSync session throttling rate"`
|
||||
_ float64 `perfdata:"DirSync sessions in progress"`
|
||||
DRAHighestUSNCommittedHighPart float64 `perfdata:"DRA Highest USN Committed (High part)"`
|
||||
DRAHighestUSNCommittedLowPart float64 `perfdata:"DRA Highest USN Committed (Low part)"`
|
||||
DRAHighestUSNIssuedHighPart float64 `perfdata:"DRA Highest USN Issued (High part)"`
|
||||
DRAHighestUSNIssuedLowPart float64 `perfdata:"DRA Highest USN Issued (Low part)"`
|
||||
DRAInboundBytesCompressedBetweenSitesAfterCompressionSinceBoot float64 `perfdata:"DRA Inbound Bytes Compressed (Between Sites, After Compression) Since Boot"`
|
||||
DRAInboundBytesCompressedBetweenSitesAfterCompressionPerSec float64 `perfdata:"DRA Inbound Bytes Compressed (Between Sites, After Compression)/sec"`
|
||||
DRAInboundBytesCompressedBetweenSitesBeforeCompressionSinceBoot float64 `perfdata:"DRA Inbound Bytes Compressed (Between Sites, Before Compression) Since Boot"`
|
||||
DRAInboundBytesCompressedBetweenSitesBeforeCompressionPerSec float64 `perfdata:"DRA Inbound Bytes Compressed (Between Sites, Before Compression)/sec"`
|
||||
DRAInboundBytesNotCompressedWithinSiteSinceBoot float64 `perfdata:"DRA Inbound Bytes Not Compressed (Within Site) Since Boot"`
|
||||
DRAInboundBytesNotCompressedWithinSitePerSec float64 `perfdata:"DRA Inbound Bytes Not Compressed (Within Site)/sec"`
|
||||
DRAInboundBytesTotalSinceBoot float64 `perfdata:"DRA Inbound Bytes Total Since Boot"`
|
||||
DRAInboundBytesTotalPerSec float64 `perfdata:"DRA Inbound Bytes Total/sec"`
|
||||
DRAInboundFullSyncObjectsRemaining float64 `perfdata:"DRA Inbound Full Sync Objects Remaining"`
|
||||
DRAInboundLinkValueUpdatesRemainingInPacket float64 `perfdata:"DRA Inbound Link Value Updates Remaining in Packet"`
|
||||
_ float64 `perfdata:"DRA Inbound Link Values/sec"`
|
||||
DRAInboundObjectUpdatesRemainingInPacket float64 `perfdata:"DRA Inbound Object Updates Remaining in Packet"`
|
||||
DRAInboundObjectsAppliedPerSec float64 `perfdata:"DRA Inbound Objects Applied/sec"`
|
||||
DRAInboundObjectsFilteredPerSec float64 `perfdata:"DRA Inbound Objects Filtered/sec"`
|
||||
DRAInboundObjectsPerSec float64 `perfdata:"DRA Inbound Objects/sec"`
|
||||
DRAInboundPropertiesAppliedPerSec float64 `perfdata:"DRA Inbound Properties Applied/sec"`
|
||||
DRAInboundPropertiesFilteredPerSec float64 `perfdata:"DRA Inbound Properties Filtered/sec"`
|
||||
DRAInboundPropertiesTotalPerSec float64 `perfdata:"DRA Inbound Properties Total/sec"`
|
||||
_ float64 `perfdata:"DRA Inbound Sync Link Deletion/sec"`
|
||||
DRAInboundTotalUpdatesRemainingInPacket float64 `perfdata:"DRA Inbound Total Updates Remaining in Packet"`
|
||||
DRAInboundValuesDNsOnlyPerSec float64 `perfdata:"DRA Inbound Values (DNs only)/sec"`
|
||||
DRAInboundValuesTotalPerSec float64 `perfdata:"DRA Inbound Values Total/sec"`
|
||||
_ float64 `perfdata:"DRA number of NC replication calls since boot"`
|
||||
_ float64 `perfdata:"DRA number of successful NC replication calls since boot"`
|
||||
DRAOutboundBytesCompressedBetweenSitesAfterCompressionSinceBoot float64 `perfdata:"DRA Outbound Bytes Compressed (Between Sites, After Compression) Since Boot"`
|
||||
DRAOutboundBytesCompressedBetweenSitesAfterCompressionPerSec float64 `perfdata:"DRA Outbound Bytes Compressed (Between Sites, After Compression)/sec"`
|
||||
DRAOutboundBytesCompressedBetweenSitesBeforeCompressionSinceBoot float64 `perfdata:"DRA Outbound Bytes Compressed (Between Sites, Before Compression) Since Boot"`
|
||||
DRAOutboundBytesCompressedBetweenSitesBeforeCompressionPerSec float64 `perfdata:"DRA Outbound Bytes Compressed (Between Sites, Before Compression)/sec"`
|
||||
DRAOutboundBytesNotCompressedWithinSiteSinceBoot float64 `perfdata:"DRA Outbound Bytes Not Compressed (Within Site) Since Boot"`
|
||||
DRAOutboundBytesNotCompressedWithinSitePerSec float64 `perfdata:"DRA Outbound Bytes Not Compressed (Within Site)/sec"`
|
||||
DRAOutboundBytesTotalSinceBoot float64 `perfdata:"DRA Outbound Bytes Total Since Boot"`
|
||||
DRAOutboundBytesTotalPerSec float64 `perfdata:"DRA Outbound Bytes Total/sec"`
|
||||
DRAOutboundObjectsFilteredPerSec float64 `perfdata:"DRA Outbound Objects Filtered/sec"`
|
||||
DRAOutboundObjectsPerSec float64 `perfdata:"DRA Outbound Objects/sec"`
|
||||
DRAOutboundPropertiesPerSec float64 `perfdata:"DRA Outbound Properties/sec"`
|
||||
DRAOutboundValuesDNsOnlyPerSec float64 `perfdata:"DRA Outbound Values (DNs only)/sec"`
|
||||
DRAOutboundValuesTotalPerSec float64 `perfdata:"DRA Outbound Values Total/sec"`
|
||||
DRAPendingReplicationOperations float64 `perfdata:"DRA Pending Replication Operations"`
|
||||
DRAPendingReplicationSynchronizations float64 `perfdata:"DRA Pending Replication Synchronizations"`
|
||||
DRASyncFailuresOnSchemaMismatch float64 `perfdata:"DRA Sync Failures on Schema Mismatch"`
|
||||
DRASyncRequestsMade float64 `perfdata:"DRA Sync Requests Made"`
|
||||
DRASyncRequestsSuccessful float64 `perfdata:"DRA Sync Requests Successful"`
|
||||
DRAThreadsGettingNCChanges float64 `perfdata:"DRA Threads Getting NC Changes"`
|
||||
DRAThreadsGettingNCChangesHoldingSemaphore float64 `perfdata:"DRA Threads Getting NC Changes Holding Semaphore"`
|
||||
_ float64 `perfdata:"DRA total number of Busy failures since boot"`
|
||||
_ float64 `perfdata:"DRA total number of MissingParent failures since boot"`
|
||||
_ float64 `perfdata:"DRA total number of NotEnoughAttrs/MissingObject failures since boot"`
|
||||
_ float64 `perfdata:"DRA total number of Preempted failures since boot"`
|
||||
_ float64 `perfdata:"DRA total time of applying replication package since boot"`
|
||||
_ float64 `perfdata:"DRA total time of NC replication calls since boot"`
|
||||
_ float64 `perfdata:"DRA total time of successful NC replication calls since boot"`
|
||||
_ float64 `perfdata:"DRA total time of successfully applying replication package since boot"`
|
||||
_ float64 `perfdata:"DRA total time on waiting async replication packages since boot"`
|
||||
_ float64 `perfdata:"DRA total time on waiting sync replication packages since boot"`
|
||||
DsPercentReadsFromDRA float64 `perfdata:"DS % Reads from DRA"`
|
||||
DsPercentReadsFromKCC float64 `perfdata:"DS % Reads from KCC"`
|
||||
DsPercentReadsFromLSA float64 `perfdata:"DS % Reads from LSA"`
|
||||
DsPercentReadsFromNSPI float64 `perfdata:"DS % Reads from NSPI"`
|
||||
DsPercentReadsFromNTDSAPI float64 `perfdata:"DS % Reads from NTDSAPI"`
|
||||
DsPercentReadsFromSAM float64 `perfdata:"DS % Reads from SAM"`
|
||||
DsPercentReadsOther float64 `perfdata:"DS % Reads Other"`
|
||||
DsPercentSearchesFromDRA float64 `perfdata:"DS % Searches from DRA"`
|
||||
DsPercentSearchesFromKCC float64 `perfdata:"DS % Searches from KCC"`
|
||||
DsPercentSearchesFromLDAP float64 `perfdata:"DS % Searches from LDAP"`
|
||||
DsPercentSearchesFromLSA float64 `perfdata:"DS % Searches from LSA"`
|
||||
DsPercentSearchesFromNSPI float64 `perfdata:"DS % Searches from NSPI"`
|
||||
DsPercentSearchesFromNTDSAPI float64 `perfdata:"DS % Searches from NTDSAPI"`
|
||||
DsPercentSearchesFromSAM float64 `perfdata:"DS % Searches from SAM"`
|
||||
DsPercentSearchesOther float64 `perfdata:"DS % Searches Other"`
|
||||
DsPercentWritesFromDRA float64 `perfdata:"DS % Writes from DRA"`
|
||||
DsPercentWritesFromKCC float64 `perfdata:"DS % Writes from KCC"`
|
||||
DsPercentWritesFromLDAP float64 `perfdata:"DS % Writes from LDAP"`
|
||||
DsPercentWritesFromLSA float64 `perfdata:"DS % Writes from LSA"`
|
||||
DsPercentWritesFromNSPI float64 `perfdata:"DS % Writes from NSPI"`
|
||||
DsPercentWritesFromNTDSAPI float64 `perfdata:"DS % Writes from NTDSAPI"`
|
||||
DsPercentWritesFromSAM float64 `perfdata:"DS % Writes from SAM"`
|
||||
DsPercentWritesOther float64 `perfdata:"DS % Writes Other"`
|
||||
DsClientBindsPerSec float64 `perfdata:"DS Client Binds/sec"`
|
||||
DsClientNameTranslationsPerSec float64 `perfdata:"DS Client Name Translations/sec"`
|
||||
DsDirectoryReadsPerSec float64 `perfdata:"DS Directory Reads/sec"`
|
||||
DsDirectorySearchesPerSec float64 `perfdata:"DS Directory Searches/sec"`
|
||||
DsDirectoryWritesPerSec float64 `perfdata:"DS Directory Writes/sec"`
|
||||
DsMonitorListSize float64 `perfdata:"DS Monitor List Size"`
|
||||
DsNameCacheHitRate float64 `perfdata:"DS Name Cache hit rate"`
|
||||
DsNameCacheHitRateSecondValue float64 `perfdata:"DS Name Cache hit rate,secondvalue"`
|
||||
DsNotifyQueueSize float64 `perfdata:"DS Notify Queue Size"`
|
||||
DsSearchSubOperationsPerSec float64 `perfdata:"DS Search sub-operations/sec"`
|
||||
DsSecurityDescriptorPropagationsEvents float64 `perfdata:"DS Security Descriptor Propagations Events"`
|
||||
DsSecurityDescriptorPropagatorAverageExclusionTime float64 `perfdata:"DS Security Descriptor Propagator Average Exclusion Time"`
|
||||
DsSecurityDescriptorPropagatorRuntimeQueue float64 `perfdata:"DS Security Descriptor Propagator Runtime Queue"`
|
||||
DsSecurityDescriptorSubOperationsPerSec float64 `perfdata:"DS Security Descriptor sub-operations/sec"`
|
||||
DsServerBindsPerSec float64 `perfdata:"DS Server Binds/sec"`
|
||||
DsServerNameTranslationsPerSec float64 `perfdata:"DS Server Name Translations/sec"`
|
||||
DsThreadsInUse float64 `perfdata:"DS Threads in Use"`
|
||||
_ float64 `perfdata:"Error eventlogs since boot"`
|
||||
_ float64 `perfdata:"Error events since boot"`
|
||||
ExternalBindsPerSec float64 `perfdata:"External Binds/sec"`
|
||||
FastBindsPerSec float64 `perfdata:"Fast Binds/sec"`
|
||||
_ float64 `perfdata:"Fatal events since boot"`
|
||||
_ float64 `perfdata:"Info eventlogs since boot"`
|
||||
LdapActiveThreads float64 `perfdata:"LDAP Active Threads"`
|
||||
_ float64 `perfdata:"LDAP Add Operations"`
|
||||
_ float64 `perfdata:"LDAP Add Operations/sec"`
|
||||
_ float64 `perfdata:"LDAP batch slots available"`
|
||||
LdapBindTime float64 `perfdata:"LDAP Bind Time"`
|
||||
_ float64 `perfdata:"LDAP busy retries"`
|
||||
_ float64 `perfdata:"LDAP busy retries/sec"`
|
||||
LdapClientSessions float64 `perfdata:"LDAP Client Sessions"`
|
||||
LdapClosedConnectionsPerSec float64 `perfdata:"LDAP Closed Connections/sec"`
|
||||
_ float64 `perfdata:"LDAP Delete Operations"`
|
||||
_ float64 `perfdata:"LDAP Delete Operations/sec"`
|
||||
_ float64 `perfdata:"LDAP Modify DN Operations"`
|
||||
_ float64 `perfdata:"LDAP Modify DN Operations/sec"`
|
||||
_ float64 `perfdata:"LDAP Modify Operations"`
|
||||
_ float64 `perfdata:"LDAP Modify Operations/sec"`
|
||||
LdapNewConnectionsPerSec float64 `perfdata:"LDAP New Connections/sec"`
|
||||
LdapNewSSLConnectionsPerSec float64 `perfdata:"LDAP New SSL Connections/sec"`
|
||||
_ float64 `perfdata:"LDAP Outbound Bytes"`
|
||||
_ float64 `perfdata:"LDAP Outbound Bytes/sec"`
|
||||
_ float64 `perfdata:"LDAP Page Search Cache entries count"`
|
||||
_ float64 `perfdata:"LDAP Page Search Cache size"`
|
||||
LdapSearchesPerSec float64 `perfdata:"LDAP Searches/sec"`
|
||||
LdapSuccessfulBindsPerSec float64 `perfdata:"LDAP Successful Binds/sec"`
|
||||
_ float64 `perfdata:"LDAP Threads Sleeping on BUSY"`
|
||||
LdapUDPOperationsPerSec float64 `perfdata:"LDAP UDP operations/sec"`
|
||||
LdapWritesPerSec float64 `perfdata:"LDAP Writes/sec"`
|
||||
LinkValuesCleanedPerSec float64 `perfdata:"Link Values Cleaned/sec"`
|
||||
_ float64 `perfdata:"Links added"`
|
||||
_ float64 `perfdata:"Links added/sec"`
|
||||
_ float64 `perfdata:"Links visited"`
|
||||
_ float64 `perfdata:"Links visited/sec"`
|
||||
_ float64 `perfdata:"Logical link deletes"`
|
||||
_ float64 `perfdata:"Logical link deletes/sec"`
|
||||
NegotiatedBindsPerSec float64 `perfdata:"Negotiated Binds/sec"`
|
||||
NTLMBindsPerSec float64 `perfdata:"NTLM Binds/sec"`
|
||||
_ float64 `perfdata:"Objects returned"`
|
||||
_ float64 `perfdata:"Objects returned/sec"`
|
||||
_ float64 `perfdata:"Objects visited"`
|
||||
_ float64 `perfdata:"Objects visited/sec"`
|
||||
OneLevelSearchesPerSec float64 `perfdata:"Onelevel searches/sec"`
|
||||
_ float64 `perfdata:"PDC failed password update notifications"`
|
||||
_ float64 `perfdata:"PDC password update notifications/sec"`
|
||||
_ float64 `perfdata:"PDC successful password update notifications"`
|
||||
PhantomsCleanedPerSec float64 `perfdata:"Phantoms Cleaned/sec"`
|
||||
PhantomsVisitedPerSec float64 `perfdata:"Phantoms Visited/sec"`
|
||||
_ float64 `perfdata:"Physical link deletes"`
|
||||
_ float64 `perfdata:"Physical link deletes/sec"`
|
||||
_ float64 `perfdata:"Replicate Single Object operations"`
|
||||
_ float64 `perfdata:"Replicate Single Object operations/sec"`
|
||||
_ float64 `perfdata:"RID Pool invalidations since boot"`
|
||||
_ float64 `perfdata:"RID Pool request failures since boot"`
|
||||
_ float64 `perfdata:"RID Pool request successes since boot"`
|
||||
SamAccountGroupEvaluationLatency float64 `perfdata:"SAM Account Group Evaluation Latency"`
|
||||
SamDisplayInformationQueriesPerSec float64 `perfdata:"SAM Display Information Queries/sec"`
|
||||
SamDomainLocalGroupMembershipEvaluationsPerSec float64 `perfdata:"SAM Domain Local Group Membership Evaluations/sec"`
|
||||
SamEnumerationsPerSec float64 `perfdata:"SAM Enumerations/sec"`
|
||||
SamGCEvaluationsPerSec float64 `perfdata:"SAM GC Evaluations/sec"`
|
||||
SamGlobalGroupMembershipEvaluationsPerSec float64 `perfdata:"SAM Global Group Membership Evaluations/sec"`
|
||||
SamMachineCreationAttemptsPerSec float64 `perfdata:"SAM Machine Creation Attempts/sec"`
|
||||
SamMembershipChangesPerSec float64 `perfdata:"SAM Membership Changes/sec"`
|
||||
SamNonTransitiveMembershipEvaluationsPerSec float64 `perfdata:"SAM Non-Transitive Membership Evaluations/sec"`
|
||||
SamPasswordChangesPerSec float64 `perfdata:"SAM Password Changes/sec"`
|
||||
SamResourceGroupEvaluationLatency float64 `perfdata:"SAM Resource Group Evaluation Latency"`
|
||||
SamSuccessfulComputerCreationsPerSecIncludesAllRequests float64 `perfdata:"SAM Successful Computer Creations/sec: Includes all requests"`
|
||||
SamSuccessfulUserCreationsPerSec float64 `perfdata:"SAM Successful User Creations/sec"`
|
||||
SamTransitiveMembershipEvaluationsPerSec float64 `perfdata:"SAM Transitive Membership Evaluations/sec"`
|
||||
SamUniversalGroupMembershipEvaluationsPerSec float64 `perfdata:"SAM Universal Group Membership Evaluations/sec"`
|
||||
SamUserCreationAttemptsPerSec float64 `perfdata:"SAM User Creation Attempts/sec"`
|
||||
SimpleBindsPerSec float64 `perfdata:"Simple Binds/sec"`
|
||||
SubtreeSearchesPerSec float64 `perfdata:"Subtree searches/sec"`
|
||||
TombstonesGarbageCollectedPerSec float64 `perfdata:"Tombstones Garbage Collected/sec"`
|
||||
TombstonesVisitedPerSec float64 `perfdata:"Tombstones Visited/sec"`
|
||||
TransitiveOperationsMillisecondsRun float64 `perfdata:"Transitive operations milliseconds run"`
|
||||
TransitiveOperationsPerSec float64 `perfdata:"Transitive operations/sec"`
|
||||
TransitiveSubOperationsPerSec float64 `perfdata:"Transitive suboperations/sec"`
|
||||
_ float64 `perfdata:"Warning eventlogs since boot"`
|
||||
_ float64 `perfdata:"Warning events since boot"`
|
||||
}
|
||||
@@ -1,15 +1,29 @@
|
||||
// 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 adcs
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/alecthomas/kingpin/v2"
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/perfdata"
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@@ -19,12 +33,14 @@ const Name = "adcs"
|
||||
|
||||
type Config struct{}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var ConfigDefaults = Config{}
|
||||
|
||||
type Collector struct {
|
||||
config Config
|
||||
|
||||
perfDataCollector *perfdata.Collector
|
||||
perfDataCollector *pdh.Collector
|
||||
perfDataObject []perfDataCounterValues
|
||||
|
||||
challengeResponseProcessingTime *prometheus.Desc
|
||||
challengeResponsesPerSecond *prometheus.Desc
|
||||
@@ -67,28 +83,7 @@ func (c *Collector) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||
var err error
|
||||
|
||||
c.perfDataCollector, err = perfdata.NewCollector("Certification Authority", perfdata.InstanceAll, []string{
|
||||
requestsPerSecond,
|
||||
requestProcessingTime,
|
||||
retrievalsPerSecond,
|
||||
retrievalProcessingTime,
|
||||
failedRequestsPerSecond,
|
||||
issuedRequestsPerSecond,
|
||||
pendingRequestsPerSecond,
|
||||
requestCryptographicSigningTime,
|
||||
requestPolicyModuleProcessingTime,
|
||||
challengeResponsesPerSecond,
|
||||
challengeResponseProcessingTime,
|
||||
signedCertificateTimestampListsPerSecond,
|
||||
signedCertificateTimestampListProcessingTime,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create Certification Authority collector: %w", err)
|
||||
}
|
||||
|
||||
func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
||||
c.requestsPerSecond = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "requests_total"),
|
||||
"Total certificate requests processed",
|
||||
@@ -168,97 +163,112 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||
nil,
|
||||
)
|
||||
|
||||
var err error
|
||||
|
||||
c.perfDataCollector, err = pdh.NewCollector[perfDataCounterValues](logger.With(slog.String("collector", Name)), pdh.CounterTypeRaw, "Certification Authority", pdh.InstancesAll)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create Certification Authority collector: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
perfData, err := c.perfDataCollector.Collect()
|
||||
err := c.perfDataCollector.Collect(&c.perfDataObject)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to collect Certification Authority (ADCS) metrics: %w", err)
|
||||
}
|
||||
|
||||
if len(perfData) == 0 {
|
||||
return errors.New("perflib query for Certification Authority (ADCS) returned empty result set")
|
||||
}
|
||||
|
||||
for name, data := range perfData {
|
||||
for _, data := range c.perfDataObject {
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.requestsPerSecond,
|
||||
prometheus.CounterValue,
|
||||
data[requestsPerSecond].FirstValue,
|
||||
name,
|
||||
data.RequestsPerSecond,
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.requestProcessingTime,
|
||||
prometheus.GaugeValue,
|
||||
utils.MilliSecToSec(data[requestProcessingTime].FirstValue),
|
||||
name,
|
||||
utils.MilliSecToSec(data.RequestProcessingTime),
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.retrievalsPerSecond,
|
||||
prometheus.CounterValue,
|
||||
data[retrievalsPerSecond].FirstValue,
|
||||
name,
|
||||
data.RetrievalsPerSecond,
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.retrievalProcessingTime,
|
||||
prometheus.GaugeValue,
|
||||
utils.MilliSecToSec(data[retrievalProcessingTime].FirstValue),
|
||||
name,
|
||||
utils.MilliSecToSec(data.RetrievalProcessingTime),
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.failedRequestsPerSecond,
|
||||
prometheus.CounterValue,
|
||||
data[failedRequestsPerSecond].FirstValue,
|
||||
name,
|
||||
data.FailedRequestsPerSecond,
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.issuedRequestsPerSecond,
|
||||
prometheus.CounterValue,
|
||||
data[issuedRequestsPerSecond].FirstValue,
|
||||
name,
|
||||
data.IssuedRequestsPerSecond,
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.pendingRequestsPerSecond,
|
||||
prometheus.CounterValue,
|
||||
data[pendingRequestsPerSecond].FirstValue,
|
||||
name,
|
||||
data.PendingRequestsPerSecond,
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.requestCryptographicSigningTime,
|
||||
prometheus.GaugeValue,
|
||||
utils.MilliSecToSec(data[requestCryptographicSigningTime].FirstValue),
|
||||
name,
|
||||
utils.MilliSecToSec(data.RequestCryptographicSigningTime),
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.requestPolicyModuleProcessingTime,
|
||||
prometheus.GaugeValue,
|
||||
utils.MilliSecToSec(data[requestPolicyModuleProcessingTime].FirstValue),
|
||||
name,
|
||||
utils.MilliSecToSec(data.RequestPolicyModuleProcessingTime),
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.challengeResponsesPerSecond,
|
||||
prometheus.CounterValue,
|
||||
data[challengeResponsesPerSecond].FirstValue,
|
||||
name,
|
||||
data.ChallengeResponsesPerSecond,
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.challengeResponseProcessingTime,
|
||||
prometheus.GaugeValue,
|
||||
utils.MilliSecToSec(data[challengeResponseProcessingTime].FirstValue),
|
||||
name,
|
||||
utils.MilliSecToSec(data.ChallengeResponseProcessingTime),
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.signedCertificateTimestampListsPerSecond,
|
||||
prometheus.CounterValue,
|
||||
data[signedCertificateTimestampListsPerSecond].FirstValue,
|
||||
name,
|
||||
data.SignedCertificateTimestampListsPerSecond,
|
||||
data.Name,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.signedCertificateTimestampListProcessingTime,
|
||||
prometheus.GaugeValue,
|
||||
utils.MilliSecToSec(data[signedCertificateTimestampListProcessingTime].FirstValue),
|
||||
name,
|
||||
utils.MilliSecToSec(data.SignedCertificateTimestampListProcessingTime),
|
||||
data.Name,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// 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 adcs_test
|
||||
@@ -12,3 +27,7 @@ import (
|
||||
func BenchmarkCollector(b *testing.B) {
|
||||
testutils.FuncBenchmarkCollector(b, adcs.Name, adcs.NewWithFlags)
|
||||
}
|
||||
|
||||
func TestCollector(t *testing.T) {
|
||||
testutils.TestCollector(t, adcs.New, nil)
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
//go:build windows
|
||||
|
||||
package adcs
|
||||
|
||||
const (
|
||||
challengeResponseProcessingTime = "Challenge Response processing time (ms)"
|
||||
challengeResponsesPerSecond = "Challenge Responses/sec"
|
||||
failedRequestsPerSecond = "Failed Requests/sec"
|
||||
issuedRequestsPerSecond = "Issued Requests/sec"
|
||||
pendingRequestsPerSecond = "Pending Requests/sec"
|
||||
requestCryptographicSigningTime = "Request cryptographic signing time (ms)"
|
||||
requestPolicyModuleProcessingTime = "Request policy module processing time (ms)"
|
||||
requestProcessingTime = "Request processing time (ms)"
|
||||
requestsPerSecond = "Requests/sec"
|
||||
retrievalProcessingTime = "Retrieval processing time (ms)"
|
||||
retrievalsPerSecond = "Retrievals/sec"
|
||||
signedCertificateTimestampListProcessingTime = "Signed Certificate Timestamp List processing time (ms)"
|
||||
signedCertificateTimestampListsPerSecond = "Signed Certificate Timestamp Lists/sec"
|
||||
)
|
||||
36
internal/collector/adcs/types.go
Normal file
36
internal/collector/adcs/types.go
Normal file
@@ -0,0 +1,36 @@
|
||||
// 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 adcs
|
||||
|
||||
type perfDataCounterValues struct {
|
||||
Name string
|
||||
|
||||
ChallengeResponseProcessingTime float64 `perfdata:"Challenge Response processing time (ms)"`
|
||||
ChallengeResponsesPerSecond float64 `perfdata:"Challenge Responses/sec"`
|
||||
FailedRequestsPerSecond float64 `perfdata:"Failed Requests/sec"`
|
||||
IssuedRequestsPerSecond float64 `perfdata:"Issued Requests/sec"`
|
||||
PendingRequestsPerSecond float64 `perfdata:"Pending Requests/sec"`
|
||||
RequestCryptographicSigningTime float64 `perfdata:"Request cryptographic signing time (ms)"`
|
||||
RequestPolicyModuleProcessingTime float64 `perfdata:"Request policy module processing time (ms)"`
|
||||
RequestProcessingTime float64 `perfdata:"Request processing time (ms)"`
|
||||
RequestsPerSecond float64 `perfdata:"Requests/sec"`
|
||||
RetrievalProcessingTime float64 `perfdata:"Retrieval processing time (ms)"`
|
||||
RetrievalsPerSecond float64 `perfdata:"Retrievals/sec"`
|
||||
SignedCertificateTimestampListProcessingTime float64 `perfdata:"Signed Certificate Timestamp List processing time (ms)"`
|
||||
SignedCertificateTimestampListsPerSecond float64 `perfdata:"Signed Certificate Timestamp Lists/sec"`
|
||||
}
|
||||
@@ -1,18 +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.
|
||||
|
||||
//go:build windows
|
||||
|
||||
package adfs
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"maps"
|
||||
"math"
|
||||
"slices"
|
||||
|
||||
"github.com/alecthomas/kingpin/v2"
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/perfdata"
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
@@ -21,12 +33,14 @@ const Name = "adfs"
|
||||
|
||||
type Config struct{}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var ConfigDefaults = Config{}
|
||||
|
||||
type Collector struct {
|
||||
config Config
|
||||
|
||||
perfDataCollector *perfdata.Collector
|
||||
perfDataCollector *pdh.Collector
|
||||
perfDataObject []perfDataCounterValues
|
||||
|
||||
adLoginConnectionFailures *prometheus.Desc
|
||||
artifactDBFailures *prometheus.Desc
|
||||
@@ -99,58 +113,7 @@ func (c *Collector) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||
var err error
|
||||
|
||||
c.perfDataCollector, err = perfdata.NewCollector("AD FS", perfdata.InstanceAll, []string{
|
||||
adLoginConnectionFailures,
|
||||
certificateAuthentications,
|
||||
deviceAuthentications,
|
||||
extranetAccountLockouts,
|
||||
federatedAuthentications,
|
||||
passportAuthentications,
|
||||
passiveRequests,
|
||||
passwordChangeFailed,
|
||||
passwordChangeSucceeded,
|
||||
tokenRequests,
|
||||
windowsIntegratedAuthentications,
|
||||
oAuthAuthZRequests,
|
||||
oAuthClientAuthentications,
|
||||
oAuthClientAuthenticationFailures,
|
||||
oAuthClientCredentialRequestFailures,
|
||||
oAuthClientCredentialRequests,
|
||||
oAuthClientPrivateKeyJWTAuthenticationFailures,
|
||||
oAuthClientPrivateKeyJWTAuthentications,
|
||||
oAuthClientBasicAuthenticationFailures,
|
||||
oAuthClientBasicAuthentications,
|
||||
oAuthClientSecretPostAuthenticationFailures,
|
||||
oAuthClientSecretPostAuthentications,
|
||||
oAuthClientWindowsAuthenticationFailures,
|
||||
oAuthClientWindowsAuthentications,
|
||||
oAuthLogonCertRequestFailures,
|
||||
oAuthLogonCertTokenRequests,
|
||||
oAuthPasswordGrantRequestFailures,
|
||||
oAuthPasswordGrantRequests,
|
||||
oAuthTokenRequests,
|
||||
samlPTokenRequests,
|
||||
ssoAuthenticationFailures,
|
||||
ssoAuthentications,
|
||||
wsFedTokenRequests,
|
||||
wsTrustTokenRequests,
|
||||
usernamePasswordAuthenticationFailures,
|
||||
usernamePasswordAuthentications,
|
||||
externalAuthentications,
|
||||
externalAuthNFailures,
|
||||
artifactDBFailures,
|
||||
avgArtifactDBQueryTime,
|
||||
configDBFailures,
|
||||
avgConfigDBQueryTime,
|
||||
federationMetadataRequests,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create AD FS collector: %w", err)
|
||||
}
|
||||
|
||||
func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
||||
c.adLoginConnectionFailures = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "ad_login_connection_failures_total"),
|
||||
"Total number of connection failures to an Active Directory domain controller",
|
||||
@@ -410,283 +373,280 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||
nil,
|
||||
)
|
||||
|
||||
var err error
|
||||
|
||||
c.perfDataCollector, err = pdh.NewCollector[perfDataCounterValues](logger.With(slog.String("collector", Name)), pdh.CounterTypeRaw, "AD FS", nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create AD FS collector: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
data, err := c.perfDataCollector.Collect()
|
||||
err := c.perfDataCollector.Collect(&c.perfDataObject)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to collect ADFS metrics: %w", err)
|
||||
}
|
||||
|
||||
instanceKey := slices.Collect(maps.Keys(data))
|
||||
|
||||
if len(instanceKey) == 0 {
|
||||
return errors.New("perflib query for ADFS returned empty result set")
|
||||
}
|
||||
|
||||
adfsData, ok := data[instanceKey[0]]
|
||||
|
||||
if !ok {
|
||||
return errors.New("perflib query for ADFS returned empty result set")
|
||||
} else if len(c.perfDataObject) == 0 {
|
||||
return fmt.Errorf("failed to collect ADFS metrics: %w", types.ErrNoDataUnexpected)
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.adLoginConnectionFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[adLoginConnectionFailures].FirstValue,
|
||||
c.perfDataObject[0].AdLoginConnectionFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.certificateAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[certificateAuthentications].FirstValue,
|
||||
c.perfDataObject[0].CertificateAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.deviceAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[deviceAuthentications].FirstValue,
|
||||
c.perfDataObject[0].DeviceAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.extranetAccountLockouts,
|
||||
prometheus.CounterValue,
|
||||
adfsData[extranetAccountLockouts].FirstValue,
|
||||
c.perfDataObject[0].ExtranetAccountLockouts,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.federatedAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[federatedAuthentications].FirstValue,
|
||||
c.perfDataObject[0].FederatedAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.passportAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[passportAuthentications].FirstValue,
|
||||
c.perfDataObject[0].PassportAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.passiveRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[passiveRequests].FirstValue,
|
||||
c.perfDataObject[0].PassiveRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.passwordChangeFailed,
|
||||
prometheus.CounterValue,
|
||||
adfsData[passwordChangeFailed].FirstValue,
|
||||
c.perfDataObject[0].PasswordChangeFailed,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.passwordChangeSucceeded,
|
||||
prometheus.CounterValue,
|
||||
adfsData[passwordChangeSucceeded].FirstValue,
|
||||
c.perfDataObject[0].PasswordChangeSucceeded,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.tokenRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[tokenRequests].FirstValue,
|
||||
c.perfDataObject[0].TokenRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.windowsIntegratedAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[windowsIntegratedAuthentications].FirstValue,
|
||||
c.perfDataObject[0].WindowsIntegratedAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthAuthZRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthAuthZRequests].FirstValue,
|
||||
c.perfDataObject[0].OAuthAuthZRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientAuthentications].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientAuthenticationsFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientAuthenticationFailures].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientAuthenticationFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientCredentialsRequestFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientCredentialRequestFailures].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientCredentialRequestFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientCredentialsRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientCredentialRequests].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientCredentialRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientPrivateKeyJwtAuthenticationFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientPrivateKeyJWTAuthenticationFailures].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientPrivateKeyJWTAuthenticationFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientPrivateKeyJwtAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientPrivateKeyJWTAuthentications].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientPrivateKeyJWTAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientSecretBasicAuthenticationFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientBasicAuthenticationFailures].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientBasicAuthenticationFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientSecretBasicAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientBasicAuthentications].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientBasicAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientSecretPostAuthenticationFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientSecretPostAuthenticationFailures].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientSecretPostAuthenticationFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientSecretPostAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientSecretPostAuthentications].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientSecretPostAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientWindowsIntegratedAuthenticationFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientWindowsAuthenticationFailures].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientWindowsAuthenticationFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthClientWindowsIntegratedAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthClientWindowsAuthentications].FirstValue,
|
||||
c.perfDataObject[0].OAuthClientWindowsAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthLogonCertificateRequestFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthLogonCertRequestFailures].FirstValue,
|
||||
c.perfDataObject[0].OAuthLogonCertRequestFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthLogonCertificateTokenRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthLogonCertTokenRequests].FirstValue,
|
||||
c.perfDataObject[0].OAuthLogonCertTokenRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthPasswordGrantRequestFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthPasswordGrantRequestFailures].FirstValue,
|
||||
c.perfDataObject[0].OAuthPasswordGrantRequestFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthPasswordGrantRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthPasswordGrantRequests].FirstValue,
|
||||
c.perfDataObject[0].OAuthPasswordGrantRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.oAuthTokenRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[oAuthTokenRequests].FirstValue,
|
||||
c.perfDataObject[0].OAuthTokenRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.samlPTokenRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[samlPTokenRequests].FirstValue,
|
||||
c.perfDataObject[0].SamlPTokenRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ssoAuthenticationFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[ssoAuthenticationFailures].FirstValue,
|
||||
c.perfDataObject[0].SsoAuthenticationFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ssoAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[ssoAuthentications].FirstValue,
|
||||
c.perfDataObject[0].SsoAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.wsFedTokenRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[wsFedTokenRequests].FirstValue,
|
||||
c.perfDataObject[0].WsFedTokenRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.wsTrustTokenRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[wsTrustTokenRequests].FirstValue,
|
||||
c.perfDataObject[0].WsTrustTokenRequests,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.upAuthenticationFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[usernamePasswordAuthenticationFailures].FirstValue,
|
||||
c.perfDataObject[0].UsernamePasswordAuthenticationFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.upAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[usernamePasswordAuthentications].FirstValue,
|
||||
c.perfDataObject[0].UsernamePasswordAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.externalAuthenticationFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[externalAuthNFailures].FirstValue,
|
||||
c.perfDataObject[0].ExternalAuthNFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.externalAuthentications,
|
||||
prometheus.CounterValue,
|
||||
adfsData[externalAuthentications].FirstValue,
|
||||
c.perfDataObject[0].ExternalAuthentications,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.artifactDBFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[artifactDBFailures].FirstValue,
|
||||
c.perfDataObject[0].ArtifactDBFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.avgArtifactDBQueryTime,
|
||||
prometheus.CounterValue,
|
||||
adfsData[avgArtifactDBQueryTime].FirstValue*math.Pow(10, -8),
|
||||
c.perfDataObject[0].AvgArtifactDBQueryTime*math.Pow(10, -8),
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.configDBFailures,
|
||||
prometheus.CounterValue,
|
||||
adfsData[configDBFailures].FirstValue,
|
||||
c.perfDataObject[0].ConfigDBFailures,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.avgConfigDBQueryTime,
|
||||
prometheus.CounterValue,
|
||||
adfsData[avgConfigDBQueryTime].FirstValue*math.Pow(10, -8),
|
||||
c.perfDataObject[0].AvgConfigDBQueryTime*math.Pow(10, -8),
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.federationMetadataRequests,
|
||||
prometheus.CounterValue,
|
||||
adfsData[federationMetadataRequests].FirstValue,
|
||||
c.perfDataObject[0].FederationMetadataRequests,
|
||||
)
|
||||
|
||||
return nil
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// 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 adfs_test
|
||||
@@ -12,3 +27,7 @@ import (
|
||||
func BenchmarkCollector(b *testing.B) {
|
||||
testutils.FuncBenchmarkCollector(b, adfs.Name, adfs.NewWithFlags)
|
||||
}
|
||||
|
||||
func TestCollector(t *testing.T) {
|
||||
testutils.TestCollector(t, adfs.New, nil)
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
//go:build windows
|
||||
|
||||
package adfs
|
||||
|
||||
const (
|
||||
adLoginConnectionFailures = "AD Login Connection Failures"
|
||||
artifactDBFailures = "Artifact Database Connection Failures"
|
||||
avgArtifactDBQueryTime = "Average Artifact Database Query Time"
|
||||
avgConfigDBQueryTime = "Average Config Database Query Time"
|
||||
certificateAuthentications = "Certificate Authentications"
|
||||
configDBFailures = "Configuration Database Connection Failures"
|
||||
deviceAuthentications = "Device Authentications"
|
||||
externalAuthentications = "External Authentications"
|
||||
externalAuthNFailures = "External Authentication Failures"
|
||||
extranetAccountLockouts = "Extranet Account Lockouts"
|
||||
federatedAuthentications = "Federated Authentications"
|
||||
federationMetadataRequests = "Federation Metadata Requests"
|
||||
oAuthAuthZRequests = "OAuth AuthZ Requests"
|
||||
oAuthClientAuthenticationFailures = "OAuth Client Authentications Failures"
|
||||
oAuthClientAuthentications = "OAuth Client Authentications"
|
||||
oAuthClientBasicAuthenticationFailures = "OAuth Client Secret Basic Authentication Failures"
|
||||
oAuthClientBasicAuthentications = "OAuth Client Secret Basic Authentication Requests"
|
||||
oAuthClientCredentialRequestFailures = "OAuth Client Credentials Request Failures"
|
||||
oAuthClientCredentialRequests = "OAuth Client Credentials Requests"
|
||||
oAuthClientPrivateKeyJWTAuthenticationFailures = "OAuth Client Private Key Jwt Authentication Failures"
|
||||
oAuthClientPrivateKeyJWTAuthentications = "OAuth Client Private Key Jwt Authentications"
|
||||
oAuthClientSecretPostAuthenticationFailures = "OAuth Client Secret Post Authentication Failures"
|
||||
oAuthClientSecretPostAuthentications = "OAuth Client Secret Post Authentications"
|
||||
oAuthClientWindowsAuthenticationFailures = "OAuth Client Windows Integrated Authentication Failures"
|
||||
oAuthClientWindowsAuthentications = "OAuth Client Windows Integrated Authentications"
|
||||
oAuthLogonCertRequestFailures = "OAuth Logon Certificate Request Failures"
|
||||
oAuthLogonCertTokenRequests = "OAuth Logon Certificate Token Requests"
|
||||
oAuthPasswordGrantRequestFailures = "OAuth Password Grant Request Failures"
|
||||
oAuthPasswordGrantRequests = "OAuth Password Grant Requests"
|
||||
oAuthTokenRequests = "OAuth Token Requests"
|
||||
passiveRequests = "Passive Requests"
|
||||
passportAuthentications = "Microsoft Passport Authentications"
|
||||
passwordChangeFailed = "Password Change Failed Requests"
|
||||
passwordChangeSucceeded = "Password Change Successful Requests"
|
||||
samlPTokenRequests = "SAML-P Token Requests"
|
||||
ssoAuthenticationFailures = "SSO Authentication Failures"
|
||||
ssoAuthentications = "SSO Authentications"
|
||||
tokenRequests = "Token Requests"
|
||||
usernamePasswordAuthenticationFailures = "U/P Authentication Failures"
|
||||
usernamePasswordAuthentications = "U/P Authentications"
|
||||
windowsIntegratedAuthentications = "Windows Integrated Authentications"
|
||||
wsFedTokenRequests = "WS-Fed Token Requests"
|
||||
wsTrustTokenRequests = "WS-Trust Token Requests"
|
||||
)
|
||||
64
internal/collector/adfs/types.go
Normal file
64
internal/collector/adfs/types.go
Normal file
@@ -0,0 +1,64 @@
|
||||
// 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 adfs
|
||||
|
||||
type perfDataCounterValues struct {
|
||||
AdLoginConnectionFailures float64 `perfdata:"AD Login Connection Failures"`
|
||||
ArtifactDBFailures float64 `perfdata:"Artifact Database Connection Failures"`
|
||||
AvgArtifactDBQueryTime float64 `perfdata:"Average Artifact Database Query Time"`
|
||||
AvgConfigDBQueryTime float64 `perfdata:"Average Config Database Query Time"`
|
||||
CertificateAuthentications float64 `perfdata:"Certificate Authentications"`
|
||||
ConfigDBFailures float64 `perfdata:"Configuration Database Connection Failures"`
|
||||
DeviceAuthentications float64 `perfdata:"Device Authentications"`
|
||||
ExternalAuthentications float64 `perfdata:"External Authentications"`
|
||||
ExternalAuthNFailures float64 `perfdata:"External Authentication Failures"`
|
||||
ExtranetAccountLockouts float64 `perfdata:"Extranet Account Lockouts"`
|
||||
FederatedAuthentications float64 `perfdata:"Federated Authentications"`
|
||||
FederationMetadataRequests float64 `perfdata:"Federation Metadata Requests"`
|
||||
OAuthAuthZRequests float64 `perfdata:"OAuth AuthZ Requests"`
|
||||
OAuthClientAuthenticationFailures float64 `perfdata:"OAuth Client Authentications Failures"`
|
||||
OAuthClientAuthentications float64 `perfdata:"OAuth Client Authentications"`
|
||||
OAuthClientBasicAuthenticationFailures float64 `perfdata:"OAuth Client Secret Basic Authentication Failures"`
|
||||
OAuthClientBasicAuthentications float64 `perfdata:"OAuth Client Secret Basic Authentications"`
|
||||
OAuthClientCredentialRequestFailures float64 `perfdata:"OAuth Client Credentials Request Failures"`
|
||||
OAuthClientCredentialRequests float64 `perfdata:"OAuth Client Credentials Requests"`
|
||||
OAuthClientPrivateKeyJWTAuthenticationFailures float64 `perfdata:"OAuth Client Private Key Jwt Authentication Failures"`
|
||||
OAuthClientPrivateKeyJWTAuthentications float64 `perfdata:"OAuth Client Private Key Jwt Authentications"`
|
||||
OAuthClientSecretPostAuthenticationFailures float64 `perfdata:"OAuth Client Secret Post Authentication Failures"`
|
||||
OAuthClientSecretPostAuthentications float64 `perfdata:"OAuth Client Secret Post Authentications"`
|
||||
OAuthClientWindowsAuthenticationFailures float64 `perfdata:"OAuth Client Windows Integrated Authentication Failures"`
|
||||
OAuthClientWindowsAuthentications float64 `perfdata:"OAuth Client Windows Integrated Authentications"`
|
||||
OAuthLogonCertRequestFailures float64 `perfdata:"OAuth Logon Certificate Request Failures"`
|
||||
OAuthLogonCertTokenRequests float64 `perfdata:"OAuth Logon Certificate Token Requests"`
|
||||
OAuthPasswordGrantRequestFailures float64 `perfdata:"OAuth Password Grant Request Failures"`
|
||||
OAuthPasswordGrantRequests float64 `perfdata:"OAuth Password Grant Requests"`
|
||||
OAuthTokenRequests float64 `perfdata:"OAuth Token Requests"`
|
||||
PassiveRequests float64 `perfdata:"Passive Requests"`
|
||||
PassportAuthentications float64 `perfdata:"Microsoft Passport Authentications"`
|
||||
PasswordChangeFailed float64 `perfdata:"Password Change Failed Requests"`
|
||||
PasswordChangeSucceeded float64 `perfdata:"Password Change Successful Requests"`
|
||||
SamlPTokenRequests float64 `perfdata:"SAML-P Token Requests"`
|
||||
SsoAuthenticationFailures float64 `perfdata:"SSO Authentication Failures"`
|
||||
SsoAuthentications float64 `perfdata:"SSO Authentications"`
|
||||
TokenRequests float64 `perfdata:"Token Requests"`
|
||||
UsernamePasswordAuthenticationFailures float64 `perfdata:"U/P Authentication Failures"`
|
||||
UsernamePasswordAuthentications float64 `perfdata:"U/P Authentications"`
|
||||
WindowsIntegratedAuthentications float64 `perfdata:"Windows Integrated Authentications"`
|
||||
WsFedTokenRequests float64 `perfdata:"WS-Fed Token Requests"`
|
||||
WsTrustTokenRequests float64 `perfdata:"WS-Trust Token Requests"`
|
||||
}
|
||||
136
internal/collector/cache/cache.go
vendored
136
internal/collector/cache/cache.go
vendored
@@ -1,15 +1,29 @@
|
||||
// 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 cache
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/alecthomas/kingpin/v2"
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/perfdata"
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
@@ -18,13 +32,15 @@ const Name = "cache"
|
||||
|
||||
type Config struct{}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var ConfigDefaults = Config{}
|
||||
|
||||
// A Collector is a Prometheus Collector for Perflib Cache metrics.
|
||||
type Collector struct {
|
||||
config Config
|
||||
|
||||
perfDataCollector *perfdata.Collector
|
||||
perfDataCollector *pdh.Collector
|
||||
perfDataObject []perfDataCounterValues
|
||||
|
||||
asyncCopyReadsTotal *prometheus.Desc
|
||||
asyncDataMapsTotal *prometheus.Desc
|
||||
@@ -83,44 +99,7 @@ func (c *Collector) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||
var err error
|
||||
|
||||
c.perfDataCollector, err = perfdata.NewCollector("Cache", perfdata.InstanceAll, []string{
|
||||
asyncCopyReadsTotal,
|
||||
asyncDataMapsTotal,
|
||||
asyncFastReadsTotal,
|
||||
asyncMDLReadsTotal,
|
||||
asyncPinReadsTotal,
|
||||
copyReadHitsTotal,
|
||||
copyReadsTotal,
|
||||
dataFlushesTotal,
|
||||
dataFlushPagesTotal,
|
||||
dataMapHitsPercent,
|
||||
dataMapPinsTotal,
|
||||
dataMapsTotal,
|
||||
dirtyPages,
|
||||
dirtyPageThreshold,
|
||||
fastReadNotPossiblesTotal,
|
||||
fastReadResourceMissesTotal,
|
||||
fastReadsTotal,
|
||||
lazyWriteFlushesTotal,
|
||||
lazyWritePagesTotal,
|
||||
mdlReadHitsTotal,
|
||||
mdlReadsTotal,
|
||||
pinReadHitsTotal,
|
||||
pinReadsTotal,
|
||||
readAheadsTotal,
|
||||
syncCopyReadsTotal,
|
||||
syncDataMapsTotal,
|
||||
syncFastReadsTotal,
|
||||
syncMDLReadsTotal,
|
||||
syncPinReadsTotal,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create Cache collector: %w", err)
|
||||
}
|
||||
|
||||
func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
||||
c.asyncCopyReadsTotal = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "async_copy_reads_total"),
|
||||
"(AsyncCopyReadsTotal)",
|
||||
@@ -296,194 +275,197 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||
nil,
|
||||
)
|
||||
|
||||
var err error
|
||||
|
||||
c.perfDataCollector, err = pdh.NewCollector[perfDataCounterValues](logger.With(slog.String("collector", Name)), pdh.CounterTypeRaw, "Cache", pdh.InstancesAll)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create Cache collector: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Collect implements the Collector interface.
|
||||
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
data, err := c.perfDataCollector.Collect()
|
||||
err := c.perfDataCollector.Collect(&c.perfDataObject)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to collect Cache metrics: %w", err)
|
||||
}
|
||||
|
||||
cacheData, ok := data[perfdata.EmptyInstance]
|
||||
|
||||
if !ok {
|
||||
return errors.New("perflib query for Cache returned empty result set")
|
||||
} else if len(c.perfDataObject) == 0 {
|
||||
return fmt.Errorf("failed to collect Cache metrics: %w", types.ErrNoDataUnexpected)
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.asyncCopyReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[asyncCopyReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].AsyncCopyReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.asyncDataMapsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[asyncDataMapsTotal].FirstValue,
|
||||
c.perfDataObject[0].AsyncDataMapsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.asyncFastReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[asyncFastReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].AsyncFastReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.asyncMDLReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[asyncMDLReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].AsyncMDLReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.asyncPinReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[asyncPinReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].AsyncPinReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.copyReadHitsTotal,
|
||||
prometheus.GaugeValue,
|
||||
cacheData[copyReadHitsTotal].FirstValue,
|
||||
c.perfDataObject[0].CopyReadHitsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.copyReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[copyReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].CopyReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.dataFlushesTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[dataFlushesTotal].FirstValue,
|
||||
c.perfDataObject[0].DataFlushesTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.dataFlushPagesTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[dataFlushPagesTotal].FirstValue,
|
||||
c.perfDataObject[0].DataFlushPagesTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.dataMapHitsPercent,
|
||||
prometheus.GaugeValue,
|
||||
cacheData[dataMapHitsPercent].FirstValue,
|
||||
c.perfDataObject[0].DataMapHitsPercent,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.dataMapPinsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[dataMapPinsTotal].FirstValue,
|
||||
c.perfDataObject[0].DataMapPinsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.dataMapsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[dataMapsTotal].FirstValue,
|
||||
c.perfDataObject[0].DataMapsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.dirtyPages,
|
||||
prometheus.GaugeValue,
|
||||
cacheData[dirtyPages].FirstValue,
|
||||
c.perfDataObject[0].DirtyPages,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.dirtyPageThreshold,
|
||||
prometheus.GaugeValue,
|
||||
cacheData[dirtyPageThreshold].FirstValue,
|
||||
c.perfDataObject[0].DirtyPageThreshold,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.fastReadNotPossiblesTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[fastReadNotPossiblesTotal].FirstValue,
|
||||
c.perfDataObject[0].FastReadNotPossiblesTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.fastReadResourceMissesTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[fastReadResourceMissesTotal].FirstValue,
|
||||
c.perfDataObject[0].FastReadResourceMissesTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.fastReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[fastReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].FastReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.lazyWriteFlushesTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[lazyWriteFlushesTotal].FirstValue,
|
||||
c.perfDataObject[0].LazyWriteFlushesTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.lazyWritePagesTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[lazyWritePagesTotal].FirstValue,
|
||||
c.perfDataObject[0].LazyWritePagesTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.mdlReadHitsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[mdlReadHitsTotal].FirstValue,
|
||||
c.perfDataObject[0].MdlReadHitsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.mdlReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[mdlReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].MdlReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.pinReadHitsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[pinReadHitsTotal].FirstValue,
|
||||
c.perfDataObject[0].PinReadHitsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.pinReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[pinReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].PinReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.readAheadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[readAheadsTotal].FirstValue,
|
||||
c.perfDataObject[0].ReadAheadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.syncCopyReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[syncCopyReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].SyncCopyReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.syncDataMapsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[syncDataMapsTotal].FirstValue,
|
||||
c.perfDataObject[0].SyncDataMapsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.syncFastReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[syncFastReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].SyncFastReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.syncMDLReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[syncMDLReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].SyncMDLReadsTotal,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.syncPinReadsTotal,
|
||||
prometheus.CounterValue,
|
||||
cacheData[syncPinReadsTotal].FirstValue,
|
||||
c.perfDataObject[0].SyncPinReadsTotal,
|
||||
)
|
||||
|
||||
return nil
|
||||
|
||||
19
internal/collector/cache/cache_test.go
vendored
19
internal/collector/cache/cache_test.go
vendored
@@ -1,3 +1,18 @@
|
||||
// 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 cache_test
|
||||
@@ -12,3 +27,7 @@ import (
|
||||
func BenchmarkCollector(b *testing.B) {
|
||||
testutils.FuncBenchmarkCollector(b, cache.Name, cache.NewWithFlags)
|
||||
}
|
||||
|
||||
func TestCollector(t *testing.T) {
|
||||
testutils.TestCollector(t, cache.New, nil)
|
||||
}
|
||||
|
||||
37
internal/collector/cache/const.go
vendored
37
internal/collector/cache/const.go
vendored
@@ -1,37 +0,0 @@
|
||||
//go:build windows
|
||||
|
||||
package cache
|
||||
|
||||
// Perflib "Cache":
|
||||
// - https://docs.microsoft.com/en-us/previous-versions/aa394267(v=vs.85)
|
||||
const (
|
||||
asyncCopyReadsTotal = "Async Copy Reads/sec"
|
||||
asyncDataMapsTotal = "Async Data Maps/sec"
|
||||
asyncFastReadsTotal = "Async Fast Reads/sec"
|
||||
asyncMDLReadsTotal = "Async MDL Reads/sec"
|
||||
asyncPinReadsTotal = "Async Pin Reads/sec"
|
||||
copyReadHitsTotal = "Copy Read Hits %"
|
||||
copyReadsTotal = "Copy Reads/sec"
|
||||
dataFlushesTotal = "Data Flushes/sec"
|
||||
dataFlushPagesTotal = "Data Flush Pages/sec"
|
||||
dataMapHitsPercent = "Data Map Hits %"
|
||||
dataMapPinsTotal = "Data Map Pins/sec"
|
||||
dataMapsTotal = "Data Maps/sec"
|
||||
dirtyPages = "Dirty Pages"
|
||||
dirtyPageThreshold = "Dirty Page Threshold"
|
||||
fastReadNotPossiblesTotal = "Fast Read Not Possibles/sec"
|
||||
fastReadResourceMissesTotal = "Fast Read Resource Misses/sec"
|
||||
fastReadsTotal = "Fast Reads/sec"
|
||||
lazyWriteFlushesTotal = "Lazy Write Flushes/sec"
|
||||
lazyWritePagesTotal = "Lazy Write Pages/sec"
|
||||
mdlReadHitsTotal = "MDL Read Hits %"
|
||||
mdlReadsTotal = "MDL Reads/sec"
|
||||
pinReadHitsTotal = "Pin Read Hits %"
|
||||
pinReadsTotal = "Pin Reads/sec"
|
||||
readAheadsTotal = "Read Aheads/sec"
|
||||
syncCopyReadsTotal = "Sync Copy Reads/sec"
|
||||
syncDataMapsTotal = "Sync Data Maps/sec"
|
||||
syncFastReadsTotal = "Sync Fast Reads/sec"
|
||||
syncMDLReadsTotal = "Sync MDL Reads/sec"
|
||||
syncPinReadsTotal = "Sync Pin Reads/sec"
|
||||
)
|
||||
52
internal/collector/cache/types.go
vendored
Normal file
52
internal/collector/cache/types.go
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
// 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 cache
|
||||
|
||||
// Perflib "Cache":
|
||||
// - https://docs.microsoft.com/en-us/previous-versions/aa394267(v=vs.85)
|
||||
type perfDataCounterValues struct {
|
||||
AsyncCopyReadsTotal float64 `perfdata:"Async Copy Reads/sec"`
|
||||
AsyncDataMapsTotal float64 `perfdata:"Async Data Maps/sec"`
|
||||
AsyncFastReadsTotal float64 `perfdata:"Async Fast Reads/sec"`
|
||||
AsyncMDLReadsTotal float64 `perfdata:"Async MDL Reads/sec"`
|
||||
AsyncPinReadsTotal float64 `perfdata:"Async Pin Reads/sec"`
|
||||
CopyReadHitsTotal float64 `perfdata:"Copy Read Hits %"`
|
||||
CopyReadsTotal float64 `perfdata:"Copy Reads/sec"`
|
||||
DataFlushesTotal float64 `perfdata:"Data Flushes/sec"`
|
||||
DataFlushPagesTotal float64 `perfdata:"Data Flush Pages/sec"`
|
||||
DataMapHitsPercent float64 `perfdata:"Data Map Hits %"`
|
||||
DataMapPinsTotal float64 `perfdata:"Data Map Pins/sec"`
|
||||
DataMapsTotal float64 `perfdata:"Data Maps/sec"`
|
||||
DirtyPages float64 `perfdata:"Dirty Pages"`
|
||||
DirtyPageThreshold float64 `perfdata:"Dirty Page Threshold"`
|
||||
FastReadNotPossiblesTotal float64 `perfdata:"Fast Read Not Possibles/sec"`
|
||||
FastReadResourceMissesTotal float64 `perfdata:"Fast Read Resource Misses/sec"`
|
||||
FastReadsTotal float64 `perfdata:"Fast Reads/sec"`
|
||||
LazyWriteFlushesTotal float64 `perfdata:"Lazy Write Flushes/sec"`
|
||||
LazyWritePagesTotal float64 `perfdata:"Lazy Write Pages/sec"`
|
||||
MdlReadHitsTotal float64 `perfdata:"MDL Read Hits %"`
|
||||
MdlReadsTotal float64 `perfdata:"MDL Reads/sec"`
|
||||
PinReadHitsTotal float64 `perfdata:"Pin Read Hits %"`
|
||||
PinReadsTotal float64 `perfdata:"Pin Reads/sec"`
|
||||
ReadAheadsTotal float64 `perfdata:"Read Aheads/sec"`
|
||||
SyncCopyReadsTotal float64 `perfdata:"Sync Copy Reads/sec"`
|
||||
SyncDataMapsTotal float64 `perfdata:"Sync Data Maps/sec"`
|
||||
SyncFastReadsTotal float64 `perfdata:"Sync Fast Reads/sec"`
|
||||
SyncMDLReadsTotal float64 `perfdata:"Sync MDL Reads/sec"`
|
||||
SyncPinReadsTotal float64 `perfdata:"Sync Pin Reads/sec"`
|
||||
}
|
||||
@@ -1,26 +1,66 @@
|
||||
// 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 container
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"log/slog"
|
||||
"os"
|
||||
"slices"
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"github.com/Microsoft/hcsshim"
|
||||
"github.com/alecthomas/kingpin/v2"
|
||||
"github.com/prometheus-community/windows_exporter/internal/headers/hcn"
|
||||
"github.com/prometheus-community/windows_exporter/internal/headers/hcs"
|
||||
"github.com/prometheus-community/windows_exporter/internal/headers/kernel32"
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/perfdata"
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
const Name = "container"
|
||||
const (
|
||||
Name = "container"
|
||||
|
||||
type Config struct{}
|
||||
subCollectorHCS = "hcs"
|
||||
subCollectorHostprocess = "hostprocess"
|
||||
|
||||
var ConfigDefaults = Config{}
|
||||
JobObjectMemoryUsageInformation = 28
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
CollectorsEnabled []string `yaml:"enabled"`
|
||||
ContainerDStateDir string `yaml:"containerd-state-dir"`
|
||||
}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var ConfigDefaults = Config{
|
||||
CollectorsEnabled: []string{
|
||||
subCollectorHCS,
|
||||
subCollectorHostprocess,
|
||||
},
|
||||
ContainerDStateDir: `C:\ProgramData\containerd\state\io.containerd.runtime.v2.task\k8s.io\`,
|
||||
}
|
||||
|
||||
// A Collector is a Prometheus Collector for containers metrics.
|
||||
type Collector struct {
|
||||
@@ -28,6 +68,9 @@ type Collector struct {
|
||||
|
||||
logger *slog.Logger
|
||||
|
||||
annotationsCacheHCS map[string]containerInfo
|
||||
annotationsCacheJob map[string]containerInfo
|
||||
|
||||
// Presence
|
||||
containerAvailable *prometheus.Desc
|
||||
|
||||
@@ -59,12 +102,27 @@ type Collector struct {
|
||||
writeSizeBytes *prometheus.Desc
|
||||
}
|
||||
|
||||
type containerInfo struct {
|
||||
id string
|
||||
namespace string
|
||||
pod string
|
||||
container string
|
||||
}
|
||||
|
||||
type ociSpec struct {
|
||||
Annotations map[string]string `json:"annotations"`
|
||||
}
|
||||
|
||||
// New constructs a new Collector.
|
||||
func New(config *Config) *Collector {
|
||||
if config == nil {
|
||||
config = &ConfigDefaults
|
||||
}
|
||||
|
||||
if config.CollectorsEnabled == nil {
|
||||
config.CollectorsEnabled = ConfigDefaults.CollectorsEnabled
|
||||
}
|
||||
|
||||
c := &Collector{
|
||||
config: *config,
|
||||
}
|
||||
@@ -72,8 +130,31 @@ func New(config *Config) *Collector {
|
||||
return c
|
||||
}
|
||||
|
||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
||||
return &Collector{}
|
||||
func NewWithFlags(app *kingpin.Application) *Collector {
|
||||
c := &Collector{
|
||||
config: ConfigDefaults,
|
||||
}
|
||||
c.config.CollectorsEnabled = make([]string, 0)
|
||||
|
||||
var collectorsEnabled string
|
||||
|
||||
app.Flag(
|
||||
"collector.container.enabled",
|
||||
"Comma-separated list of collectors to use. Defaults to all, if not specified.",
|
||||
).Default(strings.Join(ConfigDefaults.CollectorsEnabled, ",")).StringVar(&collectorsEnabled)
|
||||
|
||||
app.Flag(
|
||||
"collector.container.containerd-state-dir",
|
||||
"Path to the containerd state directory. Defaults to C:\\ProgramData\\containerd\\state\\io.containerd.runtime.v2.task\\k8s.io\\",
|
||||
).Default(ConfigDefaults.ContainerDStateDir).StringVar(&c.config.ContainerDStateDir)
|
||||
|
||||
app.Action(func(*kingpin.ParseContext) error {
|
||||
c.config.CollectorsEnabled = strings.Split(collectorsEnabled, ",")
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Collector) GetName() string {
|
||||
@@ -87,10 +168,19 @@ func (c *Collector) Close() error {
|
||||
func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
||||
c.logger = logger.With(slog.String("collector", Name))
|
||||
|
||||
for _, collector := range c.config.CollectorsEnabled {
|
||||
if !slices.Contains([]string{subCollectorHCS, subCollectorHostprocess}, collector) {
|
||||
return fmt.Errorf("unknown collector: %s", collector)
|
||||
}
|
||||
}
|
||||
|
||||
c.annotationsCacheHCS = make(map[string]containerInfo)
|
||||
c.annotationsCacheJob = make(map[string]containerInfo)
|
||||
|
||||
c.containerAvailable = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "available"),
|
||||
"Available",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container", "hostprocess"},
|
||||
nil,
|
||||
)
|
||||
c.containersCount = prometheus.NewDesc(
|
||||
@@ -102,97 +192,97 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
||||
c.usageCommitBytes = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "memory_usage_commit_bytes"),
|
||||
"Memory Usage Commit Bytes",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.usageCommitPeakBytes = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "memory_usage_commit_peak_bytes"),
|
||||
"Memory Usage Commit Peak Bytes",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.usagePrivateWorkingSetBytes = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "memory_usage_private_working_set_bytes"),
|
||||
"Memory Usage Private Working Set Bytes",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.runtimeTotal = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "cpu_usage_seconds_total"),
|
||||
"Total Run time in Seconds",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.runtimeUser = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "cpu_usage_seconds_usermode"),
|
||||
"Run Time in User mode in Seconds",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.runtimeKernel = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "cpu_usage_seconds_kernelmode"),
|
||||
"Run time in Kernel mode in Seconds",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.bytesReceived = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "network_receive_bytes_total"),
|
||||
"Bytes Received on Interface",
|
||||
[]string{"container_id", "interface"},
|
||||
[]string{"container_id", "namespace", "pod", "container", "interface"},
|
||||
nil,
|
||||
)
|
||||
c.bytesSent = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "network_transmit_bytes_total"),
|
||||
"Bytes Sent on Interface",
|
||||
[]string{"container_id", "interface"},
|
||||
[]string{"container_id", "namespace", "pod", "container", "interface"},
|
||||
nil,
|
||||
)
|
||||
c.packetsReceived = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "network_receive_packets_total"),
|
||||
"Packets Received on Interface",
|
||||
[]string{"container_id", "interface"},
|
||||
[]string{"container_id", "namespace", "pod", "container", "interface"},
|
||||
nil,
|
||||
)
|
||||
c.packetsSent = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "network_transmit_packets_total"),
|
||||
"Packets Sent on Interface",
|
||||
[]string{"container_id", "interface"},
|
||||
[]string{"container_id", "namespace", "pod", "container", "interface"},
|
||||
nil,
|
||||
)
|
||||
c.droppedPacketsIncoming = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "network_receive_packets_dropped_total"),
|
||||
"Dropped Incoming Packets on Interface",
|
||||
[]string{"container_id", "interface"},
|
||||
[]string{"container_id", "namespace", "pod", "container", "interface"},
|
||||
nil,
|
||||
)
|
||||
c.droppedPacketsOutgoing = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "network_transmit_packets_dropped_total"),
|
||||
"Dropped Outgoing Packets on Interface",
|
||||
[]string{"container_id", "interface"},
|
||||
[]string{"container_id", "namespace", "pod", "container", "interface"},
|
||||
nil,
|
||||
)
|
||||
c.readCountNormalized = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "storage_read_count_normalized_total"),
|
||||
"Read Count Normalized",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.readSizeBytes = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "storage_read_size_bytes_total"),
|
||||
"Read Size Bytes",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.writeCountNormalized = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "storage_write_count_normalized_total"),
|
||||
"Write Count Normalized",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
c.writeSizeBytes = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "storage_write_size_bytes_total"),
|
||||
"Write Size Bytes",
|
||||
[]string{"container_id"},
|
||||
[]string{"container_id", "namespace", "pod", "container"},
|
||||
nil,
|
||||
)
|
||||
|
||||
@@ -202,39 +292,91 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
||||
// Collect sends the metric values for each metric
|
||||
// to the provided prometheus Metric channel.
|
||||
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
errs := make([]error, 0)
|
||||
|
||||
if slices.Contains(c.config.CollectorsEnabled, subCollectorHCS) {
|
||||
if err := c.collectHCS(ch); err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
}
|
||||
|
||||
if slices.Contains(c.config.CollectorsEnabled, subCollectorHostprocess) {
|
||||
if err := c.collectJobContainers(ch); err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
}
|
||||
|
||||
return errors.Join(errs...)
|
||||
}
|
||||
|
||||
func (c *Collector) collectHCS(ch chan<- prometheus.Metric) error {
|
||||
// Types Container is passed to get the containers compute systems only
|
||||
containers, err := hcsshim.GetContainers(hcsshim.ComputeSystemQuery{Types: []string{"Container"}})
|
||||
containers, err := hcs.GetContainers()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error in fetching containers: %w", err)
|
||||
}
|
||||
|
||||
count := len(containers)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.containersCount,
|
||||
prometheus.GaugeValue,
|
||||
float64(count),
|
||||
)
|
||||
|
||||
if count == 0 {
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.containersCount,
|
||||
prometheus.GaugeValue,
|
||||
0,
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
containerPrefixes := make(map[string]string)
|
||||
collectErrors := make([]error, 0, len(containers))
|
||||
var countersCount float64
|
||||
|
||||
for _, containerDetails := range containers {
|
||||
containerIdWithPrefix := getContainerIdWithPrefix(containerDetails)
|
||||
containerIDs := make([]string, 0, len(containers))
|
||||
collectErrors := make([]error, 0)
|
||||
|
||||
if err = c.collectContainer(ch, containerDetails, containerIdWithPrefix); err != nil {
|
||||
if hcsshim.IsNotExist(err) {
|
||||
for _, container := range containers {
|
||||
if container.State != "Running" {
|
||||
continue
|
||||
}
|
||||
|
||||
containerIDs = append(containerIDs, container.ID)
|
||||
|
||||
countersCount++
|
||||
|
||||
var (
|
||||
namespace string
|
||||
podName string
|
||||
containerName string
|
||||
)
|
||||
|
||||
if _, ok := c.annotationsCacheHCS[container.ID]; !ok {
|
||||
if spec, err := c.getContainerAnnotations(container.ID); err == nil {
|
||||
namespace = spec.Annotations["io.kubernetes.cri.sandbox-namespace"]
|
||||
podName = spec.Annotations["io.kubernetes.cri.sandbox-name"]
|
||||
containerName = spec.Annotations["io.kubernetes.cri.container-name"]
|
||||
}
|
||||
|
||||
c.annotationsCacheHCS[container.ID] = containerInfo{
|
||||
id: getContainerIdWithPrefix(container),
|
||||
namespace: namespace,
|
||||
pod: podName,
|
||||
container: containerName,
|
||||
}
|
||||
}
|
||||
|
||||
if err = c.collectHCSContainer(ch, container, c.annotationsCacheHCS[container.ID]); err != nil {
|
||||
if errors.Is(err, hcs.ErrIDNotFound) {
|
||||
c.logger.Debug("err in fetching container statistics",
|
||||
slog.String("container_id", containerDetails.ID),
|
||||
slog.String("container_id", container.ID),
|
||||
slog.String("container_name", c.annotationsCacheHCS[container.ID].container),
|
||||
slog.String("container_pod_name", c.annotationsCacheHCS[container.ID].pod),
|
||||
slog.String("container_namespace", c.annotationsCacheHCS[container.ID].namespace),
|
||||
slog.Any("err", err),
|
||||
)
|
||||
} else {
|
||||
c.logger.Error("err in fetching container statistics",
|
||||
slog.String("container_id", containerDetails.ID),
|
||||
slog.String("container_id", container.ID),
|
||||
slog.String("container_name", c.annotationsCacheHCS[container.ID].container),
|
||||
slog.String("container_pod_name", c.annotationsCacheHCS[container.ID].pod),
|
||||
slog.String("container_namespace", c.annotationsCacheHCS[container.ID].namespace),
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
@@ -243,14 +385,25 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
containerPrefixes[containerDetails.ID] = containerIdWithPrefix
|
||||
}
|
||||
|
||||
if err = c.collectNetworkMetrics(ch, containerPrefixes); err != nil {
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.containersCount,
|
||||
prometheus.GaugeValue,
|
||||
countersCount,
|
||||
)
|
||||
|
||||
if err = c.collectNetworkMetrics(ch); err != nil {
|
||||
return fmt.Errorf("error in fetching container network statistics: %w", err)
|
||||
}
|
||||
|
||||
// Remove containers that are no longer running
|
||||
for _, containerID := range c.annotationsCacheHCS {
|
||||
if !slices.Contains(containerIDs, containerID.id) {
|
||||
delete(c.annotationsCacheHCS, containerID.id)
|
||||
}
|
||||
}
|
||||
|
||||
if len(collectErrors) > 0 {
|
||||
return fmt.Errorf("errors while fetching container statistics: %w", errors.Join(collectErrors...))
|
||||
}
|
||||
@@ -258,117 +411,133 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) collectContainer(ch chan<- prometheus.Metric, containerDetails hcsshim.ContainerProperties, containerIdWithPrefix string) error {
|
||||
container, err := hcsshim.OpenContainer(containerDetails.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error in opening container: %w", err)
|
||||
func (c *Collector) collectHCSContainer(ch chan<- prometheus.Metric, containerDetails hcs.Properties, containerInfo containerInfo) error {
|
||||
// Skip if the container is a pause container
|
||||
if containerInfo.pod != "" && containerInfo.container == "" {
|
||||
c.logger.Debug("skipping pause container",
|
||||
slog.String("container_id", containerDetails.ID),
|
||||
slog.String("container_name", containerInfo.container),
|
||||
slog.String("pod_name", containerInfo.pod),
|
||||
slog.String("namespace", containerInfo.namespace),
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if container == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err := container.Close(); err != nil {
|
||||
c.logger.Error("error in closing container",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
}
|
||||
}()
|
||||
|
||||
containerStats, err := container.Statistics()
|
||||
containerStats, err := hcs.GetContainerStatistics(containerDetails.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error in fetching container statistics: %w", err)
|
||||
return fmt.Errorf("error fetching container statistics: %w", err)
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.containerAvailable,
|
||||
prometheus.CounterValue,
|
||||
prometheus.GaugeValue,
|
||||
1,
|
||||
containerIdWithPrefix,
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, "false",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.usageCommitBytes,
|
||||
prometheus.GaugeValue,
|
||||
float64(containerStats.Memory.UsageCommitBytes),
|
||||
containerIdWithPrefix,
|
||||
float64(containerStats.Memory.MemoryUsageCommitBytes),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.usageCommitPeakBytes,
|
||||
prometheus.GaugeValue,
|
||||
float64(containerStats.Memory.UsageCommitPeakBytes),
|
||||
containerIdWithPrefix,
|
||||
float64(containerStats.Memory.MemoryUsageCommitPeakBytes),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.usagePrivateWorkingSetBytes,
|
||||
prometheus.GaugeValue,
|
||||
float64(containerStats.Memory.UsagePrivateWorkingSetBytes),
|
||||
containerIdWithPrefix,
|
||||
float64(containerStats.Memory.MemoryUsagePrivateWorkingSetBytes),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.runtimeTotal,
|
||||
prometheus.CounterValue,
|
||||
float64(containerStats.Processor.TotalRuntime100ns)*perfdata.TicksToSecondScaleFactor,
|
||||
containerIdWithPrefix,
|
||||
float64(containerStats.Processor.TotalRuntime100ns)*pdh.TicksToSecondScaleFactor,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.runtimeUser,
|
||||
prometheus.CounterValue,
|
||||
float64(containerStats.Processor.RuntimeUser100ns)*perfdata.TicksToSecondScaleFactor,
|
||||
containerIdWithPrefix,
|
||||
float64(containerStats.Processor.RuntimeUser100ns)*pdh.TicksToSecondScaleFactor,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.runtimeKernel,
|
||||
prometheus.CounterValue,
|
||||
float64(containerStats.Processor.RuntimeKernel100ns)*perfdata.TicksToSecondScaleFactor,
|
||||
containerIdWithPrefix,
|
||||
float64(containerStats.Processor.RuntimeKernel100ns)*pdh.TicksToSecondScaleFactor,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.readCountNormalized,
|
||||
prometheus.CounterValue,
|
||||
float64(containerStats.Storage.ReadCountNormalized),
|
||||
containerIdWithPrefix,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.readSizeBytes,
|
||||
prometheus.CounterValue,
|
||||
float64(containerStats.Storage.ReadSizeBytes),
|
||||
containerIdWithPrefix,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.writeCountNormalized,
|
||||
prometheus.CounterValue,
|
||||
float64(containerStats.Storage.WriteCountNormalized),
|
||||
containerIdWithPrefix,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.writeSizeBytes,
|
||||
prometheus.CounterValue,
|
||||
float64(containerStats.Storage.WriteSizeBytes),
|
||||
containerIdWithPrefix,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// collectNetworkMetrics collects network metrics for containers.
|
||||
// With HNSv2, the network stats must be collected from hcsshim.HNSListEndpointRequest.
|
||||
// Network statistics from the container.Statistics() are providing data only, if HNSv1 is used.
|
||||
// Ref: https://github.com/prometheus-community/windows_exporter/pull/1218
|
||||
func (c *Collector) collectNetworkMetrics(ch chan<- prometheus.Metric, containerPrefixes map[string]string) error {
|
||||
hnsEndpoints, err := hcsshim.HNSListEndpointRequest()
|
||||
func (c *Collector) collectNetworkMetrics(ch chan<- prometheus.Metric) error {
|
||||
endpoints, err := hcn.ListEndpoints()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error in fetching HNS endpoints: %w", err)
|
||||
return fmt.Errorf("error in fetching HCN endpoints: %w", err)
|
||||
}
|
||||
|
||||
if len(hnsEndpoints) == 0 {
|
||||
return errors.New("no network stats for containers to collect")
|
||||
if len(endpoints) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, endpoint := range hnsEndpoints {
|
||||
endpointStats, err := hcsshim.GetHNSEndpointStats(endpoint.Id)
|
||||
for _, endpoint := range endpoints {
|
||||
if len(endpoint.SharedContainers) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
endpointStats, err := hcn.GetHNSEndpointStats(endpoint.ID)
|
||||
if err != nil {
|
||||
c.logger.Warn("Failed to collect network stats for interface "+endpoint.Id,
|
||||
c.logger.Warn("Failed to collect network stats for interface "+endpoint.ID,
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
@@ -376,52 +545,61 @@ func (c *Collector) collectNetworkMetrics(ch chan<- prometheus.Metric, container
|
||||
}
|
||||
|
||||
for _, containerId := range endpoint.SharedContainers {
|
||||
containerIdWithPrefix, ok := containerPrefixes[containerId]
|
||||
containerInfo, ok := c.annotationsCacheHCS[containerId]
|
||||
|
||||
if !ok {
|
||||
c.logger.Debug("Failed to collect network stats for container " + containerId)
|
||||
c.logger.Debug("Unknown container " + containerId + " for endpoint " + endpoint.ID)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
endpointId := strings.ToUpper(endpoint.Id)
|
||||
// Skip if the container is a pause container
|
||||
if containerInfo.pod != "" && containerInfo.container == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
endpointId := strings.ToUpper(endpoint.ID)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.bytesReceived,
|
||||
prometheus.CounterValue,
|
||||
float64(endpointStats.BytesReceived),
|
||||
containerIdWithPrefix, endpointId,
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.bytesSent,
|
||||
prometheus.CounterValue,
|
||||
float64(endpointStats.BytesSent),
|
||||
containerIdWithPrefix, endpointId,
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.packetsReceived,
|
||||
prometheus.CounterValue,
|
||||
float64(endpointStats.PacketsReceived),
|
||||
containerIdWithPrefix, endpointId,
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.packetsSent,
|
||||
prometheus.CounterValue,
|
||||
float64(endpointStats.PacketsSent),
|
||||
containerIdWithPrefix, endpointId,
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.droppedPacketsIncoming,
|
||||
prometheus.CounterValue,
|
||||
float64(endpointStats.DroppedPacketsIncoming),
|
||||
containerIdWithPrefix, endpointId,
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.droppedPacketsOutgoing,
|
||||
prometheus.CounterValue,
|
||||
float64(endpointStats.DroppedPacketsOutgoing),
|
||||
containerIdWithPrefix, endpointId,
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, endpointId,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -429,12 +607,317 @@ func (c *Collector) collectNetworkMetrics(ch chan<- prometheus.Metric, container
|
||||
return nil
|
||||
}
|
||||
|
||||
func getContainerIdWithPrefix(containerDetails hcsshim.ContainerProperties) string {
|
||||
switch containerDetails.Owner {
|
||||
// collectJobContainers collects container metrics for job containers.
|
||||
// Job container based on Win32 Job objects.
|
||||
// https://learn.microsoft.com/en-us/windows/win32/procthread/job-objects
|
||||
//
|
||||
// Job containers are containers that aren't managed by HCS, e.g host process containers.
|
||||
func (c *Collector) collectJobContainers(ch chan<- prometheus.Metric) error {
|
||||
containerDStateFS := os.DirFS(c.config.ContainerDStateDir)
|
||||
|
||||
allContainerIDs := make([]string, 0, len(c.annotationsCacheJob)+len(c.annotationsCacheHCS))
|
||||
jobContainerIDs := make([]string, 0, len(allContainerIDs))
|
||||
|
||||
if err := fs.WalkDir(containerDStateFS, ".", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
c.logger.Warn("containerd state directory does not exist",
|
||||
slog.String("path", c.config.ContainerDStateDir),
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
if path == "." {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !d.IsDir() {
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := os.Stat(path + "\\config.json"); err != nil {
|
||||
containerID := strings.TrimPrefix(strings.Replace(path, c.config.ContainerDStateDir, "", 1), `\`)
|
||||
|
||||
if spec, err := c.getContainerAnnotations(containerID); err == nil {
|
||||
isHostProcess, ok := spec.Annotations["microsoft.com/hostprocess-container"]
|
||||
if ok && isHostProcess == "true" {
|
||||
allContainerIDs = append(allContainerIDs, containerID)
|
||||
|
||||
if _, ok := c.annotationsCacheJob[containerID]; !ok {
|
||||
var (
|
||||
namespace string
|
||||
podName string
|
||||
containerName string
|
||||
)
|
||||
|
||||
namespace = spec.Annotations["io.kubernetes.cri.sandbox-namespace"]
|
||||
podName = spec.Annotations["io.kubernetes.cri.sandbox-name"]
|
||||
containerName = spec.Annotations["io.kubernetes.cri.container-name"]
|
||||
|
||||
c.annotationsCacheJob[containerID] = containerInfo{
|
||||
id: "containerd://" + containerID,
|
||||
namespace: namespace,
|
||||
pod: podName,
|
||||
container: containerName,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Skip the directory content
|
||||
return fs.SkipDir
|
||||
}); err != nil {
|
||||
return fmt.Errorf("error in walking containerd state directory: %w", err)
|
||||
}
|
||||
|
||||
errs := make([]error, 0)
|
||||
|
||||
for _, containerID := range allContainerIDs {
|
||||
if err := c.collectJobContainer(ch, containerID); err != nil {
|
||||
errs = append(errs, err)
|
||||
} else {
|
||||
jobContainerIDs = append(jobContainerIDs, containerID)
|
||||
}
|
||||
}
|
||||
|
||||
// Remove containers that are no longer running
|
||||
for _, containerID := range c.annotationsCacheJob {
|
||||
if !slices.Contains(jobContainerIDs, containerID.id) {
|
||||
delete(c.annotationsCacheJob, containerID.id)
|
||||
}
|
||||
}
|
||||
|
||||
return errors.Join(errs...)
|
||||
}
|
||||
|
||||
func (c *Collector) collectJobContainer(ch chan<- prometheus.Metric, containerID string) error {
|
||||
jobObjectHandle, err := kernel32.OpenJobObject("Global\\JobContainer_" + containerID)
|
||||
if err != nil {
|
||||
if errors.Is(err, windows.ERROR_FILE_NOT_FOUND) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return fmt.Errorf("error in opening job object: %w", err)
|
||||
}
|
||||
|
||||
defer func(fd windows.Handle) {
|
||||
_ = windows.Close(fd)
|
||||
}(jobObjectHandle)
|
||||
|
||||
var jobInfo kernel32.JobObjectBasicAndIOAccountingInformation
|
||||
|
||||
if err = windows.QueryInformationJobObject(
|
||||
jobObjectHandle,
|
||||
windows.JobObjectBasicAndIoAccountingInformation,
|
||||
uintptr(unsafe.Pointer(&jobInfo)),
|
||||
uint32(unsafe.Sizeof(jobInfo)),
|
||||
nil,
|
||||
); err != nil {
|
||||
return fmt.Errorf("error in querying job object information: %w", err)
|
||||
}
|
||||
|
||||
var jobMemoryInfo kernel32.JobObjectMemoryUsageInformation
|
||||
|
||||
// https://github.com/microsoft/hcsshim/blob/bfb2a106798d3765666f6e39ec6cf0117275eab4/internal/jobobject/jobobject.go#L410
|
||||
if err = windows.QueryInformationJobObject(
|
||||
jobObjectHandle,
|
||||
JobObjectMemoryUsageInformation,
|
||||
uintptr(unsafe.Pointer(&jobMemoryInfo)),
|
||||
uint32(unsafe.Sizeof(jobMemoryInfo)),
|
||||
nil,
|
||||
); err != nil {
|
||||
return fmt.Errorf("error in querying job object memory usage information: %w", err)
|
||||
}
|
||||
|
||||
privateWorkingSetBytes, err := calculatePrivateWorkingSetBytes(jobObjectHandle)
|
||||
if err != nil {
|
||||
c.logger.Debug("error in calculating private working set bytes", slog.Any("err", err))
|
||||
}
|
||||
|
||||
containerInfo := c.annotationsCacheJob[containerID]
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.containerAvailable,
|
||||
prometheus.GaugeValue,
|
||||
1,
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container, "true",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.usageCommitBytes,
|
||||
prometheus.GaugeValue,
|
||||
float64(jobMemoryInfo.JobMemory),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.usageCommitPeakBytes,
|
||||
prometheus.GaugeValue,
|
||||
float64(jobMemoryInfo.PeakJobMemoryUsed),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.usagePrivateWorkingSetBytes,
|
||||
prometheus.GaugeValue,
|
||||
float64(privateWorkingSetBytes),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.runtimeTotal,
|
||||
prometheus.CounterValue,
|
||||
(float64(jobInfo.BasicInfo.ThisPeriodTotalKernelTime)+float64(jobInfo.BasicInfo.ThisPeriodTotalUserTime))*pdh.TicksToSecondScaleFactor,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.runtimeUser,
|
||||
prometheus.CounterValue,
|
||||
float64(jobInfo.BasicInfo.ThisPeriodTotalUserTime)*pdh.TicksToSecondScaleFactor,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.runtimeKernel,
|
||||
prometheus.CounterValue,
|
||||
float64(jobInfo.BasicInfo.ThisPeriodTotalKernelTime)*pdh.TicksToSecondScaleFactor,
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.readCountNormalized,
|
||||
prometheus.CounterValue,
|
||||
float64(jobInfo.IoInfo.ReadOperationCount),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.readSizeBytes,
|
||||
prometheus.CounterValue,
|
||||
float64(jobInfo.IoInfo.ReadTransferCount),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.writeCountNormalized,
|
||||
prometheus.CounterValue,
|
||||
float64(jobInfo.IoInfo.WriteOperationCount),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.writeSizeBytes,
|
||||
prometheus.CounterValue,
|
||||
float64(jobInfo.IoInfo.WriteTransferCount),
|
||||
|
||||
containerInfo.id, containerInfo.namespace, containerInfo.pod, containerInfo.container,
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func getContainerIdWithPrefix(container hcs.Properties) string {
|
||||
switch container.Owner {
|
||||
case "containerd-shim-runhcs-v1.exe":
|
||||
return "containerd://" + containerDetails.ID
|
||||
return "containerd://" + container.ID
|
||||
default:
|
||||
// default to docker or if owner is not set
|
||||
return "docker://" + containerDetails.ID
|
||||
return "docker://" + container.ID
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Collector) getContainerAnnotations(containerID string) (ociSpec, error) {
|
||||
configJSON, err := os.OpenFile(fmt.Sprintf(`%s%s\config.json`, c.config.ContainerDStateDir, containerID), os.O_RDONLY, 0)
|
||||
if err != nil {
|
||||
return ociSpec{}, fmt.Errorf("error in opening config.json file: %w", err)
|
||||
}
|
||||
|
||||
var annotations ociSpec
|
||||
|
||||
if err = json.NewDecoder(configJSON).Decode(&annotations); err != nil {
|
||||
return ociSpec{}, fmt.Errorf("error in decoding config.json file: %w", err)
|
||||
}
|
||||
|
||||
return annotations, nil
|
||||
}
|
||||
|
||||
func calculatePrivateWorkingSetBytes(jobObjectHandle windows.Handle) (uint64, error) {
|
||||
var pidList kernel32.JobObjectBasicProcessIDList
|
||||
|
||||
retLen := uint32(unsafe.Sizeof(pidList))
|
||||
|
||||
if err := windows.QueryInformationJobObject(
|
||||
jobObjectHandle,
|
||||
windows.JobObjectBasicProcessIdList,
|
||||
uintptr(unsafe.Pointer(&pidList)),
|
||||
retLen, &retLen); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
var (
|
||||
privateWorkingSetBytes uint64
|
||||
vmCounters kernel32.PROCESS_VM_COUNTERS
|
||||
)
|
||||
|
||||
retLen = uint32(unsafe.Sizeof(vmCounters))
|
||||
|
||||
getMemoryStats := func(pid uint32) (uint64, error) {
|
||||
processHandle, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("error in opening process: %w", err)
|
||||
}
|
||||
|
||||
defer func(fd windows.Handle) {
|
||||
_ = windows.Close(fd)
|
||||
}(processHandle)
|
||||
|
||||
var isInJob bool
|
||||
|
||||
if err := kernel32.IsProcessInJob(processHandle, jobObjectHandle, &isInJob); err != nil {
|
||||
return 0, fmt.Errorf("error in checking if process is in job: %w", err)
|
||||
}
|
||||
|
||||
if !isInJob {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
if err := windows.NtQueryInformationProcess(
|
||||
processHandle,
|
||||
windows.ProcessVmCounters,
|
||||
unsafe.Pointer(&vmCounters),
|
||||
retLen,
|
||||
&retLen,
|
||||
); err != nil {
|
||||
return 0, fmt.Errorf("error in querying process information: %w", err)
|
||||
}
|
||||
|
||||
return uint64(vmCounters.PrivateWorkingSetSize), nil
|
||||
}
|
||||
|
||||
for _, pid := range pidList.PIDs() {
|
||||
privateWorkingSetSize, err := getMemoryStats(pid)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("error in getting private working set bytes: %w", err)
|
||||
}
|
||||
|
||||
privateWorkingSetBytes += privateWorkingSetSize
|
||||
}
|
||||
|
||||
return privateWorkingSetBytes, nil
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// 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 container_test
|
||||
@@ -12,3 +27,7 @@ import (
|
||||
func BenchmarkCollector(b *testing.B) {
|
||||
testutils.FuncBenchmarkCollector(b, container.Name, container.NewWithFlags)
|
||||
}
|
||||
|
||||
func TestCollector(t *testing.T) {
|
||||
testutils.TestCollector(t, container.New, nil)
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
//go:build windows
|
||||
|
||||
package cpu
|
||||
|
||||
// Processor performance counters.
|
||||
const (
|
||||
c1TimeSeconds = "% C1 Time"
|
||||
c2TimeSeconds = "% C2 Time"
|
||||
c3TimeSeconds = "% C3 Time"
|
||||
c1TransitionsTotal = "C1 Transitions/sec"
|
||||
c2TransitionsTotal = "C2 Transitions/sec"
|
||||
c3TransitionsTotal = "C3 Transitions/sec"
|
||||
clockInterruptsTotal = "Clock Interrupts/sec"
|
||||
dpcQueuedPerSecond = "DPCs Queued/sec"
|
||||
dpcTimeSeconds = "% DPC Time"
|
||||
idleBreakEventsTotal = "Idle Break Events/sec"
|
||||
idleTimeSeconds = "% Idle Time"
|
||||
interruptsTotal = "Interrupts/sec"
|
||||
interruptTimeSeconds = "% Interrupt Time"
|
||||
parkingStatus = "Parking Status"
|
||||
performanceLimitPercent = "% Performance Limit"
|
||||
priorityTimeSeconds = "% Priority Time"
|
||||
privilegedTimeSeconds = "% Privileged Time"
|
||||
privilegedUtilitySeconds = "% Privileged Utility"
|
||||
processorFrequencyMHz = "Processor Frequency"
|
||||
processorPerformance = "% Processor Performance"
|
||||
processorTimeSeconds = "% Processor Time"
|
||||
processorUtilityRate = "% Processor Utility"
|
||||
userTimeSeconds = "% User Time"
|
||||
)
|
||||
@@ -1,3 +1,18 @@
|
||||
// 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 cpu
|
||||
@@ -9,7 +24,7 @@ import (
|
||||
|
||||
"github.com/alecthomas/kingpin/v2"
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/perfdata"
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus-community/windows_exporter/internal/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@@ -19,12 +34,14 @@ const Name = "cpu"
|
||||
|
||||
type Config struct{}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var ConfigDefaults = Config{}
|
||||
|
||||
type Collector struct {
|
||||
config Config
|
||||
|
||||
perfDataCollector *perfdata.Collector
|
||||
perfDataCollector *pdh.Collector
|
||||
perfDataObject []perfDataCounterValues
|
||||
|
||||
mu sync.Mutex
|
||||
|
||||
@@ -73,71 +90,15 @@ func (c *Collector) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||
var err error
|
||||
|
||||
func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
||||
c.mu = sync.Mutex{}
|
||||
|
||||
c.perfDataCollector, err = perfdata.NewCollector("Processor Information", perfdata.InstanceAll, []string{
|
||||
c1TimeSeconds,
|
||||
c2TimeSeconds,
|
||||
c3TimeSeconds,
|
||||
c1TransitionsTotal,
|
||||
c2TransitionsTotal,
|
||||
c3TransitionsTotal,
|
||||
clockInterruptsTotal,
|
||||
dpcQueuedPerSecond,
|
||||
dpcTimeSeconds,
|
||||
idleBreakEventsTotal,
|
||||
idleTimeSeconds,
|
||||
interruptsTotal,
|
||||
interruptTimeSeconds,
|
||||
parkingStatus,
|
||||
performanceLimitPercent,
|
||||
priorityTimeSeconds,
|
||||
privilegedTimeSeconds,
|
||||
privilegedUtilitySeconds,
|
||||
processorFrequencyMHz,
|
||||
processorPerformance,
|
||||
processorTimeSeconds,
|
||||
processorUtilityRate,
|
||||
userTimeSeconds,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create Processor Information collector: %w", err)
|
||||
}
|
||||
|
||||
c.logicalProcessors = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "logical_processor"),
|
||||
"Total number of logical processors",
|
||||
nil,
|
||||
nil,
|
||||
)
|
||||
|
||||
c.cStateSecondsTotal = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "cstate_seconds_total"),
|
||||
"Time spent in low-power idle state",
|
||||
[]string{"core", "state"},
|
||||
nil,
|
||||
)
|
||||
c.timeTotal = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "time_total"),
|
||||
"Time that processor spent in different modes (dpc, idle, interrupt, privileged, user)",
|
||||
[]string{"core", "mode"},
|
||||
nil,
|
||||
)
|
||||
c.interruptsTotal = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "interrupts_total"),
|
||||
"Total number of received and serviced hardware interrupts",
|
||||
[]string{"core"},
|
||||
nil,
|
||||
)
|
||||
c.dpcsTotal = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "dpcs_total"),
|
||||
"Total number of received and serviced deferred procedure calls (DPCs)",
|
||||
[]string{"core"},
|
||||
nil,
|
||||
)
|
||||
c.cStateSecondsTotal = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "cstate_seconds_total"),
|
||||
"Time spent in low-power idle state",
|
||||
@@ -220,6 +181,13 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
||||
c.processorRTCValues = map[string]utils.Counter{}
|
||||
c.processorMPerfValues = map[string]utils.Counter{}
|
||||
|
||||
var err error
|
||||
|
||||
c.perfDataCollector, err = pdh.NewCollector[perfDataCounterValues](logger.With(slog.String("collector", Name)), pdh.CounterTypeRaw, "Processor Information", pdh.InstancesAll)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create Processor Information collector: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -227,14 +195,15 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
c.mu.Lock() // Lock is needed to prevent concurrent map access to c.processorRTCValues
|
||||
defer c.mu.Unlock()
|
||||
|
||||
data, err := c.perfDataCollector.Collect()
|
||||
err := c.perfDataCollector.Collect(&c.perfDataObject)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to collect Processor Information metrics: %w", err)
|
||||
}
|
||||
|
||||
var coreCount float64
|
||||
|
||||
for core, coreData := range data {
|
||||
for _, coreData := range c.perfDataObject {
|
||||
core := coreData.Name
|
||||
coreCount++
|
||||
|
||||
var (
|
||||
@@ -244,17 +213,17 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
)
|
||||
|
||||
if counterProcessorRTCValues, ok = c.processorRTCValues[core]; ok {
|
||||
counterProcessorRTCValues.AddValue(uint32(coreData[processorUtilityRate].SecondValue))
|
||||
counterProcessorRTCValues.AddValue(uint32(coreData.ProcessorUtilityRateSecondValue))
|
||||
} else {
|
||||
counterProcessorRTCValues = utils.NewCounter(uint32(coreData[privilegedUtilitySeconds].SecondValue))
|
||||
counterProcessorRTCValues = utils.NewCounter(uint32(coreData.ProcessorUtilityRateSecondValue))
|
||||
}
|
||||
|
||||
c.processorRTCValues[core] = counterProcessorRTCValues
|
||||
|
||||
if counterProcessorMPerfValues, ok = c.processorMPerfValues[core]; ok {
|
||||
counterProcessorMPerfValues.AddValue(uint32(coreData[processorPerformance].SecondValue))
|
||||
counterProcessorMPerfValues.AddValue(uint32(coreData.ProcessorPerformanceSecondValue))
|
||||
} else {
|
||||
counterProcessorMPerfValues = utils.NewCounter(uint32(coreData[processorPerformance].SecondValue))
|
||||
counterProcessorMPerfValues = utils.NewCounter(uint32(coreData.ProcessorPerformanceSecondValue))
|
||||
}
|
||||
|
||||
c.processorMPerfValues[core] = counterProcessorMPerfValues
|
||||
@@ -262,119 +231,133 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.cStateSecondsTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[c1TimeSeconds].FirstValue,
|
||||
coreData.C1TimeSeconds,
|
||||
core, "c1",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.cStateSecondsTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[c2TimeSeconds].FirstValue,
|
||||
coreData.C2TimeSeconds,
|
||||
core, "c2",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.cStateSecondsTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[c3TimeSeconds].FirstValue,
|
||||
coreData.C3TimeSeconds,
|
||||
core, "c3",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.timeTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[idleTimeSeconds].FirstValue,
|
||||
coreData.IdleTimeSeconds,
|
||||
core, "idle",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.timeTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[interruptTimeSeconds].FirstValue,
|
||||
coreData.InterruptTimeSeconds,
|
||||
core, "interrupt",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.timeTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[dpcTimeSeconds].FirstValue,
|
||||
coreData.DpcTimeSeconds,
|
||||
core, "dpc",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.timeTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[privilegedTimeSeconds].FirstValue,
|
||||
coreData.PrivilegedTimeSeconds,
|
||||
core, "privileged",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.timeTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[userTimeSeconds].FirstValue,
|
||||
coreData.UserTimeSeconds,
|
||||
core, "user",
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.interruptsTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[interruptsTotal].FirstValue,
|
||||
coreData.InterruptsTotal,
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.dpcsTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[dpcQueuedPerSecond].FirstValue,
|
||||
coreData.DpcQueuedPerSecond,
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.clockInterruptsTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[clockInterruptsTotal].FirstValue,
|
||||
coreData.ClockInterruptsTotal,
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.idleBreakEventsTotal,
|
||||
prometheus.CounterValue,
|
||||
coreData[idleBreakEventsTotal].FirstValue,
|
||||
coreData.IdleBreakEventsTotal,
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.parkingStatus,
|
||||
prometheus.GaugeValue,
|
||||
coreData[parkingStatus].FirstValue,
|
||||
coreData.ParkingStatus,
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.processorFrequencyMHz,
|
||||
prometheus.GaugeValue,
|
||||
coreData[processorFrequencyMHz].FirstValue,
|
||||
coreData.ProcessorFrequencyMHz,
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.processorPerformance,
|
||||
prometheus.CounterValue,
|
||||
coreData[processorPerformance].FirstValue,
|
||||
coreData.ProcessorPerformance,
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.processorMPerf,
|
||||
prometheus.CounterValue,
|
||||
counterProcessorMPerfValues.Value(),
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.processorRTC,
|
||||
prometheus.CounterValue,
|
||||
counterProcessorRTCValues.Value(),
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.processorUtility,
|
||||
prometheus.CounterValue,
|
||||
coreData[processorUtilityRate].FirstValue,
|
||||
coreData.ProcessorUtilityRate,
|
||||
core,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.processorPrivilegedUtility,
|
||||
prometheus.CounterValue,
|
||||
coreData[privilegedUtilitySeconds].FirstValue,
|
||||
coreData.PrivilegedUtilitySeconds,
|
||||
core,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// 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 cpu_test
|
||||
|
||||
49
internal/collector/cpu/types.go
Normal file
49
internal/collector/cpu/types.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// 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 cpu
|
||||
|
||||
// Processor performance counters.
|
||||
type perfDataCounterValues struct {
|
||||
Name string
|
||||
|
||||
C1TimeSeconds float64 `perfdata:"% C1 Time"`
|
||||
C2TimeSeconds float64 `perfdata:"% C2 Time"`
|
||||
C3TimeSeconds float64 `perfdata:"% C3 Time"`
|
||||
C1TransitionsTotal float64 `perfdata:"C1 Transitions/sec"`
|
||||
C2TransitionsTotal float64 `perfdata:"C2 Transitions/sec"`
|
||||
C3TransitionsTotal float64 `perfdata:"C3 Transitions/sec"`
|
||||
ClockInterruptsTotal float64 `perfdata:"Clock Interrupts/sec"`
|
||||
DpcQueuedPerSecond float64 `perfdata:"DPCs Queued/sec"`
|
||||
DpcTimeSeconds float64 `perfdata:"% DPC Time"`
|
||||
IdleBreakEventsTotal float64 `perfdata:"Idle Break Events/sec"`
|
||||
IdleTimeSeconds float64 `perfdata:"% Idle Time"`
|
||||
InterruptsTotal float64 `perfdata:"Interrupts/sec"`
|
||||
InterruptTimeSeconds float64 `perfdata:"% Interrupt Time"`
|
||||
ParkingStatus float64 `perfdata:"Parking Status"`
|
||||
PerformanceLimitPercent float64 `perfdata:"% Performance Limit"`
|
||||
PriorityTimeSeconds float64 `perfdata:"% Priority Time"`
|
||||
PrivilegedTimeSeconds float64 `perfdata:"% Privileged Time"`
|
||||
PrivilegedUtilitySeconds float64 `perfdata:"% Privileged Utility"`
|
||||
ProcessorFrequencyMHz float64 `perfdata:"Processor Frequency"`
|
||||
ProcessorPerformance float64 `perfdata:"% Processor Performance"`
|
||||
ProcessorPerformanceSecondValue float64 `perfdata:"% Processor Performance,secondvalue"`
|
||||
ProcessorTimeSeconds float64 `perfdata:"% Processor Time"`
|
||||
ProcessorUtilityRate float64 `perfdata:"% Processor Utility"`
|
||||
ProcessorUtilityRateSecondValue float64 `perfdata:"% Processor Utility,secondvalue"`
|
||||
UserTimeSeconds float64 `perfdata:"% User Time"`
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user