kaap
kaap copied to clipboard
Zookeeper metrics port registration
The Zookeeper container is currently not configured to register the metrics port, which prevents the creation of a PodMonitor for monitoring Zookeeper metrics. This issue is a critical blocker, as it limits the ability to scrape and collect metrics from the Zookeeper pods effectively.
This PR addresses the problem by ensuring that the Zookeeper container properly exposes and registers the metrics port, enabling the integration with Prometheus via a PodMonitor.
There is a workaround for that issue. You can register Pod Monitor on "client" port and reconfigure scraping using relabelings:
# Scrape only pods with the annotation: prometheus.io/scrape = true
- sourceLabels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: "true"
# If prometheus.io/path is specified, scrape this path instead of /metrics
- sourceLabels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
action: replace
targetLabel: __metrics_path__
regex: (.+)
# If prometheus.io/port is specified, scrape this port instead of the default
- sourceLabels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
targetLabel: __address__
# If prometheus.io/scheme is specified, scrape with this scheme instead of http
- sourceLabels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
action: replace
regex: (http|https)
targetLabel: __scheme__