hangc0276 commented on a change in pull request #5605: fix prometheusMetrics export contains " bug URL: https://github.com/apache/pulsar/pull/5605#discussion_r344605171
########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGenerator.java ########## @@ -95,10 +95,17 @@ private static void generateSystemMetrics(SimpleTextOutputStream stream, String stream.write(sample.name); stream.write("{cluster=\"").write(cluster).write('"'); for (int j = 0; j < sample.labelNames.size(); j++) { + String labelValue = sample.labelValues.get(j); + if(labelValue != null && + (labelValue.startsWith("\"") || Review comment: ok, that's more simple! I improve the code. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services