janhoy commented on a change in pull request #662: SOLR-12584: Describe getting Prometheus metrics from a secure Solr URL: https://github.com/apache/lucene-solr/pull/662#discussion_r282591957
########## File path: solr/solr-ref-guide/src/monitoring-solr-with-prometheus-and-grafana.adoc ########## @@ -108,6 +108,38 @@ The number of seconds between collecting metrics from Solr. The `solr-exporter` The Solr's metrics exposed by `solr-exporter` can be seen at: `\http://localhost:9983/solr/admin/metrics`. +=== Getting metrics from a secure Solr(Cloud) + +Your Solr(Cloud) might be secured by measures described in <<securing-solr.adoc#securing-solr,Securing Solr>>. The security configuration can be injected into `solr-exporter` using environment variables in a fashion similar to other clients using <<using-solrj.adoc#using-solrj,SolrJ>>. This is possible because the main script picks up two external environment variables and passes them on to the Java process: + +* `JAVA_OPTS` allows to add extra JVM options +* `CLASSPATH_PREFIX` allows to add extra libraries + +Example for a SolrCloud instance secured by + +* <<basic-authentication-plugin.adoc#basic-authentication-plugin,Basic Authentication>> +* <<enabling-ssl.adoc#enabling-ssl,SSL>> +* <<zookeeper-access-control.adoc#zookeeper-access-control,ZooKeeper Access Control>> + +Suppose you have a file `basicauth.properties` with the Solr Basic-Auth credentials: + +---- +httpBasicAuthUser=myUser +httpBasicAuthPassword=myPassword +---- + +Then you can start the Exporter as follows (Linux). + +[source,bash] +---- +$ cd contrib/prometheus-exporter +$ export JAVA_OPTS="-Djavax.net.ssl.trustStore=truststore.jks -Djavax.net.ssl.trustStorePassword=truststorePassword -Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory -Dsolr.httpclient.config=basicauth.properties -DzkCredentialsProvider=org.apache.solr.common.cloud.VMParamsSingleSetCredentialsDigestZkCredentialsProvider -DzkDigestUsername=readonly-user -DzkDigestPassword=zkUserPassword" Review comment: How would this long line render in HTML ref guide and in PDF ref guide? Can you try to build the ref-guide cd solr-refguide && ant dist and then QA how it looks. An alternative is to split the lines ourselves, e.g.: $ export JAVA_OPTS="-Djavax.net.ssl.trustStore=truststore.jks \ -Djavax.net.ssl.trustStorePassword=truststorePassword \ -Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory \ .... ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org