From 587877e5db99a9bd46ef4485f86da2ed9024e733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0urda?= Date: Fri, 24 Nov 2023 14:04:18 +0800 Subject: [PATCH] Fix missing device name - now is "missing" instead of an empty string - this is triggered e.g. when mounting degraded mode. In normal operation it shouldn't happen - Fixes #1 --- btrfs_plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/btrfs_plugin.py b/btrfs_plugin.py index b1a2f76..709ad3b 100644 --- a/btrfs_plugin.py +++ b/btrfs_plugin.py @@ -22,6 +22,8 @@ def read_callback(): r'[^a-zA-Z0-9]', r'-', dev_info.path)[1:] + if not metric.plugin_instance: + metric.plugin_instance = "missing" for counter, value in stats.counters.items(): metric.type_instance = counter metric.dispatch(TYPE_STATS, [value], interval=INTERVAL)