Skip to content

configure rules to merge rabbitmq_identity_info #1856

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

Conversation

mmueller-rs
Copy link
Contributor

This closes #1855

Note to reviewers: remember to look at the commits in this PR and consider if they can be squashed

Summary Of Changes

If the same rabbitmq_identity_info (same pod, same cluster, etc.) is exported twice, only one of the values is used.

Additional Context

When using the default ServiceMonitor from https://github.com/rabbitmq/cluster-operator/blob/main/observability/prometheus/monitors/rabbitmq-servicemonitor.yml, multiple Metrics-Endpoints are scraped that partly return the same value.

Local Testing

It can be tested by applying the files to a test-cluster:

  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/cluster-alarms.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/container-restarts.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/file-descriptors-near-limit.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/high-connection-churn.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/insufficient-established-erlang-distribution-links.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/low-disk-watermark-predicted.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/no-majority-of-nodes-ready.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/persistent-volume-missing.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/recording-rules.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/tcp-sockets-near-limit.yml
  - https://raw.githubusercontent.com/mmueller-rs/cluster-operator/fix-prometheus-rules-for-duplicate-metrics/observability/prometheus/rules/rabbitmq/unroutable-messages.yml

Please ensure you run the unit, integration and system tests before approving the PR.

To run the unit and integration tests:

$ make unit-tests integration-tests

You will need to target a k8s cluster and have the operator deployed for running the system tests.

For example, for a Kubernetes context named dev-bunny:

$ kubectx dev-bunny
$ make destroy deploy-dev
# wait for operator to be deployed
$ make system-tests

@mkuratczyk mkuratczyk merged commit b997476 into rabbitmq:main Apr 10, 2025
13 checks passed
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.

duplicate metrics for rabbitmq_identity_info lead to broken rules
2 participants