Riccardo Pittau 3cc462dee2 Fix handling of unknown metric keys in ironic parser
The category_registry function used separate 'if' statements to check
for different key prefixes (ironic.api, ironic.drivers.modules,
ironic.conductor). When a key didn't match any prefix, the
formatted_key variable from the previous loop iteration would be
reused, causing metrics to be created with incorrect names and
incomplete labels.

Changed the if/if/if structure to if/elif/elif/else to ensure:
- Keys are processed by exactly one branch
- Unknown keys are explicitly skipped with a debug log message
- No accidental reuse of stale formatted_key values

Also updated test expectations to remove the bogus metric that was
created by this bug, and added a unit test to verify unknown keys
are properly skipped.

Assisted-By: Claude Sonnet 4.5
Change-Id: Iadca6941906783259ff7af0564a092d67f11b156
Signed-off-by: Riccardo Pittau <elfosardo@gmail.com>
2025-12-11 15:16:30 +01:00
2025-02-05 22:56:18 -06:00
2020-05-19 16:50:25 +08:00
2019-07-24 09:50:32 +02:00
2019-07-11 12:50:32 +02:00
2025-08-14 14:15:34 -03:00
2020-02-18 16:57:41 +01:00
2019-03-19 17:25:52 +01:00
2019-03-19 17:25:52 +01:00
2019-03-19 17:25:52 +01:00
2023-11-08 13:38:45 -08:00
2025-12-09 14:56:11 +01:00
2021-01-25 09:18:14 +00:00

Ironic Prometheus Exporter

Ironic Prometheus Exporter is a Tool to expose hardware sensor data in the Prometheus format through an HTTP endpoint.

The hardware sensor data come from bare metal machines deployed using OpenStack Bare Metal Service (ironic).

Description
Application capable to export hardware sensor data from Ironic nodes to a Prometheus Server.
Readme 1.6 MiB
Languages
Python 96%
Shell 4%