# How to make cgroup metrics visible from node stat API

**URL:** <https://discuss.elastic.co/t/how-to-make-cgroup-metrics-visible-from-node-stat-api/214376>\
**Category:** Elasticsearch\
**Created:** [January 9, 2020, 9:01am UTC](https://discuss.elastic.co/t/how-to-make-cgroup-metrics-visible-from-node-stat-api/214376 "2020-01-09T09:01:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyndi-Tsui](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@Cyndi-Tsui](https://discuss.elastic.co/u/Cyndi-Tsui)\
**Post date:** [January 9, 2020, 9:01am UTC](https://discuss.elastic.co/t/how-to-make-cgroup-metrics-visible-from-node-stat-api/214376/1 "2020-01-09T09:01:38Z")

</div>

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

```auto
    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:

```auto
{
  "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:

```auto
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:

```auto
-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?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 9, 2020, 3:52pm UTC](https://discuss.elastic.co/t/how-to-make-cgroup-metrics-visible-from-node-stat-api/214376/2 "2020-01-09T15:52:58Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/logging.html#configuring-logging-levels)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 6, 2020, 3:53pm UTC](https://discuss.elastic.co/t/how-to-make-cgroup-metrics-visible-from-node-stat-api/214376/3 "2020-02-06T15:53:00Z")

</div>

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