Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zookeeper metrics port registration #183

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kamilchociej
Copy link

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.

@kamilchociej
Copy link
Author

kamilchociej commented Jan 20, 2025

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__

Copy link
Contributor

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants