# windows_exporter config - Domain Controller + Print Server
# Roles: AD DS, DNS Server, DHCP Server, DFS Replication (SYSVOL/DFSR),
#        Windows Time, Print Server
#
# Collectors enabled beyond defaults:
#   cpu_info          - CPU model/core count as metric labels
#   physical_disk     - Per-disk IO, latency, and queue depth
#   ad                - ~60 AD DS metrics: LDAP, replication, ATQ, binds, SAM, auth
#   dns               - DNS query/response counts, zone transfers, dynamic updates, memory
#   dhcp              - DHCP lease counts, discover/offer/request/ack rates, pool usage
#   dfsr              - DFS Replication connection, folder, and volume metrics (SYSVOL)
#   time              - Windows Time service clock offset and accuracy
#   tcp               - TCP state counts; useful for LDAP/Kerberos/RPC connection load
#   printer           - Per-printer status, job count, and job status
#   process           - Per-process CPU/memory for print spooler
#   performancecounter - Print Queue counters: jobs, pages, bytes

collectors:
  enabled: "[defaults],cpu_info,physical_disk,ad,dns,dhcp,dfsr,time,tcp,printer,process,performancecounter"

collector:
  logical_disk:
    volume-exclude: "^(HarddiskVolume|HarddiskVolumeShadowCopy)"

  dns:
    # Collect both standard perf counters and WMI error statistics
    enabled:
      - metrics
      - wmi_stats

  dfsr:
    # All three source types - connection (replication traffic), folder (SYSVOL
    # conflict/staging), and volume (USN journal / DB operations)
    sources-enabled:
      - connection
      - folder
      - volume

  printer:
    # Exclude virtual/software printers - keep physical and network printers
    exclude: "(?i)(Microsoft XPS|Microsoft Print to PDF|OneNote|Fax|Send To OneNote)"

  process:
    include: "^(spoolsv|splwow64).*"
    cmdline: false

  service:
    # AD DS, DNS, DHCP, DFS, Kerberos, Net Logon, time sync, spooler, and core services
    include: "(?i)(ntds|dns|dhcpserver|dfsr|kdc|netlogon|w32tm|IsmServ|gpsvc|spooler|eventlog|winmgmt|lsass|samss)"

  performancecounter:
    objects: |-
      - name: print_queue
        object: "Print Queue"
        instances: ["*"]
        instance_label: "printer"
        counters:
          - name: "Total Jobs Printed"
            metric: windows_performancecounter_print_queue_total_jobs_printed
            type: counter
          - name: "Total Pages Printed"
            metric: windows_performancecounter_print_queue_pages_printed_total
            type: counter
          - name: "Bytes Printed/sec"
            metric: windows_performancecounter_print_queue_bytes_printed_per_sec
            type: "raw"
          - name: "Jobs"
            metric: windows_performancecounter_print_queue_jobs_current
            type: "raw"
          - name: "Jobs Spooling"
            metric: windows_performancecounter_print_queue_jobs_spooling
            type: "raw"
          - name: "Max Jobs Spooling"
            metric: windows_performancecounter_print_queue_max_jobs_spooling
            type: "raw"
          - name: "Out of Paper Errors"
            metric: windows_performancecounter_print_queue_out_of_paper_errors_total
            type: counter
          - name: "Not Ready Errors"
            metric: windows_performancecounter_print_queue_not_ready_errors_total
            type: counter
          - name: "Job Errors"
            metric: windows_performancecounter_print_queue_job_errors_total
            type: counter
