|
34 | 34 | "Device controller busy time in seconds", |
35 | 35 | ["device"], namespace=namespace, registry=registry, |
36 | 36 | ), |
| 37 | + "controller_info": Info( |
| 38 | + "controller", |
| 39 | + "Controller information", |
| 40 | + ["controller", "model", "firmware", "serial", "transport"], namespace=namespace, |
| 41 | + registry=registry, |
| 42 | + ), |
37 | 43 | "critical_warning": Gauge( |
38 | 44 | "critical_warning", |
39 | 45 | "Device critical warning bitmap field", |
|
49 | 55 | "Number of 512-byte data units written by host, reported in thousands", |
50 | 56 | ["device"], namespace=namespace, registry=registry, |
51 | 57 | ), |
52 | | - "device_info": Info( |
53 | | - "device", |
54 | | - "Device information", |
55 | | - ["device", "model", "firmware", "serial"], namespace=namespace, registry=registry, |
56 | | - ), |
57 | 58 | "host_read_commands": Counter( |
58 | 59 | "host_read_commands_total", |
59 | 60 | "Device read commands from host", |
@@ -163,20 +164,17 @@ def main(): |
163 | 164 | for device in device_list["Devices"]: |
164 | 165 | for subsys in device["Subsystems"]: |
165 | 166 | for ctrl in subsys["Controllers"]: |
| 167 | + metrics["controller_info"].labels( |
| 168 | + ctrl["Controller"], |
| 169 | + ctrl["ModelNumber"], |
| 170 | + ctrl["Firmware"], |
| 171 | + ctrl["SerialNumber"].strip(), |
| 172 | + ctrl["Transport"], |
| 173 | + ) |
| 174 | + |
166 | 175 | for ns in ctrl["Namespaces"]: |
167 | 176 | device_name = ns["NameSpace"] |
168 | 177 |
|
169 | | - # FIXME: This metric ought to be refactored into a "controller_info" metric, |
170 | | - # since it contains information that is not unique to the namespace. However, |
171 | | - # previous versions of this collector erroneously referred to namespaces, e.g. |
172 | | - # "nvme0n1", as devices, so preserve the former behaviour for now. |
173 | | - metrics["device_info"].labels( |
174 | | - device_name, |
175 | | - ctrl["ModelNumber"], |
176 | | - ctrl["Firmware"], |
177 | | - ctrl["SerialNumber"].strip(), |
178 | | - ) |
179 | | - |
180 | 178 | metrics["sector_size"].labels(device_name).set(ns["SectorSize"]) |
181 | 179 | metrics["physical_size"].labels(device_name).set(ns["PhysicalSize"]) |
182 | 180 | metrics["used_bytes"].labels(device_name).set(ns["UsedBytes"]) |
|
0 commit comments