Skip to content

RocketMQ

RocketMQ metric display, including producer TPS/message size, consumer TPS/message size, message stacking, topic information, etc.

Configuration

Note: The example Linux version is CentOS Linux release 7.8.2003 (Core), Windows version please modify the corresponding configuration file

  • Operating system support: Linux / Windows

  • Server Installation rocketmq-exporter

Install exporter

  • Pull rocketmq-exporter
git clone https://github.com/apache/rocketmq-exporter.git
  • Enter the installation directory
cd rocketmq-exporter/
  • Build the installation package (2 choose 1)

(1) How to build jar packages

mvn clean install

Build complete, enter target directory

cd target

Launch jar package (replace nameserverip address on command line)

nohup java -jar target/rocketmq-exporter-0.0.2-SNAPSHOT.jar --rocketmq.config.namesrvAddr=nameserverip:9876 &

(2) Docker mirroring

mvn package -Dmaven.test.skip=true docker:build

Start Docker using mirroring (replace nameserverip address on command line)

docker run -d --net="host" --name rocketmq-exporter -p 5557:5557 docker.io/rocketmq-exporter --rocketmq.config.namesrvAddr=nameserverip:9876
  • Test if rocketmq-exporter is normal
curl http://127.0.0.1:5557/metrics

Metric Collection

  • Open the DataKit Prometheus plug-in and copy the sample file
cd /usr/local/datakit/conf.d/prom
cp prom.conf.sample prom.conf
  • Modify the configuration file prom.conf

Description of main parameters

  • urls:exporter address, recommended to fill in Intranet address, remote collection can use public network
  • ignore_req_err: Ignore request errors for URLs
  • source: collector alias
  • metrics_types: only counter and gauge type metrics are collected by default
  • interval: acquisition frequency
[[inputs.prom]]
  urls = ["http://127.0.0.1:5557/metrics"]
  ignore_req_err = false
  source = "prom"
  metric_types = []
  interval = "60s"

Restart DataKit

Restart DataKit

Metric

Metric Description Data type
rocketmq_broker_tps broker produce message count int
rocketmq_broker_qps broker consume message count int
rocketmq_producer_tps topic produce message count int
rocketmq_producer_put_size topic produce message bytes int
rocketmq_producer_offset topic produce message offset int
rocketmq_consumer_tps topic consume message count int
rocketmq_consumer_get_size topic consume message bytes int
rocketmq_consumer_offset topic consume message offset int
rocketmq_group_get_latency_by_storetime The consumption delay time of a certain consumption group int
rocketmq_message_accumulati Message Stacking Volume int

Doc

RocketMQ Exporter Git Code

Feedback

Is this page helpful? ×