Performance: Regex in OpenMetricExporter
maxboehm opened this issue · comments
During a load test our prometheus got high response time to collect the metrics.
Investigating into the java stack of our app, I've found that the method OpenMetricsExporter.quoteValue:565 does make use of the method "replaceAll" without a precompiled pattern.
Wouldn't it make sense to precompile the pattern, hold it in a static variable and use the matcher? Not sure, if this is still relevant for the ongoing developments...
Hi,
while we don't have plans for continued development in SR Metrics 3.x, I don't see why not fix it. We do have a few commits since the last release (3.0.3) anyway, so we could get this in and release a 3.0.4.
If you're up for it, I'd welcome a PR to the 3.0.x branch :)