purushah commented on code in PR #2190: URL: https://github.com/apache/zookeeper/pull/2190#discussion_r1777968778
########## zookeeper-docs/src/main/resources/markdown/zookeeperMonitor.md: ########## @@ -41,11 +41,49 @@ All the metrics are included in the `ServerMetrics.java`. <a name="Prometheus"></a> + +### Pre-requisites: +- Enable the `Prometheus MetricsProvider` by setting the following in `zoo.cfg`: + ```conf + metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider + ``` + +- The port for Prometheus metrics can be configured using: + ```conf + metricsProvider.httpPort=7000 # Default port is 7000 + ``` + +#### Enabling HTTPS for Prometheus Metrics: + +ZooKeeper also supports SSL for Prometheus metrics, which provides secure data transmission. To enable this, configure an HTTPS port and set up SSL certificates as follows: + +- Define the HTTPS port: + ```conf + metricsProvider.httpPorts=4443 + ``` + +- Configure the SSL key store (holds the server’s private key and certificates): + ```conf + metricsProvider.ssl.keyStore.location=/path/to/keystore.jks + metricsProvider.ssl.keyStore.password=your_keystore_password + metricsProvider.ssl.keyStore.type=jks # Default is JKS + ``` + +- Configure the SSL trust store (used to verify client certificates): + ```conf + metricsProvider.ssl.trustStore.location=/path/to/truststore.jks + metricsProvider.ssl.trustStore.password=your_truststore_password + metricsProvider.ssl.trustStore.type=jks # Default is JKS + ``` + +- **Note**: You can enable both HTTP and HTTPS simultaneously by defining both ports: + ```conf + metricsProvider.httpPorts=7000 + metricsProvider.httpsPorts=4443 Review Comment: Thanks for catching that, @kezhuw. That was a simple oversight on my part. -- 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. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org