Add Printer Exporter
Addresses: https://github.com/prometheus-community/windows_exporter/issues/1470
This PR Adds the exporter for windows, it uses WMI classes (Win32_Printer and Win32_PrintJob) to fetch the data and publish them to prometheus.
References:
- https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printer
- https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printjob
An example of the output is like below:
# HELP windows_printer_job_count Number of jobs processed by the printer since the last reset
# TYPE windows_printer_job_count counter
windows_printer_job_count{printer="BE_TEST_PT01"} 4
windows_printer_job_count{printer="MO_TEST_PT01"} 0
windows_printer_job_count{printer="Microsoft Print to PDF"} 0
windows_printer_job_count{printer="Microsoft XPS Document Writer"} 0
# HELP windows_printer_job_status A counter of printer jobs by status
# TYPE windows_printer_job_status gauge
windows_printer_job_status{printer="BE_TEST_PT01",status="Error"} 1
windows_printer_job_status{printer="BE_TEST_PT01",status="UNKNOWN"} 3
# HELP windows_printer_status Printer status
# TYPE windows_printer_status gauge
windows_printer_status{printer="BE_TEST_PT01",status="Other"} 1
windows_printer_status{printer="MO_TEST_PT01",status="Idle"} 1
windows_printer_status{printer="Microsoft Print to PDF",status="Idle"} 1
windows_printer_status{printer="Microsoft XPS Document Writer",status="Idle"} 1
Checklist:
- [x] Add Documentations
- [x] Manual Testing
- [x] Adding to benchmark test
Hi @jkroepke , Can I have an initial review on this please?
Hi @jkroepke, Would it be possible to approve workflows for this PR? I don't have a windows machine and it's a bit pain to test my changes every time on a virtual machine.
Hi again @jkroepke , I guess PR is ready for a review, I would appreciate it if you could have a look at it when you have time.
Also, Could you please share the release schedule?
Hi @jkroepke, did you have time to have a look at my PR? It's a bit crucial for us to have these metrics. I would really appreciate your help on this.