diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 10e1b51f4e9..625228ae9e4 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -134,6 +134,8 @@ Other Changes * SOLR-14944: Remove the "spins" metrics - support for detection of spinning disks has been removed in LUCENE-9576. (ab) +* SOLR-14957: Add Prometheus Exporter to docker PATH. Fix classpath issues. (Houston Putman) + Bug Fixes --------------------- * SOLR-14546: Fix for a relatively hard to hit issue in OverseerTaskProcessor that could lead to out of order execution diff --git a/solr/contrib/prometheus-exporter/bin/solr-exporter b/solr/contrib/prometheus-exporter/bin/solr-exporter index 9dc717ea7c8..5eb8ef8ad1c 100755 --- a/solr/contrib/prometheus-exporter/bin/solr-exporter +++ b/solr/contrib/prometheus-exporter/bin/solr-exporter @@ -74,7 +74,7 @@ then REPO="$BASEDIR"/lib fi -CLASSPATH=$CLASSPATH_PREFIX +CLASSPATH=$CLASSPATH_PREFIX:$BASEDIR/conf for JAR in $(find "$REPO" -name '*.jar') do CLASSPATH="$CLASSPATH":"$JAR" @@ -103,6 +103,10 @@ for JAR in $(find "$BASEDIR"/../../server/solr-webapp/webapp/WEB-INF/lib -name ' do CLASSPATH="$CLASSPATH":"$JAR" done +for JAR in $(find "$BASEDIR"/../../server/lib/ext -name '*.jar') +do + CLASSPATH="$CLASSPATH":"$JAR" +done # Memory settings JAVA_MEM_OPTS= diff --git a/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd b/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd index e5bd65ef8a4..84ccce96df0 100644 --- a/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd +++ b/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd @@ -71,7 +71,7 @@ if "%JAVACMD%"=="" set JAVACMD=java if "%REPO%"=="" set REPO=%BASEDIR%\lib -set CLASSPATH=%REPO%\*;%BASEDIR%\..\..\dist\solrj-lib\*;%BASEDIR%\..\..\dist\*;%BASEDIR%\lucene-libs\*;%BASEDIR%\..\..\server\solr-webapp\webapp\WEB-INF\lib\* +set CLASSPATH=%REPO%\*;%BASEDIR%\conf;%BASEDIR%\..\..\dist\solrj-lib\*;%BASEDIR%\..\..\dist\*;%BASEDIR%\lucene-libs\*;%BASEDIR%\..\..\server\solr-webapp\webapp\WEB-INF\lib\*;%BASEDIR%\..\..\server\lib\ext\* set EXTRA_JVM_ARGUMENTS=-Dlog4j.configurationFile=file:///%BASEDIR%\..\..\server\resources\log4j2-console.xml goto endInit diff --git a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/SolrExporter.java b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/SolrExporter.java index 04b0b75278f..1a0bff8612e 100644 --- a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/SolrExporter.java +++ b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/SolrExporter.java @@ -68,7 +68,7 @@ public class SolrExporter { private static final String[] ARG_CONFIG_FLAGS = {"-f", "--config-file"}; private static final String ARG_CONFIG_METAVAR = "CONFIG"; private static final String ARG_CONFIG_DEST = "configFile"; - private static final String ARG_CONFIG_DEFAULT = "./conf/solr-exporter-config.xml"; + private static final String ARG_CONFIG_DEFAULT = "solr-exporter-config.xml"; private static final String ARG_CONFIG_HELP = "Specify the configuration file; the default is " + ARG_CONFIG_DEFAULT + "."; private static final String[] ARG_SCRAPE_INTERVAL_FLAGS = {"-s", "--scrape-interval"}; diff --git a/solr/docker/Dockerfile b/solr/docker/Dockerfile index 26bbfdd1cfd..aef0800e967 100644 --- a/solr/docker/Dockerfile +++ b/solr/docker/Dockerfile @@ -23,7 +23,7 @@ ENV SOLR_USER="solr" \ SOLR_UID="8983" \ SOLR_GROUP="solr" \ SOLR_GID="8983" \ - PATH="/opt/solr/bin:/opt/docker-solr/scripts:$PATH" \ + PATH="/opt/solr/bin:/opt/docker-solr/scripts:/opt/solr/contrib/prometheus-exporter/bin:$PATH" \ SOLR_INCLUDE=/etc/default/solr.in.sh \ SOLR_HOME=/var/solr/data \ SOLR_PID_DIR=/var/solr \