背景
Rabbitmq收到的每条消息都记录日志,方便排查问题
原理
- 使用Firehose Tracer技术,通过rabbitmq_tracing插件提供UI界面
- Firehose Tracer介绍:https://www.rabbitmq.com/firehose.html
- rabbitmq_tracing插件介绍:https://www.rabbitmq.com/plugins.html
- 监控客户端发送到Rabbitmq的消息及客户端从Rabbitmq消费的消息
Traced message routing key will be either "publish.{exchangename}" (for messages entering the node),
or "deliver.{queuename}" (for messages that are delivered to consumers).
步骤
- 启动插件
/usr/lib/rabbitmq/lib/rabbitmq_server/plugins
rabbitmq-plugins list
rabbitmq-plugins enable rabbitmq_tracing
- 新增Trace
启动插件后(Rabbitmq Management-->Admin)会新增Tracing项
新增tracing,输入名称、格式,其它默认
- 查看日志
[Tr