apiVersion: v1
kind: ConfigMap
metadata:
  name: vrops-exporter-collector-config
data:
  collector_config.yaml: |
    default_collectors:
      - 'ClusterStatsCollector'
      - 'ClusterPropertiesCollector'
      - 'HostSystemStatsCollector'
      - 'HostSystemPropertiesCollector'
      - 'DatastoreStatsCollector'
      - 'DatastorePropertiesCollector'
      # seperated to ensure faster runtime
      # - 'VMStatsCollector'
      # - 'VMPropertiesCollector'
      - 'VCenterStatsCollector'
      - 'VCenterPropertiesCollector'
    statkeys:
      HostSystemStatsCollector:
        - metric_suffix: "configuration_dasConfig_admissionControlPolicy_failoverHost"
          statkey: "configuration|dasConfig|admissionControlPolicy|failoverHost"
        - metric_suffix: "configuration_dasConfig_admissionControlPolicy_failoverHost"
          statkey: "configuration|dasConfig|admissionControlPolicy|failoverHost"
        - metric_suffix: "cpu_sockets_number"
          statkey: "cpu|numpackages"
        - metric_suffix: "hardware_number_of_cpu_cores_info"
          statkey: "hardware|cpuinfo|num_CpuCores"
        - metric_suffix:  "cpu_usage_megahertz"
          statkey: "cpu|usagemhz_average"
        - metric_suffix: "cpu_demand_percentage"
          statkey: "cpu|demandPct"
        - metric_suffix: "cpu_demand_megahertz"
          statkey: "cpu|demandmhz"
        - metric_suffix: "cpu_usage_average_percentage"
          statkey: "cpu|usage_average"
        - metric_suffix: "memory_host_usage_kilobytes"
          statkey: "mem|host_usage"
        - metric_suffix: "memory_useable_kilobytes"
          statkey: "mem|host_usable"
        - metric_suffix: "memory_usage_percentage"
          statkey: "mem|usage_average"
        - metric_suffix: "memory_utilization"
          statkey: "mem|total_need"
        - metric_suffix: "memory_contention_percentage"
          statkey: "mem|host_contentionPct"
        - metric_suffix: "memory_ballooning_kilobytes"
          statkey: "mem|vmmemctl_average"
        - metric_suffix: "memory_compressed_kilobytes"
          statkey: "mem|compressed_average"
        - metric_suffix: "memory_activly_used_by_vms_kilobytes"
          statkey: "mem|active_average"
        - metric_suffix: "memory_consumed_by_vms_kilobytes"
          statkey: "mem|consumed_average"
        - metric_suffix: "memory_capacity_available_to_vms_kilobytes"
          statkey: "mem|host_provisioned"
        - metric_suffix: "summary_number_VMs_total"
          statkey: "summary|total_number_vms"
        - metric_suffix: "summary_running_VMs_number"
          statkey: "summary|number_running_vms"
        - metric_suffix: "network_packets_dropped_rx_number"
          statkey: "net|droppedRx_summation"
        - metric_suffix: "network_packets_dropped_tx_number"
          statkey: "net|droppedTx_summation"
        - metric_suffix: "network_packets_dropped_percentage"
          statkey: "net|droppedPct"
        - metric_suffix: "system_uptime_seconds"
          statkey: "sys|uptime_latest"
      DatastoreStatsCollector:
        - metric_suffix: "diskspace_total_usage_gigabytes"
          statkey: "diskspace|disktotal"
        - metric_suffix: "diskspace_freespace_gigabytes"
          statkey: "diskspace|freespace"
        - metric_suffix: "diskspace_capacity_gigabytes"
          statkey: "diskspace|capacity"
        - metric_suffix: "summary_total_number_vms"
          statkey: "summary|total_number_vms"
      VMStatsCollector:
        - metric_suffix: "number_vcpus_total"
          statkey: "config|hardware|num_Cpu"
        - metric_suffix: "cpu_demand_ratio"
          statkey: "cpu|demandPct"
        - metric_suffix: "cpu_usage_ratio"
          statkey: "cpu|usage_average"
        - metric_suffix: "cpu_contention_ratio"
          statkey: "cpu|capacity_contentionPct"
        - metric_suffix: "cpu_ready_ratio"
          statkey: "cpu|readyPct"
        - metric_suffix: "vm_memory_kilobytes"
          statkey: "mem|guest_provisioned"
        - metric_suffix: "memory_consumed_kilobytes"
          statkey: "mem|consumed_average"
        - metric_suffix: "memory_activewrite_kilobytes"
          statkey: "mem|activewrite_average"
        - metric_suffix: "memory_active_ratio"
          statkey: "mem|guest_activePct"
        - metric_suffix: "memory_ballooning_ratio"
          statkey: "mem|balloonPct"
        - metric_suffix: "memory_contention_ratio"
          statkey: "mem|host_contentionPct"
        - metric_suffix: "swapped_memory_kilobytes"
          statkey: "mem|swapped_average"
        - metric_suffix: "swapin_memory_kilobytes"
          statkey: "mem|swapinRate_average"
        - metric_suffix: "vm_diskspace_gigabytes"
          statkey: "config|hardware|disk_Space"
        - metric_suffix: "datastore_total"
          statkey: "summary|number_datastore"
        - metric_suffix: "virtualdisk_outstanding_io"
          statkey: "virtualDisk|vDiskOIO"
        - metric_suffix: "diskspace_virtual_machine_used_gigabytes"
          statkey: "diskspace|perDsUsed"
        - metric_suffix: "datastore_outstanding_io_requests"
          statkey: "datastore|demand_oio"
      ClusterStatsCollector:
        - metric_suffix: "cluster_running_hosts"
          statkey: "summary|number_running_hosts"
        - metric_suffix: "cpu_capacity_usage_percentage"
          statkey: "cpu|capacity_usagepct_average"
        - metric_suffix: "cpu_usage_mhz"
          statkey: "cpu|usagemhz_average"
        - metric_suffix: "cpu_capacity_mhz"
          statkey: "cpu|haTotalCapacity_average"
        - metric_suffix: "memory_usage_percentage"
          statkey: "mem|host_usagePct"
        - metric_suffix: "memory_usage_kilobytes"
          statkey: "mem|host_usage"
        - metric_suffix: "memory_capacity_kilobytes"
          statkey: "mem|totalCapacity_average"
        - metric_suffix: "summary_total_number_vms"
          statkey: "summary|total_number_vms"
      VCenterStatsCollector:
        - metric_suffix: "cpu_used_percent"
          statkey: "cpu|capacity_usagepct_average"
        - metric_suffix: "memory_used_percent"
          statkey: "mem|host_usagePct"
        - metric_suffix: "diskspace_total_gigabytes"
          statkey: "diskspace|total_capacity"
        - metric_suffix: "diskspace_usage_gigabytes"
          statkey: "diskspace|total_usage"
        - metric_suffix: "vcsa_certificate_remaining_days"
          statkey: "summary|CPO vCSA Certificate Remaining Days"
    properties:
      HostSystemPropertiesCollector:
        enum_metrics:
          - metric_suffix: "runtime_powerState"
            expected: "Powered On"
            property: "runtime|powerState"
          - metric_suffix: "runtime_connectionState"
            expected: "connected"
            property: "runtime|connectionState"
          - metric_suffix: "runtime_maintenanceState"
            expected: "notInMaintenance"
            property: "runtime|maintenanceState"
        info_metrics:
          - metric_suffix: "summary_version"
            property: "summary|version"
          - metric_suffix: "sys_build"
            property: "sys|build"
          - metric_suffix: "custom_attributes_hw"
            property: "summary|customTag:HW|customTagValue"
        number_metrics:
          - metric_suffix: "config_diskSpace_bytes"
            property: "config|diskSpace"
          - metric_suffix: "runtime_memory_capacity_kilobytes"
            property: "runtime|memoryCap"
      ClusterPropertiesCollector:
        enum_metrics:
          - metric_suffix: "configuration_dasConfig_admissionControlEnabled"
            expected: "true"
            property: "configuration|dasConfig|admissionControlEnabled"
          - metric_suffix: "configuration_dasConfig_enabled"
            expected: "true"
            property: "configuration|dasConfig|enabled"
          - metric_suffix: "configuration_drsconfig_enabled"
            expected: "true"
            property: "configuration|drsconfig|enabled"
          - metric_suffix: "configuration_drsconfig_defaultVmBehavior"
            expected: "fullyAutomated"
            property: "configuration|drsconfig|defaultVmBehavior"
        number_metrics:
          - metric_suffix: "configuration_dasConfig_admissionControlPolicyId"
            property: "configuration|dasConfig|admissionControlPolicyId"
      DatastorePropertiesCollector:
        enum_metrics:
          - metric_suffix: "summary_datastore_accessible"
            expected: "PoweredOn"
            property: "summary|accessible"
      VMPropertiesCollector:
        enum_metrics:
          - metric_suffix: "runtime_powerState"
            expected: "Powered On"
            property: "summary|runtime|powerState"
          - metric_suffix: "runtime_connectionState"
            expected: "connected"
            property: "summary|runtime|connectionState"
        info_metrics:
          - metric_suffix: "virtualdisk_scsi0_0_datastore"
            property: "virtualDisk:scsi0:0|datastore"
          - metric_suffix: "virtualdisk_scsi0_1_datastore"
            property: "virtualDisk:scsi0:1|datastore"
          - metric_suffix: "guest_os_full_name"
            property: "config|guestFullName"
          - metric_suffix: "guest_tools_version"
            property: "summary|guest|toolsVersion"
        number_metrics:
          - metric_suffix: "summary_ethernetCards"
            property: "summary|config|numEthernetCards"
          - metric_suffix: "config_hardware_memory_kilobytes"
            property: "config|hardware|memoryKB"
      VCenterPropertiesCollector:
        info_metrics:
          - metric_suffix: "summary_version"
            property: "summary|version"
          - metric_suffix: "vc_fullname"
            property: "summary|vcfullname"