mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-04-07 18:26:35 +00:00
docs: improve file collector docs with pattern cardinality guidance and query examples (#2381)
Co-authored-by: dominik_esb <d.eisenberg@outlook.de>
This commit is contained in:
committed by
GitHub
parent
be644d75e5
commit
ccd4289e77
@@ -22,6 +22,8 @@ See https://github.com/bmatcuk/doublestar#patterns for an extended description o
|
|||||||
| `windows_file_mtime_timestamp_seconds` | File modification time | gauge | `file`, `pattern` |
|
| `windows_file_mtime_timestamp_seconds` | File modification time | gauge | `file`, `pattern` |
|
||||||
| `windows_file_size_bytes` | File size | gauge | `file`, `pattern` |
|
| `windows_file_size_bytes` | File size | gauge | `file`, `pattern` |
|
||||||
|
|
||||||
|
> Warning: if a very large number of files are matched, the combination of `file` and `pattern` labels can increase cardinality significantly. Use narrow patterns where possible.
|
||||||
|
|
||||||
### Example metric
|
### Example metric
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -34,7 +36,12 @@ windows_file_size_bytes{file="C:\\Users\\admin\\Desktop\\Dashboard.lnk",pattern=
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Useful queries
|
## Useful queries
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
When the same file matches multiple patterns, the `pattern` label makes each sample unique. This also allows aggregation by pattern instead of introducing a separate count metric.
|
||||||
|
|
||||||
|
```promql
|
||||||
|
sum(windows_file_size_bytes) by (pattern)
|
||||||
|
count(windows_file_size_bytes) by (pattern)
|
||||||
|
```
|
||||||
|
|
||||||
## Alerting examples
|
## Alerting examples
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
||||||
|
|||||||
Reference in New Issue
Block a user