# Copyright 2020 Cambricon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
data:
  metrics.yaml: |
    cndev:
      temperature:
        name: "temperature_celsius"
        help: "The temperature of Cambricon MLU, unit is 'celsius'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          cluster: "coregroup"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      board_health:
        name: "board_health"
        help: "The health state of Cambricon MLU, 1 means health, 0 means sick"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      physical_memory_total:
        name: "mem_total_bytes"
        help: "The total physical memory of Cambricon MLU, unit is 'B'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      physical_memory_used:
        name: "mem_used_bytes"
        help: "The used physical memory of Cambricon MLU, unit is 'B'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      memory_utilization:
        name: "mem_utilization"
        help: "The memory utilization of Cambricon MLU, unit is '%'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      board_utilization:
        name: "board_utilization"
        help: "The utilization of Cambricon MLU, unit is '%'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      board_capacity:
        name: "board_capacity"
        help: "The capacity metric of Cambricon MLU, unit is 'T'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      board_usage:
        name: "board_usage"
        help: "The usage metric of Cambricon MLU, unit is 'T'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      core_utilization:
        name: "core"
        help: "The utilization metric of Cambricon MLU core, unit is '%'"
        labels:
          core: "core"
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      fan_speed:
        name: "fan"
        help: "Fan speed of Cambricon MLU, unit is 'rpm', '-1' means no fan on MLU"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      board_power:
        name: "board_power"
        help: "The power usage of Cambricon MLU, unit is 'w'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      board_version:
        name: "board_version"
        help: "The board version info of Cambricon MLU"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
    podresources:
      board_allocated:
        name: "board_allocated"
        help: "The allocated number of Cambricon MLUs in a node"
        labels:
          model: "model"
          mluType: "mlu_type"
          driver: "driver"
          nodeName: "nodeHostname"
      mlu_container:
        name: "mlu_container"
        help: "The k8s container info of Cambricon MLUs allocated"
        labels:
          slot: "mlu"
          model: "model"
          mluType: "mlu_type"
          sn: "boardid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
          namespace: "pod_namespace"
          pod: "pod_name"
          container: "container_name"
      container_mlu_utilization:
        name: "container_resource_mlu_utilization"
        help: "Deprecated (this metric will be removed in the future): The utilization metric of Cambricon MLU in container, unit is '%'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "board_id"
          nodeName: "nodeHostname"
          namespace: "namespace"
          pod: "pod"
          container: "containerName"
      container_mlu_vf_utilization:
        name: "container_resource_mlu_vf_utilization"
        help: "The utilization metric of Cambricon MLU VF in container, unit is '%'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "board_id"
          vfID: "vfid"
          nodeName: "nodeHostname"
          namespace: "namespace"
          pod: "pod"
          container: "containerName"
      container_mlu_memory_utilization:
        name: "container_resource_mlu_memory_utilization"
        help: "Deprecated (this metric will be removed in the future): The memory utilization metric of Cambricon MLU in container, unit is '%'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "board_id"
          nodeName: "nodeHostname"
          namespace: "namespace"
          pod: "pod"
          container: "containerName"
      container_mlu_board_power:
        name: "container_resource_mlu_board_power"
        help: "Deprecated (this metric will be removed in the future): The board power usage of Cambricon MLU in container, unit is 'w'"
        labels:
          slot: "slot"
          model: "model"
          mluType: "mlu_type"
          sn: "board_id"
          nodeName: "nodeHostname"
          namespace: "namespace"
          pod: "pod"
          container: "containerName"
    cnpapi:
      pcie_read:
        name: "pcie_read"
        help: "The pcie read io metric of Cambircon MLU, unit is 'GB'"
        labels:
          slot: "mlu"
          model: "model"
          mluType: "mlu_type"
          sn: "uuid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      pcie_write:
        name: "pcie_write"
        help: "The pcie write io metric of Cambircon MLU, unit is 'GB'"
        labels:
          slot: "mlu"
          model: "model"
          mluType: "mlu_type"
          sn: "uuid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      dram_read:
        name: "dram_read"
        help: "The dram read io metric of Cambircon MLU, unit is 'GB'"
        labels:
          slot: "mlu"
          model: "model"
          mluType: "mlu_type"
          sn: "uuid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      dram_write:
        name: "dram_write"
        help: "The dram write io metric of Cambircon MLU, unit is 'GB'"
        labels:
          slot: "mlu"
          model: "model"
          mluType: "mlu_type"
          sn: "uuid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      mlulink_read:
        name: "mlulink_read"
        help: "The mlulink read io metric of Cambircon MLU, unit is 'GB'"
        labels:
          slot: "mlu"
          model: "model"
          mluType: "mlu_type"
          sn: "uuid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
      mlulink_write:
        name: "mlulink_write"
        help: "The mlulink write io metric of Cambircon MLU, unit is 'GB'"
        labels:
          slot: "mlu"
          model: "model"
          mluType: "mlu_type"
          sn: "uuid"
          nodeName: "nodeHostname"
          mcu: "mcu"
          driver: "driver"
    host:
      cpu_total:
        name: "cpu_total"
        help: "The cpu total metric of host machine, unit is the same as which in /proc/stat"
        labels:
          nodeName: "nodeHostname"
      cpu_idle:
        name: "cpu_idle"
        help: "The cpu idle metric of host machine, unit is the same as which in /proc/stat"
        labels:
          nodeName: "nodeHostname"
      memory_total:
        name: "memory_total"
        help: "The memory total metric of host machine, unit is 'GB'"
        labels:
          nodeName: "nodeHostname"
      memory_free:
        name: "memory_free"
        help: "The memory idle metric of host machine, unit is 'GB'"
        labels:
          nodeName: "nodeHostname"
kind: ConfigMap
metadata:
  labels:
    app: mlu-monitoring
  name: cambricon-mlu-exporter
  namespace: kube-system
