Skip to content

inputs.zfs: add Linux txgs metrics collection #18981

@mehulanshumali

Description

@mehulanshumali

Use Case

On Linux, ZFS exposes transaction group history in /proc/spl/kstat/zfs/<pool>/txgs.

This file contains useful pool-level write activity and timing information, including:
txg, birth, ndirty, nread, nwritten, reads, writes, otime, qtime, wtime, and stime.

The current inputs.zfs plugin does not collect these metrics, so Telegraf users cannot observe txg behavior directly even though the data is available from the kernel.

This would help monitor ZFS write pressure, txg progression, and timing behavior during real workloads.

Expected behavior

Add optional Linux-only support in inputs.zfs to collect txg metrics from /proc/spl/kstat/zfs/<pool>/txgs.

Suggested behavior:

  • feature disabled by default
  • collect only the latest completed txg row per pool
  • emit a zfs_txg measurement
  • add pool as a tag
  • expose numeric txg columns as fields
  • allow optional pool selection through config

Example:

[[inputs.zfs]]
  txgMetrics = true
  txgPools = ["pool1", "pool2"]

Actual behavior

inputs.zfs currently does not read txgs files, so these metrics are unavailable in Telegraf.

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequests for new plugin and for new features to existing plugins

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions