未验证 提交 4acbca00 编写于 作者: A Ax1an 提交者: GitHub

Fix bug that rocketmq-plugin set the wrong tag. (#6144)

* Fix bug that rocketmq-plugin set the wrong tag.

* Update CHANGES.md
Co-authored-by: wu-sheng's avatar吴晟 Wu Sheng <wu.sheng@foxmail.com>
上级 c989bb28
...@@ -26,6 +26,7 @@ Release Notes. ...@@ -26,6 +26,7 @@ Release Notes.
* Add Dolphinscheduler plugin definition. * Add Dolphinscheduler plugin definition.
* Make sampling still works when the trace ignores plug-in activation. * Make sampling still works when the trace ignores plug-in activation.
* Fix mssql-plugin occur ClassCastException when call the method of return generate key. * Fix mssql-plugin occur ClassCastException when call the method of return generate key.
* Fix bug that rocketmq-plugin set the wrong tag.
#### OAP-Backend #### OAP-Backend
* Make meter receiver support MAL. * Make meter receiver support MAL.
......
...@@ -63,20 +63,25 @@ public final class Tags { ...@@ -63,20 +63,25 @@ public final class Tags {
public static final StringTag DB_BIND_VARIABLES = new StringTag(6, "db.bind_vars"); public static final StringTag DB_BIND_VARIABLES = new StringTag(6, "db.bind_vars");
/** /**
* MQ_QUEUE records the queue name of message-middleware * MQ_QUEUE records the queue name of message-middleware.
*/ */
public static final StringTag MQ_QUEUE = new StringTag(7, "mq.queue"); public static final StringTag MQ_QUEUE = new StringTag(7, "mq.queue");
/** /**
* MQ_BROKER records the broker address of message-middleware * MQ_BROKER records the broker address of message-middleware.
*/ */
public static final StringTag MQ_BROKER = new StringTag(8, "mq.broker"); public static final StringTag MQ_BROKER = new StringTag(8, "mq.broker");
/** /**
* MQ_TOPIC records the topic name of message-middleware * MQ_TOPIC records the topic name of message-middleware.
*/ */
public static final StringTag MQ_TOPIC = new StringTag(9, "mq.topic"); public static final StringTag MQ_TOPIC = new StringTag(9, "mq.topic");
/**
* MQ_STATUS records the send/consume message status of message-middleware.
*/
public static final StringTag MQ_STATUS = new StringTag(16, "mq_status");
/** /**
* The latency of transmission. When there are more than one downstream parent/segment-ref(s), multiple tags will be * The latency of transmission. When there are more than one downstream parent/segment-ref(s), multiple tags will be
* recorded, such as a batch consumption in MQ. * recorded, such as a batch consumption in MQ.
......
...@@ -39,7 +39,7 @@ public class MessageConcurrentlyConsumeInterceptor extends AbstractMessageConsum ...@@ -39,7 +39,7 @@ public class MessageConcurrentlyConsumeInterceptor extends AbstractMessageConsum
if (status == ConsumeConcurrentlyStatus.RECONSUME_LATER) { if (status == ConsumeConcurrentlyStatus.RECONSUME_LATER) {
AbstractSpan activeSpan = ContextManager.activeSpan(); AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred(); activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name()); Tags.MQ_STATUS.set(activeSpan, status.name());
} }
ContextManager.stopSpan(); ContextManager.stopSpan();
return ret; return ret;
......
...@@ -40,7 +40,7 @@ public class MessageOrderlyConsumeInterceptor extends AbstractMessageConsumeInte ...@@ -40,7 +40,7 @@ public class MessageOrderlyConsumeInterceptor extends AbstractMessageConsumeInte
if (status == ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT) { if (status == ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT) {
AbstractSpan activeSpan = ContextManager.activeSpan(); AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred(); activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name()); Tags.MQ_STATUS.set(activeSpan, status.name());
} }
ContextManager.stopSpan(); ContextManager.stopSpan();
return ret; return ret;
......
...@@ -47,7 +47,7 @@ public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor { ...@@ -47,7 +47,7 @@ public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor {
SendStatus sendStatus = ((SendResult) allArguments[0]).getSendStatus(); SendStatus sendStatus = ((SendResult) allArguments[0]).getSendStatus();
if (sendStatus != SendStatus.SEND_OK) { if (sendStatus != SendStatus.SEND_OK) {
activeSpan.errorOccurred(); activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, sendStatus.name()); Tags.MQ_STATUS.set(activeSpan, sendStatus.name());
} }
ContextManager.continued(enhanceInfo.getContextSnapshot()); ContextManager.continued(enhanceInfo.getContextSnapshot());
} }
......
...@@ -39,7 +39,7 @@ public class MessageConcurrentlyConsumeInterceptor extends AbstractMessageConsum ...@@ -39,7 +39,7 @@ public class MessageConcurrentlyConsumeInterceptor extends AbstractMessageConsum
if (status == ConsumeConcurrentlyStatus.RECONSUME_LATER) { if (status == ConsumeConcurrentlyStatus.RECONSUME_LATER) {
AbstractSpan activeSpan = ContextManager.activeSpan(); AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred(); activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name()); Tags.MQ_STATUS.set(activeSpan, status.name());
} }
ContextManager.stopSpan(); ContextManager.stopSpan();
return ret; return ret;
......
...@@ -40,7 +40,7 @@ public class MessageOrderlyConsumeInterceptor extends AbstractMessageConsumeInte ...@@ -40,7 +40,7 @@ public class MessageOrderlyConsumeInterceptor extends AbstractMessageConsumeInte
if (status == ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT) { if (status == ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT) {
AbstractSpan activeSpan = ContextManager.activeSpan(); AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred(); activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name()); Tags.MQ_STATUS.set(activeSpan, status.name());
} }
ContextManager.stopSpan(); ContextManager.stopSpan();
return ret; return ret;
......
...@@ -47,7 +47,7 @@ public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor { ...@@ -47,7 +47,7 @@ public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor {
SendStatus sendStatus = ((SendResult) allArguments[0]).getSendStatus(); SendStatus sendStatus = ((SendResult) allArguments[0]).getSendStatus();
if (sendStatus != SendStatus.SEND_OK) { if (sendStatus != SendStatus.SEND_OK) {
activeSpan.errorOccurred(); activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, sendStatus.name()); Tags.MQ_STATUS.set(activeSpan, sendStatus.name());
} }
ContextManager.continued(enhanceInfo.getContextSnapshot()); ContextManager.continued(enhanceInfo.getContextSnapshot());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册