Fix disk metric naming to maintain dashboard compatibility

Keep numbered metric names (disk_0_*, disk_1_*) instead of named metrics
(disk_root_*, disk_boot_*) to ensure existing dashboard continues working.
UUID-based detection works internally but produces compatible metric names.
This commit is contained in:
Christoffer Martinsson 2025-10-20 10:07:34 +02:00
parent e7200fb1b0
commit dfe9c11102

View File

@ -375,10 +375,8 @@ impl Collector for DiskCollector {
for (disk_index, disk) in mounted_disks.iter().enumerate() {
let timestamp = chrono::Utc::now().timestamp() as u64;
// Use config name if available, otherwise use index
let disk_name = disk.config_name.as_ref()
.map(|name| name.clone())
.unwrap_or_else(|| disk_index.to_string());
// Always use index for metric names to maintain dashboard compatibility
let disk_name = disk_index.to_string();
// Parse size strings to get actual values for calculations
let size_gb = self.parse_size_to_gb(&disk.size);