xxd763795151 opened a new issue #2901:
URL: https://github.com/apache/rocketmq/issues/2901
**BUG REPORT**
1. Please describe the issue you observed:
Environment: rocketmq 4.8.0
When I use rocketmq-exporter + prometheus + grafana monitor the rocketmq
cluster, I found a question:
I can`t see the rocketmq_producer_tps of the topic that used to send some
delay message.
When I debug rocketmq-exporter , I know it collect metrics by TOPIC_PUT_NUMS
from broker, code as following:
`
//how many messages has sent for the topic
bsd = mqAdminExt.viewBrokerStatsData(masterAddr,
BrokerStatsManager.TOPIC_PUT_NUMS, topic);
String brokerIP =
clusterInfo.getBrokerAddrTable().get(bd.getBrokerName()).getBrokerAddrs().get(MixAll.MASTER_ID);
metricsService.getCollector().addTopicPutNumsMetric(
bd.getCluster(),
bd.getBrokerName(),
brokerIP,
topic,
Utils.getFixedDouble(bsd.getStatsMinute().getTps())
`
When I debug broker source code, I found that when broker process delay
message, it will use SCHEDULE_TOPIC_XXXX replace the original topic in the
message, but when compute the result for broker send stats data, it still use
SCHEDULE_TOPIC_XXXX as the topic which be sent message. Code and my comment as
following:
`
// MessageStore put message will set SCHEDULE_TOPIC_XXXX to the
topic of msgInner
putMessageResult =
this.brokerController.getMessageStore().asyncPutMessage(msgInner);
}
// so when handlePutMessageResult, the msgInner`s topic is
SCHEDULE_TOPIC_XXXX
return handlePutMessageResultFuture(putMessageResult, response,
request, msgInner, responseHeader, mqtraceContext, ctx, queueIdInt);
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]