printer: read printers and jobs from the spooler API (#2577)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2026-10-09 09:36:59 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent cb5b4cb0bf
commit 7c200078ef
7 changed files with 774 additions and 138 deletions
+5 -5
View File
@@ -4,20 +4,20 @@ The printer collector exposes metrics about printers and their jobs.
| | |
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Metric name prefix | `printer` |
| Data source | WMI |
| Classes | [Win32_Printer](https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printer) <br> [Win32_PrintJob](https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printjob) |
| Metric name prefix | `printer` |
| Data source | Print spooler API (`EnumPrintersW`, `EnumJobsW`) |
| Classes | Values match [Win32_Printer](https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printer) and [Win32_PrintJob](https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printjob) |
| Enabled by default? | false |
## Flags
### `--collector.printer.include`
If given, a printer needs to match the include regexp in order for the corresponding printer metrics to be reported
If given, a printer needs to match the include regular expression in order for the corresponding printer metrics to be reported
### `--collector.printer.exclude`
If given, a printer needs to *not* match the exclude regexp in order for the corresponding printer metrics to be reported
If given, a printer needs to *not* match the exclude regular expression in order for the corresponding printer metrics to be reported
## Metrics