# Metricbeat's docker.diskio.read/write.rate is always zero when using cgroups v2

**URL:** https://discuss.elastic.co/t/metricbeats-docker-diskio-read-write-rate-is-always-zero-when-using-cgroups-v2/348048
**Category:** Beats
**Tags:** docker, metricbeat
**Created:** [November 27, 2023, 12:46pm UTC](https://discuss.elastic.co/t/metricbeats-docker-diskio-read-write-rate-is-always-zero-when-using-cgroups-v2/348048 "2023-11-27T12:46:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![christian.k](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@christian.k](https://discuss.elastic.co/u/christian.k)
#### Post date: [November 27, 2023, 12:46pm UTC](https://discuss.elastic.co/t/metricbeats-docker-diskio-read-write-rate-is-always-zero-when-using-cgroups-v2/348048/1 "2023-11-27T12:46:19Z")

</div>

We want to use the `docker.diskio.read/write.rate` metric to monitor our systems. However, Metricbeat's Docker module reports all `docker.diskio` metrics (except the `docker.diskio.read/write.bytes` metric) as zero when using a Linux system with cgroups v2.

System Configuration:

- Metricbeat 8.11.1
- Docker 24.0.7
- Ubuntu 22.04

We use the following (slightly truncated) Metricbeat configuration:

```yaml
metricbeat.modules:
- module: docker
  enabled: true
  period: 60s
  metricsets: [diskio]
  hosts: ["unix:///var/run/docker.sock"]
output.console:
  enabled: true
  codec.json:
    pretty: true

```

Output when using cgroups v1 (as exepcted):

```json
"docker": {
  "diskio": {
    "read": {
      "wait_time": 0,
      "queued": 0,
      "ops": 0,
      "bytes": 0,
      "rate": 0,
      "service_time": 0
    },
    "write": {
      "queued": 0,
      "ops": 14745,
      "bytes": 3867148288,
      "rate": 351.365903663928,
      "service_time": 0,
      "wait_time": 0
    },
    "summary": {
      "service_time": 0,
      "wait_time": 0,
      "queued": 0,
      "ops": 14745,
      "bytes": 3867148288,
      "rate": 351.365903663928
    }
  }
},

```

Output when using cgroups v2 (`rate` and `ops` are always zero which is not expected):

```json
"docker": {
  "diskio": {
    "read": {
      "wait_time": 0,
      "queued": 0,
      "ops": 0,
      "bytes": 0,
      "rate": 0,
      "service_time": 0
    },
    "write": {
      "queued": 0,
      "ops": 0,
      "bytes": 3867148288,
      "rate": 0,
      "service_time": 0,
      "wait_time": 0
    },
    "summary": {
      "service_time": 0,
      "wait_time": 0,
      "queued": 0,
      "ops": 0,
      "bytes": 3867148288,
      "rate": 0
    }
  }
},

```

Is this a (known) problem, or is this even desired behavior?

---

<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: [December 25, 2023, 2:47pm UTC](https://discuss.elastic.co/t/metricbeats-docker-diskio-read-write-rate-is-always-zero-when-using-cgroups-v2/348048/2 "2023-12-25T14:47:11Z")

</div>

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