influxdata / influxdata/telegraf

inputs.zfs: add Linux txgs metrics collection

Open
#18,981 5 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Use Case

On Linux, ZFS exposes transaction group history in `/proc/spl/kstat/zfs//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//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:

```toml
[[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_

Contributor guide

Open the contributing guide

Research direction

Start in the inputs.zfs plugin and inspect its existing configuration and collection tests before tracing how pool metrics are read. Use /proc/spl/kstat/zfs//txgs as the Linux data source, then verify that the optional zfs_txg measurement, pool tag, selected pools, and latest completed row are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
observability, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
63/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.