Skip to content

Commit 1880fc0

Browse files
purushahpurshotam shah
andauthored
ZOOKEEPER-4862. Add doc to secure prometheus support (#2190)
Co-authored-by: purshotam shah <purushah@yahooinc.com>
1 parent 5a3c6a9 commit 1880fc0

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

zookeeper-docs/src/main/resources/markdown/zookeeperMonitor.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,49 @@ All the metrics are included in the `ServerMetrics.java`.
4141

4242
<a name="Prometheus"></a>
4343

44+
45+
### Pre-requisites:
46+
- Enable the `Prometheus MetricsProvider` by setting the following in `zoo.cfg`:
47+
```conf
48+
metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
49+
```
50+
51+
- The port for Prometheus metrics can be configured using:
52+
```conf
53+
metricsProvider.httpPort=7000 # Default port is 7000
54+
```
55+
56+
#### Enabling HTTPS for Prometheus Metrics:
57+
58+
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:
59+
60+
- Define the HTTPS port:
61+
```conf
62+
metricsProvider.httpsPort=4443
63+
```
64+
65+
- Configure the SSL key store (holds the server’s private key and certificates):
66+
```conf
67+
metricsProvider.ssl.keyStore.location=/path/to/keystore.jks
68+
metricsProvider.ssl.keyStore.password=your_keystore_password
69+
metricsProvider.ssl.keyStore.type=jks # Default is JKS
70+
```
71+
72+
- Configure the SSL trust store (used to verify client certificates):
73+
```conf
74+
metricsProvider.ssl.trustStore.location=/path/to/truststore.jks
75+
metricsProvider.ssl.trustStore.password=your_truststore_password
76+
metricsProvider.ssl.trustStore.type=jks # Default is JKS
77+
```
78+
79+
- **Note**: You can enable both HTTP and HTTPS simultaneously by defining both ports:
80+
```conf
81+
metricsProvider.httpPort=7000
82+
metricsProvider.httpsPort=4443
83+
```
4484
### Prometheus
4585
- Running a [Prometheus](https://prometheus.io/) monitoring service is the easiest way to ingest and record ZooKeeper's metrics.
46-
- Pre-requisites:
47-
- enable the `Prometheus MetricsProvider` by setting `metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider` in the zoo.cfg.
48-
- the Port is also configurable by setting `metricsProvider.httpPort`(the default value:7000)
86+
4987
- Install Prometheus:
5088
Go to the official website download [page](https://prometheus.io/download/), download the latest release.
5189

0 commit comments

Comments
 (0)