How to make cgroup metrics visible from node stat API

Hi, I am trying to use node stat API to collect some cgroup metrics like:

    os.cgroup.memory.limit_in_bytes
    os.cgroup.memory.usage_in_bytes

But cgroup metrics are not visible:
API: https://localhost:9200/_nodes/<node_id>/stats/os\?filter_path\=nodes.\*.os\&pretty
Response is:

{
  "nodes" : {
    "****" : {
      "os" : {
        "timestamp" : 1578560362229,
        "cpu" : {
          "percent" : 11,
          "load_average" : {
            "1m" : 0.14,
            "5m" : 0.24,
            "15m" : 0.37
          }
        },
        "mem" : {
          "total_in_bytes" : 16825659392,
          "free_in_bytes" : 4078522368,
          "used_in_bytes" : 12747137024,
          "free_percent" : 24,
          "used_percent" : 76
        },
        "swap" : {
          "total_in_bytes" : 85899341824,
          "free_in_bytes" : 85895921664,
          "used_in_bytes" : 3420160
        }
      }
    }
  }
}

ElasticSearch version: 6.8.4
OS version:
$ uname -a
Linux host-name 4.4.0-154-generic #181-Ubuntu SMP Tue Jun 25 05:29:03 UTC 2019 x86_64 GNU/Linux

ES doc says:

For the cgroup stats to be visible, cgroups must be compiled into the kernel, the cpu and cpuacct cgroup subsystems must be configured and stats must be readable from /sys/fs/cgroup/cpu and /sys/fs/cgroup/cpuacct

These files are readable:

-rw-r--r-- 1 root root 0 Dec 27 02:04 memory.limit_in_bytes
-r--r--r-- 1 root root 0 Jan  9 07:25 memory.usage_in_bytes

Can someone help here?

try increasing logging of org.elasticsearch.monitor.os to debug and check if you see any exception in the logs.

You can change the logging configuration at runtime using the cluster update settings API, see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/logging.html#configuring-logging-levels

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.