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:
parent
e7200fb1b0
commit
dfe9c11102
@ -375,10 +375,8 @@ impl Collector for DiskCollector {
|
|||||||
for (disk_index, disk) in mounted_disks.iter().enumerate() {
|
for (disk_index, disk) in mounted_disks.iter().enumerate() {
|
||||||
let timestamp = chrono::Utc::now().timestamp() as u64;
|
let timestamp = chrono::Utc::now().timestamp() as u64;
|
||||||
|
|
||||||
// Use config name if available, otherwise use index
|
// Always use index for metric names to maintain dashboard compatibility
|
||||||
let disk_name = disk.config_name.as_ref()
|
let disk_name = disk_index.to_string();
|
||||||
.map(|name| name.clone())
|
|
||||||
.unwrap_or_else(|| disk_index.to_string());
|
|
||||||
|
|
||||||
// Parse size strings to get actual values for calculations
|
// Parse size strings to get actual values for calculations
|
||||||
let size_gb = self.parse_size_to_gb(&disk.size);
|
let size_gb = self.parse_size_to_gb(&disk.size);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user