Host operating system
Linux 7.0.14-4-pve x86_64, OpenZFS 2.4.3
node_exporter version
Reproduced with both:
node_exporter 1.9.1
node_exporter 1.12.1
The same parsing code is present on the current default branch.
What did you do?
Created/read the root dataset of a pool named data. Its objset kstat contains
a valid string field:
The child dataset data/vm-1101-disk-0 is parsed correctly, so this is specific
to a dataset value that occurs earlier in the complete input line.
What did you expect to see?
node_zfs_zpool_dataset_nwritten{dataset="data",zpool="data"} ...
What did you see instead?
node_zfs_zpool_dataset_nwritten{dataset="dataset_name 7 data",zpool="data"} ...
Cause
parsePoolObjsetFile currently extracts the dataset with:
datasetName = line[strings.Index(line, parts[2]):]
For the value data, strings.Index matches the data at the beginning of
dataset_name, rather than the value in the third column. The resulting label
is therefore the entire input line. Joining parts[2:] would retain dataset
names containing spaces without searching the field-name/type prefix.
Host operating system
Linux 7.0.14-4-pve x86_64, OpenZFS 2.4.3
node_exporter version
Reproduced with both:
node_exporter1.9.1node_exporter1.12.1The same parsing code is present on the current default branch.
What did you do?
Created/read the root dataset of a pool named
data. Its objset kstat containsa valid string field:
The child dataset
data/vm-1101-disk-0is parsed correctly, so this is specificto a dataset value that occurs earlier in the complete input line.
What did you expect to see?
What did you see instead?
Cause
parsePoolObjsetFilecurrently extracts the dataset with:For the value
data,strings.Indexmatches thedataat the beginning ofdataset_name, rather than the value in the third column. The resulting labelis therefore the entire input line. Joining
parts[2:]would retain datasetnames containing spaces without searching the field-name/type prefix.