rabbitmq_tracing插件
rabbitmq_tracing插件相当于Firehose的GUI版本,它同样能跟踪RabbitMQ中消息的注入流出情况。rabbitmq_tracing插件同样会对流入流出的消息进行封装,然后将封装后的消息日志存入相应的trace文件中。
# 开启插件
rabbitmq-plugins enable rabbitmq_tracing# 关闭插件
rabbitmq-plugins disable rabbitmq_tracing
代码使用之前Firehose的代码.
首先开启插件
[root@nullnull-os rabbitmq]# rabbitmq-plugins disable rabbitmq_tracing
Disabling plugins on node rabbit@nullnull-os:
rabbitmq_tracing
The following plugins have been configured:rabbitmq_managementrabbitmq_management_agentrabbitmq_web_dispatch
Applying plugin configuration to rabbit@nullnull-os...
The following plugins have been disabled:rabbitmq_tracingstopped 1 plugins.
[root@nullnull-os rabbitmq]# rabbitmq-plugins list
Listing plugins with pattern ".*" ...Configured: E = explicitly enabled; e = implicitly enabled| Status: * = running on rabbit@nullnull-os|/
[ ] rabbitmq_amqp1_0 3.8.5
[ ] rabbitmq_auth_backend_cache 3.8.5
[ ] rabbitmq_auth_backend_http 3.8.5
[ ] rabbitmq_auth_backend_ldap 3.8.5
[ ] rabbitmq_auth_backend_oauth2 3.8.5
[ ] rabbitmq_auth_mechanism_ssl 3.8.5
[ ] rabbitmq_consistent_hash_exchange 3.8.5
[ ] rabbitmq_event_exchange 3.8.5
[ ] rabbitmq_federation 3.8.5
[ ] rabbitmq_federation_management 3.8.5
[ ] rabbitmq_jms_topic_exchange 3.8.5
[E*] rabbitmq_management 3.8.5
[e*] rabbitmq_management_agent 3.8.5
[ ] rabbitmq_mqtt 3.8.5
[ ] rabbitmq_peer_discovery_aws 3.8.5
[ ] rabbitmq_peer_discovery_common 3.8.5
[ ] rabbitmq_peer_discovery_consul 3.8.5
[ ] rabbitmq_peer_discovery_etcd 3.8.5
[ ] rabbitmq_peer_discovery_k8s 3.8.5
[ ] rabbitmq_prometheus 3.8.5
[ ] rabbitmq_random_exchange 3.8.5
[ ] rabbitmq_recent_history_exchange 3.8.5
[ ] rabbitmq_sharding 3.8.5
[ ] rabbitmq_shovel 3.8.5
[ ] rabbitmq_shovel_management 3.8.5
[ ] rabbitmq_stomp 3.8.5
[ ] rabbitmq_top 3.8.5
[E*] rabbitmq_tracing 3.8.5
[ ] rabbitmq_trust_store 3.8.5
[e*] rabbitmq_web_dispatch 3.8.5
[ ] rabbitmq_web_mqtt 3.8.5
[ ] rabbitmq_web_mqtt_examples 3.8.5
[ ] rabbitmq_web_stomp 3.8.5
[ ] rabbitmq_web_stomp_examples 3.8.5
[root@nullnull-os rabbitmq]#
至网页端
填充跟踪信息
name表示rabbitmq_tracing的一个条目的名称,
format可以选择text或者JSON
连接用户名和密码,按创建的用户名管密码,这里填充:root/123456
pattern: 发布的消息: publish.
pattern: 消费的消息: deliver.
分别添加生产者的追溯和消费都的追溯,然后分别运行生产者和消费者。
text格式的文件信息:
json格式数据:
在这里还在两个队列:
这两个临时队列,在追溯停止后,也将不存在了。这就是网页端的追溯,相对于Firehose使用起来也更简单。可以直接通过网页端进行查看。