config:
  freq: 60   # unit second
  port: 8889  # bind port
  bind_addr: 0.0.0.0 # bind ip
  backlog: 32  # listen backlog
  url_safe: close
  identity:   # support hostip, curl(need url arg), hostname, file(need path arg), specify(need name arg)
    #    mode: curl
    #    url: "http://100.100.100.200/latest/meta-data/instance-id"
    #    name: test_specify
    mode: curl
    url: "http://100.100.100.200/latest/meta-data/instance-id"
  #  real_timestamps: true
  #  unix_socket: "/tmp/sysom_unity.sock"
  proc_path: /mnt/host/  # in container mode, like -v /:/mnt/host , should use /mnt/host/
  db:
    rotate: 3  # tsdb file retention time, unit day
    budget: 200 # max query buffer from tsdb.
  limit:
    cpu: 90  # unit %
    mem: 200  # unit mb
    tasks: 10  # monitor 10 pid max.
    cellLimit: -1 # set guard limit time. guard time is unlimit when cellLimit is -1,default is 50(ms)

outline:
  - /var/sysom/outline

container:
  mode: "pods"
  cluster_id: true # if true && CLUSTER_ID env is set, use CLUSTER_ID env (from ack configmap) as cluster id.
  runtime: ["k8sApi", "cri_containerd", "docker"]
  nsBlacklist: ["kube-system", "arms-prom", "kube-public", "kube-node-lease"]
  luaPlugin: ["cg_cpu_cfs_quota","cg_memory_util","cg_cpu_stat_sample", "cg_cpuacct_stat",
              "cg_cpuacct_proc_stat", "cg_memory_drcm_latency", "cg_memory_fail_cnt", 
              "cg_memory_dcmp_latency", "cg_memory_oom_cnt", "con_net_stat", "podmem", "pod_storage_stat"]

  directCgPath:
    - "/"
    - "/kubepods.slice"
    - "/kubepods.slice/kubepods-besteffort.slice"
    - "/kubepods.slice/kubepods-burstable.slice"

  indirectCgPath:
    - "kubepods.slice"
    - "kubepods.slice/kubepods-besteffort.slice"
    - "kubepods.slice/kubepods-burstable.slice"

  indirectCgPath1:
    - path: "/kubepods.slice"
      child1: "/kubepods%-pod"
      child2: "/cri%-containerd"
    - path: "/kubepods.slice/kubepods-besteffort.slice"
      child1: "/kubepods%-besteffort%-pod"
      child2: "/cri%-containerd"
    - path: "/kubepods.slice/kubepods-burstable.slice"
      child1: "/kubepods%-burstable%-pod"


luaPlugins: ["proc_buddyinfo", "proc_diskstats", "proc_meminfo", "proc_mounts", "proc_netdev",
             "proc_snmp_stat", "proc_sockstat", "proc_stat", "proc_statm", "proc_vmstat",
             "proc_uptime", "proc_arp", "proc_cgroups", "proc_fd"]

plugins:
  #- so: kmsg
  #  description: "collect dmesg info."
  -
    so: proc_schedstat
    description: "collect schedule stat info of percpu"
  -
    so: proc_loadavg
    description: "collect load avg"
  - so: net_health
    description: "tcp net health."
  - so: net_retrans
    description: "tcp retrans monitor."
  - so: cpudist
    description: "sched delay"
  #-
  #  so: unity_irqoff
  #  description: "irqoff:detect irq turned off and can't response"
  #-
  #  so: gpuinfo
  #  description: "collect gpuinfo"

