diff --git a/client/src/main/java/org/apache/rocketmq/client/trace/TraceDataEncoder.java b/client/src/main/java/org/apache/rocketmq/client/trace/TraceDataEncoder.java index 10aa2413591309fc72b17f090b7b84af548deb86..b4a49a0564b10b040b6ae7865b38e776630b2427 100644 --- a/client/src/main/java/org/apache/rocketmq/client/trace/TraceDataEncoder.java +++ b/client/src/main/java/org/apache/rocketmq/client/trace/TraceDataEncoder.java @@ -188,8 +188,9 @@ public class TraceDataEncoder { .append(ctx.getCostTime()).append(TraceConstants.CONTENT_SPLITOR)// .append(ctx.isSuccess()).append(TraceConstants.CONTENT_SPLITOR)// .append(bean.getKeys()).append(TraceConstants.CONTENT_SPLITOR)// - .append(ctx.getContextCode()).append(TraceConstants.FIELD_SPLITOR); - + .append(ctx.getContextCode()).append(TraceConstants.CONTENT_SPLITOR) + .append(ctx.getTimeStamp()).append(TraceConstants.CONTENT_SPLITOR) + .append(ctx.getGroupName()).append(TraceConstants.FIELD_SPLITOR); } } break; diff --git a/client/src/test/java/org/apache/rocketmq/client/trace/TraceDataEncoderTest.java b/client/src/test/java/org/apache/rocketmq/client/trace/TraceDataEncoderTest.java index e268dff3454eb1a7556972b0bc4514944ce6faa1..03381d01ffcac49c6f792bd9bc2dbb45b7f8e1c2 100644 --- a/client/src/test/java/org/apache/rocketmq/client/trace/TraceDataEncoderTest.java +++ b/client/src/test/java/org/apache/rocketmq/client/trace/TraceDataEncoderTest.java @@ -189,6 +189,8 @@ public class TraceDataEncoderTest { subAfterContext.setRequestId("3455848576927"); subAfterContext.setCostTime(20); subAfterContext.setSuccess(true); + subAfterContext.setTimeStamp(1625883640000L); + subAfterContext.setGroupName("GroupName-test"); subAfterContext.setContextCode(98623046); TraceBean bean = new TraceBean(); bean.setMsgId("AC1415116D1418B4AAC217FE1B4E0000"); @@ -200,7 +202,7 @@ public class TraceDataEncoderTest { String transData = traceTransferBean.getTransData(); Assert.assertNotNull(transData); String[] items = transData.split(String.valueOf(TraceConstants.CONTENT_SPLITOR)); - Assert.assertEquals(7, items.length); + Assert.assertEquals(9, items.length); }