windows_exporter icon indicating copy to clipboard operation
windows_exporter copied to clipboard

Add Printer Exporter

Open soheilrt opened this issue 1 year ago • 4 comments

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

soheilrt avatar May 13 '24 15:05 soheilrt

Hi @jkroepke , Can I have an initial review on this please?

soheilrt avatar May 13 '24 16:05 soheilrt

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.

soheilrt avatar May 14 '24 07:05 soheilrt

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?

soheilrt avatar May 14 '24 12:05 soheilrt

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.

soheilrt avatar May 16 '24 08:05 soheilrt