metrics:
  -
    title: sysom_proc_cpu_total
    from: cpu_total
    head: mode
    help: "cpu usage info for total."
    type: "gauge"
  - title: sysom_proc_cpus
    from: cpus
    head: mode
    help: "cpu usage info for per-cpu."
    type: "gauge"
    whitelist:
        mode: ["^softirq", "^user","^idle","^sys","^iowait"]
  - title: sysom_proc_sirq
    from: sirq
    head: type
    help: "system soft irq times."
    type: "gauge"
  - title: sysom_proc_stat_counters
    from: stat_counters
    head: counter
    help: "system state counter."
    type: "gauge"
  - title: sysom_proc_meminfo
    from: meminfo
    head: type
    help: "meminfo from /proc/meminfo."
    type: "gauge"
    whitelist:
        type: ["^MemFree","user","kernel_used","^MemTotal","MemAvailable","^total",
                "^MemFree","^Cached","^Buffers","^AnonHugePages","^VmallocUsed","^SReclaimable",
                "^SUnreclaim","^PageTables","^alloc_page","^KernelStack","^kernel_reserved"]
  - title: sysom_proc_vmstat
    from: vmstat
    head: type
    help: "vmstat info from /proc/vmstat."
    type: "gauge"
    whitelist:
        type: ["^thp_fault_alloc","^thp_fault_fallback","^thp_collapse_alloc","^thp_collapse_alloc_failed",
                "^pgpgin","^pgpgout","^pswpin","^pswpout","^pgfault","^pgmajfault","^pgfault","^compact_stall",
                "^compact_success","^compact_fail","^pgscan_kswapd","^pgscan_direct","^oom_kill","^pgsteal_kswapd",
                "^pgsteal_direct","^pgscan_direct_throttle"]
  - title: sysom_proc_self_statm
    from: self_statm
    head: type
    help: "statm info from /proc/self/statm."
    type: "gauge"
  - title: sysom_proc_networks
    from: networks
    head: counter
    help: "networks info from /proc/net/dev."
    type: "gauge"
  - title: sysom_proc_disks
    from: disks
    head: counter
    help: "disk info from /proc/diskstats."
    type: "gauge"
  - title: sysom_proc_pkt_status
    from: pkt_status
    head: counter
    help: "net status info from /proc/net/snmp and /proc/net/status."
    type: "gauge"
  - title: sysom_fs_stat
    from: fs_stat
    head: counter
    help: "file system information."
    type: "gauge"
  - title: sysom_sock_stat
    from: sock_stat
    head: type
    help: "sock stat counters from /proc/net/sockstat"
    type: "gauge"
  - title: sysom_proc_schedstat
    from: proc_schedstat
    head: type
    help: "schedule state of percpu."
    type: "gauge"
  - title: sysom_proc_loadavg
    from: proc_loadavg
    head: type
    help: "loadavg of system from /proc/loadavg"
    type: "gauge"
  - title: sysom_proc_buddyinfo
    from: buddyinfo
    head: type
    help: "buddyinfo of system from /proc/buddyinfo"
    type: "gauge"
  - title: sysom_IOMonIndForDisksIO
    from: IOMonIndForDisksIO
    head: type
    help: "Disk IO indicators and abnormal events"
    type: "gauge"
  - title: sysom_IOMonIndForSystemIO
    from: IOMonIndForSystemIO
    head: type
    help: "System indicators and abnormal events about IO"
    type: "gauge"
  - title: sysom_IOMonDiagLog
    from: IOMonDiagLog
    head: type
    help: "Diagnose log for IO exception"
    type: "gauge"
  - title: sched_moni_jitter
    from: sched_moni_jitter
    head: type
    help: "nosched/irqoff:sys and irqoff hold cpu and didn't scheduling"
    type: "gauge"
  - title: sysom_cpu_dist
    from: cpu_dist
    head: type
    help: "task cpu sched dist."
    type: "gauge"
  - title: sysom_net_health_hist
    from: net_health_hist
    head: type
    help: "net_health_hist"
    type: "gauge"
  - title: sysom_net_health_count
    from: net_health_count
    head: type
    help: "net_health_count"
    type: "gauge"
  - title: sysom_net_retrans_count
    from: net_retrans_count
    head: type
    help: "net_retrans_count"
    type: "gauge"
  - title: sysom_gpuinfo
    from: gpuinfo
    head: type
    help: "gpuinfo of system from nvidia-smi"
    type: "gauge"
  - title: sysom_uname
    from: uname
    head: type
    help: "uname info"
    type: "gauge"
  - title: sysom_uptime
    from: uptime
    head: type
    help: "uptime from /proc/uptime"
    type: "gauge"
  - title: sysom_system_release
    from: system_release
    head: type
    help: "system_release from /etc/os-release"
    type: "gauge"
  - title: sysom_cgroups
    from: cgroups
    head: type
    help: "cgroup number."
    type: "gauge"
  - title: sysom_file_descriptor
    from: procfd
    head: type
    help: "used file descriptor number."
    type: "gauge"
  - title: sysom_per_sirqs
    from: per_sirqs
    head: type
    help: "per_sirqs."
    type: "gauge"
  - title: sysom_softnets
    from: softnets
    head: type
    help: "cgroup number."
    type: "gauge"
  - title: sysom_interrupts
    from: interrupts
    head: type
    help: "interrupts."
    type: "gauge"
  - title: sysom_net_ip_count
    from: net_ip_count
    head: type
    help: "net snmp net_ip_count"
    type: "gauge"
  - title: sysom_net_icmp_count
    from: net_icmp_count
    head: type
    help: "net snmp net_icmp_count"
    type: "gauge"
  - title: sysom_net_udp_count
    from: net_udp_count
    head: type
    help: "net snmp net_udp_count"
    type: "gauge"
  - title: sysom_net_tcp_count
    from: net_tcp_count
    head: type
    help: "net snmp net_tcp_count"
    type: "gauge"
  - title: sysom_net_tcp_ext_count
    from: net_tcp_ext_count
    head: type
    help: "net stat net_tcp_ext_count"
    type: "gauge"
  - title: sysom_container_memory_filecache
    from: podmem
    head: type
    help: "file cache for pod"
    type: "gauge"
  - title: sysom_container_memory_allocpage
    from: pod_alloc
    head: type
    help: "pod tcp memory"
    type: "gauge"
  - title: sysom_container_memory_failcnt
    from: cg_memfail_cnt
    head: type
    help: "container memory alloc fail cnt"
    type: "gauge"
  - title: sysom_container_memory_oomcnt
    from: cg_memoom_cnt
    head: "type"
    help: "container oom event count"
    type: "counter"
  - title: sysom_container_memory_stat
    from: cg_memory_util
    head: type
    help: "container memory util"
    type: "gauge"
    blacklist:
        type: ["^pgfault","^dirty","^pgpgout","^pgpgin"]
  - title: sysom_container_memory_gdrcm_latency
    from: cgGlbDrcmLatency
    head: type
    help: "container global memory latency"
    type: "gauge"
  - title: sysom_container_memory_cdrcm_latency
    from: cg_memdrcm_latency
    head: type
    help: "container cgroup memory reclaim latency"
    type: "gauge"
    whitelist:
        type: ["^memDrcm_lat_10to100ms","^memDrcm_lat_100to500ms","^memDrcm_lat_500to1000ms","^memDrcm_lat_1000ms"]
  - title: sysom_container_memory_cpt_latency
    from: cg_memmcmp_latency
    head: type
    help: "container memory compact latency"
    type: "gauge"
    whitelist:
        type: ["^memDcmp_lat_10to100ms","^memDcmp_lat_100to500ms", "^memDcmp_lat_500to1000ms", "^memDcmp_lat_1000ms"]
  - title: sysom_container_cpu_stat
    from: cg_cpu_stat
    head: type
    help: " container cpu_stat"
    type: "gauge"
  - title: sysom_container_cpu_acctstat
    from: cg_cpuacct_stat
    head: type
    help: "container cpuacct/cpuacct.stat"
    type: "gauge"
  - title: sysom_container_proc_stat
    from: cg_proc_stat
    head: type
    help: "container cpuacct proc stat"
    type: "gauge"
  - title: sysom_container_cpu_cfsquota
    from: cgCpuQuota
    head: type
    help: "cfs quota"
    type: "gauge"
  - title: sysom_container_network_stat
    from: con_net_stat
    head: type
    help: "network stat of containers"
    type: "gauge"
    blacklist:
        type: ["^net_tx_packets","^net_rx_packets"]
  - title: sysom_container_blkio_stat
    from: cg_blkio_stat
    head: type
    help: "io stat from blkio cgroup"
    type: "gauge"
  - title: sysom_pod_ephemeral_storage_usage
    from: pod_ephemeral_storage
    head: type
    help: "pod ephemeral storage usage"
    type: "gauge"
    whitelist:
        type: ["^usedBytes", "^inodesUsed"]
  - title: sysom_container_ephemeral_storage_usage
    from: container_ephemeral_storage
    head: type
    help: "Containers ephemeral storage usage"
    type: "gauge"
    whitelist:
        type: ["^usedBytes", "^inodesUsed", "^limit"]
