You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在ActiveMQ Artemis中配置t24TWSQueue及DLQ告警通知(对接Grafana/SolarWinds)

ActiveMQ Artemis 告警配置方案(针对t24TWSQueue及DLQ场景)

一、基于Grafana的实现步骤

1. 暴露ActiveMQ Artemis指标

ActiveMQ Artemis支持直接暴露Prometheus指标,修改broker.xml添加以下配置:

<metrics>
  <metric-setting name="prometheus.enabled" value="true"/>
  <metric-setting name="prometheus.port" value="9404"/>
  <metric-setting name="prometheus.path" value="/metrics"/>
</metrics>

重启Broker后,即可通过http://<broker主机地址>:9404/metrics获取指标,核心指标包括:

  • artemis_queue_messages_delivering{queue="t24TWSQueue"}:t24TWSQueue处于Delivering状态的消息数
  • artemis_queue_messages{queue="DLQ.t24TWSQueue"}:DLQ队列的消息总数

若使用旧版本Artemis,可通过JMX Exporter采集JMX指标:下载JMX Exporter包,配置采集规则后,启动Broker时添加JVM参数:

-javaagent:/path/to/jmx_prometheus_javaagent.jar=9404:/path/to/config.yaml

2. 配置Prometheus抓取指标

在Prometheus的prometheus.yml中添加抓取任务:

scrape_configs:
  - job_name: 'artemis'
    static_configs:
      - targets: ['<broker主机地址>:9404']

3. Grafana告警规则配置

  • 先将Prometheus添加为Grafana数据源。
  • 创建两条告警规则:
    1. Delivering消息数超限告警:
      指标表达式:artemis_queue_messages_delivering{queue="t24TWSQueue"} > 4
      配置持续触发时间(如1分钟,避免瞬时抖动),并设置邮件、企业微信等通知方式。
    2. DLQ队列消息告警:
      指标表达式:artemis_queue_messages{queue="DLQ.t24TWSQueue"} > 0
      同样配置触发条件与通知渠道。
  • 可同步创建Dashboard可视化这两个指标,方便日常监控。

二、基于SolarWinds的实现步骤

1. 开启ActiveMQ Artemis JMX访问

修改broker.xml配置JMX绑定:

<management-bindings>
  <jmx-management-bindings>
    <connector connector-port="1099" connector-host="0.0.0.0"/>
  </jmx-management-bindings>
</management-bindings>

重启Broker,确保1099端口可被SolarWinds访问。

2. 添加SolarWinds监控节点

在SolarWinds控制台中添加ActiveMQ Artemis节点,选择JMX监控类型,配置主机地址、JMX端口1099及认证信息(若启用)。

3. 创建告警规则

  • Delivering消息数超限告警:找到t24TWSQueue对应的Queue.DeliveringMessages指标,设置阈值为大于4,触发告警。
  • DLQ队列消息告警:找到DLQ.t24TWSQueue对应的Queue.TotalMessages指标,设置阈值为大于0,触发告警。
  • 配置通知方式,如邮件、短信或运维平台推送。

三、注意事项

  • 确保监控工具与Artemis Broker的网络连通性,端口无防火墙拦截。
  • 测试告警:可暂停消费端让消息停留在Delivering状态,或手动发送消息到DLQ,验证告警是否正常触发。
  • 版本适配:不同Artemis版本的指标名称可能略有差异,需参考官方文档确认。

内容的提问来源于stack exchange,提问作者Thabsira

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 00:08:28