influxdata / influxdata/telegraf

[inputs.zfs] poolMetrics and datasetMetrics

Open
#16,285 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Relevant telegraf.conf

```toml
[[inputs.zfs]]
name_override="system_zfs"
interval = "30s"
kstatPath = "/proc/spl/kstat/zfs"
kstatMetrics = [""]
poolMetrics = true
datasetMetrics = false

and

[[inputs.zfs]]
name_override="system_zfs"
interval = "30s"
kstatPath = "/proc/spl/kstat/zfs"
kstatMetrics = [""]
poolMetrics = false
datasetMetrics = true
```

### Logs from Telegraf

```text
With "poolMetrics = true" and "datasetMetrics = false":

2024-12-09T23:55:06Z I! Loading config: zfs.conf
2024-12-09T23:55:06Z I! Starting Telegraf 1.33.0 brought to you by InfluxData the makers of InfluxDB
2024-12-09T23:55:06Z I! Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
2024-12-09T23:55:06Z I! Loaded inputs: zfs
2024-12-09T23:55:06Z I! Loaded aggregators:
2024-12-09T23:55:06Z I! Loaded processors:
2024-12-09T23:55:06Z I! Loaded secretstores:
2024-12-09T23:55:06Z W! Outputs are not used in testing mode!
2024-12-09T23:55:06Z I! Tags enabled: host=linux
> system_zfs,dataset=poolz1/vbox-vms,host=linux,pool=poolz1 nread=0i,nunlinked=0i,nunlinks=0i,nwritten=0i,reads=0i,writes=0i 1733788507000000000
> system_zfs,dataset=poolz1/docker,host=linux,pool=poolz1 nread=518799133i,nunlinked=797i,nunlinks=797i,nwritten=811043663i,reads=151960i,writes=28495i 1733788507000000000
> system_zfs,dataset=poolz1/media,host=linux,pool=poolz1 nread=1320978207i,nunlinked=0i,nunlinks=0i,nwritten=0i,reads=20212i,writes=0i 1733788507000000000
> system_zfs,dataset=poolz1/home,host=linux,pool=poolz1 nread=2034819399i,nunlinked=1128i,nunlinks=1128i,nwritten=788413626i,reads=121563i,writes=6157i 1733788507000000000

With "poolMetrics = false" and "datasetMetrics = true":

2024-12-09T23:56:12Z I! Loading config: zfs.conf
2024-12-09T23:56:12Z I! Starting Telegraf 1.33.0 brought to you by InfluxData the makers of InfluxDB
2024-12-09T23:56:12Z I! Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
2024-12-09T23:56:12Z I! Loaded inputs: zfs
2024-12-09T23:56:12Z I! Loaded aggregators:
2024-12-09T23:56:12Z I! Loaded processors:
2024-12-09T23:56:12Z I! Loaded secretstores:
2024-12-09T23:56:12Z W! Outputs are not used in testing mode!
2024-12-09T23:56:12Z I! Tags enabled: host=linux
.... and nothing else
```

### System info

Debian 12 x64 with Telegraf v1.33.0 deb pkg

### Docker

_No response_

### Steps to reproduce

Use the given config on a Linux x64 equipped machine

### Expected behavior

"poolMetrics = true" and "datasetMetrics = false" i would expect output simiar to that when the "zpool iostat -vl" command is run.

"poolMetrics = false" and "datasetMetrics = true" i would expect datasetMetrics output.

### Actual behavior

"poolMetrics = true" and "datasetMetrics = false" gives datasetMetrics instead.

"poolMetrics = false" and "datasetMetrics = true" gives nothing.

### Additional info

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the inputs.zfs plugin entry point and reproduce both configurations from the issue on a Linux system. Compare the emitted metrics with the selected poolMetrics and datasetMetrics settings; done means pool-only output appears when requested and dataset-only output appears when requested.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.