From 7dda53526ff15df76473b6f5a73ef7082143ae7a Mon Sep 17 00:00:00 2001 From: Ken Rowland Date: Mon, 9 Oct 2023 17:12:18 -0400 Subject: [PATCH] HPCC-30446 esp components failing to start in cloud due to invalid metrics Added code to metrics manager to remove illegal characters from metric name Signed-Off-By: Kenneth Rowland kenneth.rowland@lexisnexisrisk.com --- esp/espcommon/espcommon.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/esp/espcommon/espcommon.cpp b/esp/espcommon/espcommon.cpp index 24bdf7c6788..2599434910b 100644 --- a/esp/espcommon/espcommon.cpp +++ b/esp/espcommon/espcommon.cpp @@ -59,8 +59,13 @@ ESPCOMMON_API std::shared_ptr registerServic { std::string metricName(processName); metricName.append(".").append(serviceName).append(".").append(methodName); - auto no_ = std::remove(metricName.begin(), metricName.end(), '_'); - metricName.erase(no_, metricName.end()); + + // Remove unwanted characters from new metric name + constexpr char removeChars[] = "_-* "; + for (unsigned i=0; i