Skip to content

Commit

Permalink
HPCC-30446 esp components failing to start in cloud due to invalid me…
Browse files Browse the repository at this point in the history
…trics

Added code to metrics manager to remove illegal characters from metric name

Signed-Off-By: Kenneth Rowland [email protected]
  • Loading branch information
kenrowland committed Oct 9, 2023
1 parent a799031 commit efd8e2b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions system/jlib/jmetrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ bool MetricsManager::addMetric(const std::shared_ptr<IMetric> &pMetric)
bool rc = false;
std::string name = pMetric->queryName();

// Remove unwanted characters from input name
char removeChars[] = "_-* ";
for (unsigned i=0; i<strlen(removeChars); ++i)
{
name.erase(std::remove(name.begin(), name.end(), removeChars[i]), name.end());
}

// Ensure metric name follows naming convention
try
{
Expand Down

0 comments on commit efd8e2b

Please sign in to comment.