Skip to content

Commit

Permalink
Merge pull request #17880 from kenrowland/HPCC-30446
Browse files Browse the repository at this point in the history
HPCC-30446 esp components fail to start in cloud due to invalid metrics

Reviewed-By: Anthony Fishbeck <[email protected]>
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Oct 24, 2023
2 parents 51f1264 + 7dda535 commit 0c0a576
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions esp/espcommon/espcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ ESPCOMMON_API std::shared_ptr<hpccMetrics::ScaledHistogramMetric> 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<strlen(removeChars); ++i)
{
metricName.erase(std::remove(metricName.begin(), metricName.end(), removeChars[i]), metricName.end());
}
return registerProfilingMetric(metricName.c_str(), desc, profilingOptions);
}

Expand Down

0 comments on commit 0c0a576

Please sign in to comment.