Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(observability): add RabbitMQ DLQ alerting via Prometheus + Alertmanager#19

Merged
Clark1945 merged 1 commit into
masterfrom
feat/rabbitmq-dlq-alerting
Jun 27, 2026
Merged

feat(observability): add RabbitMQ DLQ alerting via Prometheus + Alertmanager#19
Clark1945 merged 1 commit into
masterfrom
feat/rabbitmq-dlq-alerting

Conversation

@Clark1945

Copy link
Copy Markdown
Owner

πŸ“‹ Summary

Add Prometheus alert rules and an Alertmanager service so RabbitMQ dead-letter queues β€” which have no consumer by design β€” no longer go unwatched.

🎯 Motivation

The audit.log.notification.dlq (and email.notifications.dlq) hold poison messages that fail processing, but nothing observed them: there was no alerting anywhere in the stack. A silently-growing DLQ means lost audit/email events with no signal to anyone.

πŸ”§ Changes

  • Add alertmanager service to docker-compose.yml (UI on :9093)
  • Wire alerting + rule_files into prometheus.yml
  • Add rabbitmq-detailed scrape job hitting /metrics/detailed?family=queue_coarse_metrics β€” the rabbitmq_prometheus plugin's default /metrics omits per-queue depth, so this is required to see rabbitmq_detailed_queue_messages{queue=...}
  • Add alert.rules.yml with 3 rules: DLQ-not-empty (any *.dlq), audit queue backlog, RabbitMQ down
  • Add alertmanager.yml with a no-op default receiver + commented Slack/email templates
  • Document the setup in README.md (zh/en/ja) and CLAUDE.md

πŸ§ͺ How to Test

  1. docker compose up -d rabbitmq alertmanager prometheus
  2. Publish a message to the DLX: POST /api/exchanges/%2f/wallet.audit.logs.dlx/publish (routing key audit.logs.dead) via the RabbitMQ Management API
  3. Expected result: within ~1 min RabbitMQDeadLetterQueueNotEmpty shows firing at http://localhost:9090/alerts and active in Alertmanager (http://localhost:9093). Purging the DLQ clears the alert.
    • Verified end-to-end locally: pending β†’ firing β†’ Alertmanager active β†’ auto-resolved after purge.

⚠️ Notes / Risks

  • Alertmanager ships with a no-op default receiver β€” alerts are evaluated and visible in the UIs but not pushed anywhere until a Slack/email receiver is filled in. Intentional (no credentials committed).
  • Config-only change; no application code touched.

βœ… Checklist

  • Tested locally (live smoke test)
  • Documentation updated (README + CLAUDE.md)
  • No hardcoded secrets or credentials
  • Tests written or updated (N/A β€” infra/config only)

πŸ€– Generated with Claude Code

…manager

Add an Alertmanager service and Prometheus alert rules so dead-letter
queues, which have no consumer by design, no longer go unwatched.

- Add rabbitmq-detailed scrape job hitting /metrics/detailed, since the
  rabbitmq_prometheus plugin's /metrics omits per-queue depth
- Add alert.rules.yml: DLQ-not-empty, audit queue backlog, RabbitMQ down
- Add alertmanager.yml with a no-op default receiver and Slack/email
  templates; wire alertmanager into docker-compose and prometheus.yml
- Document the alerting setup in README (zh/en/ja) and CLAUDE.md

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@Clark1945 Clark1945 merged commit 8baa979 into master Jun 27, 2026
7 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.

1 participant