Add Prometheus Zookeeper exporter
This commit is contained in:
parent
1eb618e8f3
commit
09eba9de80
|
@ -4,6 +4,11 @@
|
|||
name: zookeeper
|
||||
state: restarted
|
||||
|
||||
- name: restart prometheus-zookeeper
|
||||
service:
|
||||
name: prometheus-zookeeper-exporter
|
||||
state: restarted
|
||||
|
||||
- name: restart libvirtd
|
||||
service:
|
||||
name: libvirtd
|
||||
|
|
|
@ -21,6 +21,26 @@
|
|||
- zoo.cfg
|
||||
notify: restart zookeeper
|
||||
|
||||
- name: install Prometheus zookeeper exporter if enabled
|
||||
apt:
|
||||
name:
|
||||
- prometheus-zookeeper-exporter
|
||||
register: apt_res
|
||||
retries: 5
|
||||
until: apt_res is success
|
||||
when: enable_prometheus_exporters is defined and enable_prometheus_exporters
|
||||
|
||||
- name: install Prometheus zookeeper exporter config if enabled
|
||||
template:
|
||||
src: patroni/prometheus.env.j2
|
||||
dest: /etc/default/prometheus-zookeeper-exporter
|
||||
owner: prometheus
|
||||
group: prometheus
|
||||
mode: 0640
|
||||
notify:
|
||||
- restart prometheus-zookeeper
|
||||
when: enable_prometheus_exporters is defined and enable_prometheus_exporters
|
||||
|
||||
- name: install daily vacuum script
|
||||
template:
|
||||
src: zookeeper/zookeeper-vacuum.j2
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
# Zookeeper Prometheus exporter arguments
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# Set the zk-hosts to our cluster local IP address as this is where Zookeeper listens
|
||||
ARGS="-zk-hosts='{% for node in pvc_nodes if node.hostname == this_node %}{{ node.cluster_ip }}{% endfor %}:2181'"
|
|
@ -19,11 +19,14 @@ maxClientCnxns=200
|
|||
autopurge.snapRetainCount=3
|
||||
autopurge.purgeInterval=1
|
||||
|
||||
# Enable Prometheus metrics (someday, but not today under Debian 12 or less)
|
||||
# Enable internal Prometheus metrics (someday, but not today under Debian 12 or less)
|
||||
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
|
||||
#metricsProvider.httpPort=9181
|
||||
#metricsProvider.exportJvmInfo=true
|
||||
|
||||
# Enable all 4LW commands; need MNTR for external Prometheus metrics
|
||||
4lw.commands.whitelist=*
|
||||
|
||||
# Listen on port 2181 on the cluster IP
|
||||
clientPort=2181
|
||||
clientPortAddress={% for node in pvc_nodes if node.hostname == this_node %}{{ node.cluster_ip }}{% endfor %}
|
||||
|
|
Loading…
Reference in New Issue