diff --git a/src/core/system.cpp b/src/core/system.cpp index aa39b3b34..d67a112b4 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1751,7 +1751,18 @@ std::string System::get_metrics_prometheus() { // collect string for info metric (skip dynamic strings like uptime and timestamp) std::string val = p.value().as(); if (!val.empty() && key != "uptime" && key != "timestamp") { - local_info_labels.push_back({to_lowercase(key), val}); + std::string lower_key = to_lowercase(key); + // check if key already exists in local_info_labels + bool key_exists = false; + for (const auto & label : local_info_labels) { + if (label.first == lower_key) { + key_exists = true; + break; + } + } + if (!key_exists) { + local_info_labels.push_back({lower_key, val}); + } } } }