No filesystem metrics for BTFS?

Hi,
I am not sure if this is a bug or not. I do not get filesystem metrics via the metrics endpoint on two servers running Debian bookworm.

incus query /1.0/metrics | grep filesystem
# HELP incus_memory_Shmem_bytes The amount of cached filesystem data that is swap-backed.
  os_name: Debian GNU/Linux
  os_version: "12"
  project: default
  server: incus

  server_version: "6.4"
  storage: btrfs
  storage_version: "6.2"
  storage_supported_drivers:
  - name: dir
    version: "1"
    remote: false
  - name: lvm
    version: 2.03.16(2) (2022-05-18) / 1.02.185 (2022-05-18) / 4.47.0
    remote: false
  - name: lvmcluster
    version: 2.03.16(2) (2022-05-18) / 1.02.185 (2022-05-18) / 4.47.0
    remote: true
  - name: btrfs
    version: "6.2"
    remote: false

I should be seeing something like incus_filesystem_avail_bytes according to the documentation.
Or does it not work fully with btrfs? Does it require quota to show the metric?

That’s normal. btrfs doesn’t provide per-dataset usage data through the normal Linux filesystem APIs.

Basically, if df -h / in the container shows you more than just what the container itself is allowed to use and is currently using, then we can’t provide the metrics.

LVM, ZFS and Ceph all handle it fine, either because each container gets its own partition or because they have specific support for it (ZFS). I believe it should also work with dir storage pool, but only on ext4 or xfs and only if the filesystem project quota feature is enabled and used.

Thank you very much for the nice explanation!