콘텐츠로 이동

RocketMQ

RocketMQ 지표 표시, 생산자 TPS/메시지 크기, 소비자 TPS/메시지 크기, 메시지 적재량, topic 정보 등 포함

설치 구성

설명: 예시 Linux 버전은 CentOS Linux release 7.8.2003 (Core)이며, Windows 버전은 해당 구성 파일을 수정하세요

  • 지원 운영체제: Linux / Windows

  • 서버에 rocketmq-exporter 설치

exporter 설치

  • rocketmq-exporter 가져오기
git clone https://github.com/apache/rocketmq-exporter.git
  • 설치 디렉터리로 이동
cd rocketmq-exporter/
  • 빌드 패키지 생성 (둘 중 하나만 선택)

(1) jar 패키지 빌드 방식

mvn clean install

빌드가 완료되면 target 디렉터리로 이동

cd target

jar 패키지 실행 (nameserverip 주소를 명령행에서 바꾸세요)

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

(2) Docker 이미지 빌드 방식

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

이미지로 Docker 실행 (nameserverip 주소를 명령행에서 바꾸세요)

docker run -d --net="host" --name rocketmq-exporter -p 5557:5557 docker.io/rocketmq-exporter --rocketmq.config.namesrvAddr=nameserverip:9876
  • rocketmq-exporter가 정상인지 테스트
curl http://127.0.0.1:5557/metrics

지표 수집

  • DataKit Prometheus 플러그인을 활성화하고 sample 파일 복사
cd /usr/local/datakit/conf.d/samples
cp prom.conf.sample prom.conf
  • 설정 파일 prom.conf 수정

주요 파라미터 설명

  • urls:exporter 주소, 내부 네트워크 주소를 권장하며, 원격 수집 시 공인망을 사용할 수 있음
  • ignore_req_err:url 요청 오류 무시
  • source:수집기 별칭
  • metrics_types:기본적으로 counter와 gauge 유형의 지표만 수집
  • interval:수집 주기
[[inputs.prom]]
  urls = ["http://127.0.0.1:5557/metrics"]
  ignore_req_err = false
  source = "prom"
# metric_types 는 비워야 하며, rocketmq-exporter 는 데이터 유형을 지정하지 않음
  metric_types = []
  interval = "60s"

DataKit 재시작

DataKit 재시작

지표

지표 설명 데이터 타입
rocketmq_broker_tps broker가 초당 생산하는 메시지 수 int
rocketmq_broker_qps broker가 초당 소비하는 메시지 수 int
rocketmq_producer_tps 특정 topic에서 초당 생산되는 메시지 수 int
rocketmq_producer_put_size 특정 topic에서 초당 생산되는 메시지 크기(바이트) int
rocketmq_producer_offset 특정 topic의 생산 메시지 진행도 int
rocketmq_consumer_tps 특정 소비 그룹이 초당 소비하는 메시지 수 int
rocketmq_consumer_get_size 특정 소비 그룹이 초당 소비하는 메시지 크기(바이트) int
rocketmq_consumer_offset 특정 소비 그룹의 소비 메시지 진행도 int
rocketmq_group_get_latency_by_storetime 특정 소비 그룹의 소비 지연 시간 int
rocketmq_message_accumulati 메시지 적재량 int

추가 읽을거리

RocketMQ Exporter Git 코드

문서 평가

이 페이지가 도움이 되었나요?