thelabdude commented on a change in pull request #2165: URL: https://github.com/apache/lucene-solr/pull/2165#discussion_r548158086
########## File path: solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/MetricsConfiguration.java ########## @@ -105,17 +108,23 @@ public static MetricsConfiguration from(String resource) throws Exception { public static MetricsConfiguration from(Document config) throws Exception { Node settings = getNode(config, "/config/settings"); + Map<String,MetricsQueryTemplate> jqTemplatesMap = null; + NodeList jqTemplates = (NodeList)(xpathFactory.newXPath()).evaluate("/config/jq-templates/template", config, XPathConstants.NODESET); Review comment: Also, this happens once during initialization of the Prom exporter, so efficiency of XPath isn't so much of a concern. A few extra millis (if that much) during init doesn't seem like a problem to me, esp. if it makes the code cleaner. ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org