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 <wu.sheng@foxmail.com>
This commit is contained in:
Ax1an 2021-01-08 00:27:10 +08:00 committed by GitHub
parent c989bb286c
commit 4acbca0053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 9 deletions

View File

@ -26,6 +26,7 @@ Release Notes.
* Add Dolphinscheduler plugin definition.
* 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 bug that rocketmq-plugin set the wrong tag.
#### OAP-Backend
* Make meter receiver support MAL.

View File

@ -63,20 +63,25 @@ public final class Tags {
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");
/**
* 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");
/**
* 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");
/**
* 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
* recorded, such as a batch consumption in MQ.

View File

@ -39,7 +39,7 @@ public class MessageConcurrentlyConsumeInterceptor extends AbstractMessageConsum
if (status == ConsumeConcurrentlyStatus.RECONSUME_LATER) {
AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name());
Tags.MQ_STATUS.set(activeSpan, status.name());
}
ContextManager.stopSpan();
return ret;

View File

@ -40,7 +40,7 @@ public class MessageOrderlyConsumeInterceptor extends AbstractMessageConsumeInte
if (status == ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT) {
AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name());
Tags.MQ_STATUS.set(activeSpan, status.name());
}
ContextManager.stopSpan();
return ret;

View File

@ -47,7 +47,7 @@ public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor {
SendStatus sendStatus = ((SendResult) allArguments[0]).getSendStatus();
if (sendStatus != SendStatus.SEND_OK) {
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, sendStatus.name());
Tags.MQ_STATUS.set(activeSpan, sendStatus.name());
}
ContextManager.continued(enhanceInfo.getContextSnapshot());
}

View File

@ -39,7 +39,7 @@ public class MessageConcurrentlyConsumeInterceptor extends AbstractMessageConsum
if (status == ConsumeConcurrentlyStatus.RECONSUME_LATER) {
AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name());
Tags.MQ_STATUS.set(activeSpan, status.name());
}
ContextManager.stopSpan();
return ret;

View File

@ -40,7 +40,7 @@ public class MessageOrderlyConsumeInterceptor extends AbstractMessageConsumeInte
if (status == ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT) {
AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name());
Tags.MQ_STATUS.set(activeSpan, status.name());
}
ContextManager.stopSpan();
return ret;

View File

@ -47,7 +47,7 @@ public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor {
SendStatus sendStatus = ((SendResult) allArguments[0]).getSendStatus();
if (sendStatus != SendStatus.SEND_OK) {
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, sendStatus.name());
Tags.MQ_STATUS.set(activeSpan, sendStatus.name());
}
ContextManager.continued(enhanceInfo.getContextSnapshot());
}