netdata / netdata/netdata

[Bug]: FreeBSD: Monitoring erase/trim activity for disks and ZFS (again)

Open
#15,362 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/collectors bug collectors/freebsd os/bsd
Dominant language
Go
Stars
80.6k
Forks
6.6k
Avg merge
15h 36m
Merged PRs (30d)
304

Description

Bug description

Hi,

It's a new issue about this one https://github.com/netdata/netdata/issues/2625 that was solved in https://github.com/netdata/netdata/pull/2888

I found this plugin during a google search so I visited it. Sorry to unearth it.

sysctl OID have changed for ZFS TRIM. It's a per zpool tree. And had a separate hierarchy for auto trim tree, from manual trim and a third one called "simple"

auto trim cames from : zpool set autotrim=on pool, else values stay at zero.
manual trim cames from the command : zpool trim pool.

The per pool statistic gives no trivial patch to write.

Of course manual trim only gives a chart during a run. Perhaps only auto trim is meaningful to chart which produces data if autotrim is set to "on" on the pool.

Kind Regards

Expected behavior

graph of the number of TRIM operations per second

Steps to reproduce

launch netdata on a recent FreeBSD (mainly since it's merged ZFS with OpenZFS. ) I'm on 13.2 release.

installed from ports.

Installation method

other

System info
uname -a; uname -K
FreeBSD intel-nuc 13.2-RELEASE-p1 FreeBSD 13.2-RELEASE-p1 releng/13.2-08b87f63a INTEL-NUC amd64
1302001
Netdata build info
Version: netdata v1.40.1
Configure options:  '--disable-unit-tests' '--disable-httpd' '--disable-cloud' '--disable-plugin-cups' '--enable-dbengine' '--disable-plugin-freeipmi' '--enable-lto' '--disable-ml' '--prefix=/usr/local' '--localstatedir=/var' '--mandir=/usr/local/man' '--disable-silent-rules' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd13.2' 'build_alias=amd64-portbld-freebsd13.2' 'CC=cc' 'CFLAGS=-O2 -pipe -march=native  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing ' 'LDFLAGS=  -fstack-protector-strong -L/usr/local/lib ' 'LIBS=' 'CPPFLAGS=-D_WANT_VMMETER -isystem /usr/local/include' 'CXX=c++' 'CXXFLAGS=-O2 -pipe -march=native -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include ' 'PKG_CONFIG=pkgconf' 'PKG_CONFIG_LIBDIR=/usr/ports/net-mgmt/netdata/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig' 'CPP=cpp'
Install type: custom
Features:
    dbengine:                   YES
    Native HTTPS:               YES
    Netdata Cloud:              NO (by user request)
    ACLK:                       NO
    TLS Host Verification:      YES
    Machine Learning:           NO
    Stream Compression:         YES
    HTTPD (h2o):                NO
Libraries:
    protobuf:                YES (system)
    jemalloc:                NO
    JSON-C:                  YES
    libcap:                  NO
    libcrypto:               YES
    libm:                    YES
    tcalloc:                 NO
    zlib:                    YES
Plugins:
    apps:                    YES
    cgroup Network Tracking: NO
    CUPS:                    NO
    debugfs:                 NO
    EBPF:                    NO
    IPMI:                    NO
    NFACCT:                  NO
    perf:                    NO
    slabinfo:                NO
    Xen:                     NO
    Xen VBD Error Tracking:  NO
Exporters:
    AWS Kinesis:             NO
    GCP PubSub:              NO
    MongoDB:                 NO
    Prometheus Remote Write: YES
Debug/Developer Features:
    Trace Allocations:       NO

Additional info

/var/log/netdata/error.log:2023-07-11 13:26:02: netdata ERROR : P[freebsd] : FREEBSD: sysctl(kstat.zfs.misc.zio_trim.bytes...) failed: No such file or directory (errno 2, No such file or directory)

/var/log/netdata/collector.log:2023-07-11 13:26:02: netdata ERROR : P[freebsd] : DISABLED: zfs.trim_bytes chart
/var/log/netdata/collector.log:2023-07-11 13:26:02: netdata ERROR : P[freebsd] : DISABLED: zfs.trim_success chart
/var/log/netdata/collector.log:2023-07-11 13:26:02: netdata ERROR : P[freebsd] : DISABLED: kstat.zfs.misc.zio_trim module

//-------------------

sysctl example of a pool named zroot :

kstat.zfs.zroot.misc.iostats.simple_trim_bytes_failed: 0
kstat.zfs.zroot.misc.iostats.simple_trim_extents_failed: 0
kstat.zfs.zroot.misc.iostats.simple_trim_bytes_skipped: 0
kstat.zfs.zroot.misc.iostats.simple_trim_extents_skipped: 0
kstat.zfs.zroot.misc.iostats.simple_trim_bytes_written: 0
kstat.zfs.zroot.misc.iostats.simple_trim_extents_written: 0

kstat.zfs.zroot.misc.iostats.autotrim_bytes_failed: 0
kstat.zfs.zroot.misc.iostats.autotrim_extents_failed: 0
kstat.zfs.zroot.misc.iostats.autotrim_bytes_skipped: 37863424
kstat.zfs.zroot.misc.iostats.autotrim_extents_skipped: 4363
kstat.zfs.zroot.misc.iostats.autotrim_bytes_written: 645558272
kstat.zfs.zroot.misc.iostats.autotrim_extents_written: 3288

kstat.zfs.zroot.misc.iostats.trim_bytes_failed: 0
kstat.zfs.zroot.misc.iostats.trim_extents_failed: 0
kstat.zfs.zroot.misc.iostats.trim_bytes_skipped: 10627166208
kstat.zfs.zroot.misc.iostats.trim_extents_skipped: 1079092
kstat.zfs.zroot.misc.iostats.trim_bytes_written: 2057801666560
kstat.zfs.zroot.misc.iostats.trim_extents_written: 1076390

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FreeBSD collector entry points for kstat.zfs.misc.zio_trim, zfs.trim_bytes, and zfs.trim_success, then compare their expected sysctl paths with the per-pool ZFS statistics listed in the issue. Verify the behavior on a recent FreeBSD system and ensure the collector exposes meaningful TRIM activity charts, including the requested operations-per-second graph.

Written by the indexing model from the issue text.

Assessment

Domain
observability-sre, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.