Skip to content

[ISSUE #_METRICS-01] Add Prometheus alert rules pack for RocketMQ monitoring#425

Closed
messere1 wants to merge 2 commits into
apache:masterfrom
messere1:contest/metrics-pr24-alert-rules
Closed

[ISSUE #_METRICS-01] Add Prometheus alert rules pack for RocketMQ monitoring#425
messere1 wants to merge 2 commits into
apache:masterfrom
messere1:contest/metrics-pr24-alert-rules

Conversation

@messere1

@messere1 messere1 commented Jul 8, 2026

Copy link
Copy Markdown

What is the purpose of the change

This PR adds a production-ready Prometheus alert rules pack for RocketMQ 5.x, addressing the METRICS-01 task. It provides 22 pre-configured alerting rules covering broker availability, consumer lag, throughput anomalies, connection issues, resource saturation, transaction health, and more.

Brief changelog

  • src/main/resources/prometheus/rocketmq-alerts.yaml — 22 Prometheus alerting rules organized into 10 groups
  • src/main/resources/prometheus/README.md — Loading instructions (prometheus.yml, Docker, Helm), threshold customization guide, and severity level documentation

Alert Rule Categories

Category # Rules Key Metrics
Broker Availability 2 rocketmq_broker_permission, rocketmq_processor_watermark
Proxy Availability 2 rocketmq_proxy_up
Consumer Lag 5 rocketmq_consumer_lag_messages, rocketmq_consumer_lag_latency, rocketmq_consumer_inflight_messages, rocketmq_consumer_queueing_latency
Throughput Anomalies 3 rocketmq_messages_in_total, rocketmq_messages_out_total, rocketmq_send_to_dlq_messages_total
Connection Anomalies 2 rocketmq_producer_connections, rocketmq_consumer_connections
Resource Saturation 2 rocketmq_topic_number, rocketmq_consumer_group_number
Transaction Health 2 rocketmq_half_messages, rocketmq_rollback_messages_total
Message Size 1 rocketmq_message_size
Throughput Bandwidth 2 rocketmq_throughput_in_total, rocketmq_throughput_out_total
Transaction Latency 1 rocketmq_finish_message_latency

Verifying this change

All metric names and labels are verified against the official OpenTelemetry-based exporter source code:

  • Broker metrics: broker/src/main/java/org/apache/rocketmq/broker/metrics/BrokerMetricsConstant.java (link)
  • Proxy metrics: proxy/src/main/java/org/apache/rocketmq/proxy/metrics/ProxyMetricsConstant.java (link)

YAML syntax validated. Each rule includes:

  • Threshold with comment explaining rationale
  • Correct label matchers using official label names
  • Severity classification (critical / warning)
  • Descriptive summary and description annotations

How to use

Load the rules in Prometheus:

# prometheus.yml
rule_files:
  - /path/to/rocketmq-alerts.yaml

Reload:

curl -X POST http://localhost:9090/-/reload

See the included README.md for Docker and Helm deployment instructions.

Does this pull request potentially affect one of the following parts

This is a pure YAML + documentation addition. No Java code, no build changes, no runtime dependencies. None of the existing functionality is affected.

Documentation

  • Added src/main/resources/prometheus/README.md with complete loading and customization instructions.

…proxy

Add 22 production-ready Prometheus alerting rules covering:
- Broker availability (permission, processor watermark)
- Proxy availability (proxy up)
- Consumer lag (messages, latency, inflight, queueing)
- Throughput anomalies (zero throughput, DLQ rate)
- Connection anomalies (producer/consumer connections)
- Resource saturation (topic/group count)
- Transaction health (half messages, rollback rate)
- Message size anomalies
- Throughput bandwidth monitoring
- Transaction finish latency

All metric names and labels are sourced from the official OpenTelemetry-based
exporter in BrokerMetricsConstant.java and ProxyMetricsConstant.java.

Includes README with loading instructions for prometheus.yml, Docker,
and Helm deployments, plus threshold customization guide.

This addresses METRICS-01 task: provide out-of-the-box alert rule pack
for RocketMQ monitoring.
Copilot AI review requested due to automatic review settings July 8, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Prometheus alerting rules pack (YAML) plus accompanying documentation under src/main/resources/prometheus/, intended to provide a ready-to-use set of RocketMQ 5.x operational alerts.

Changes:

  • Added rocketmq-alerts.yaml containing 22 Prometheus alerting rules grouped by monitoring category.
  • Added README.md documenting metric sources, rule loading options, threshold customization, and Alertmanager integration.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/main/resources/prometheus/rocketmq-alerts.yaml New Prometheus rule groups covering broker/proxy availability, lag, throughput, connections, resources, and transactions.
src/main/resources/prometheus/README.md New usage docs for enabling metrics and loading/customizing the alert rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/resources/prometheus/README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.

@github-actions github-actions Bot added the stale label Jul 18, 2026
@github-actions github-actions Bot closed this Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants