From 1148ec3801179c005304ae96dd76d7eac1cbfafa Mon Sep 17 00:00:00 2001 From: "pg.yang" Date: Sun, 23 Oct 2022 14:26:54 +0800 Subject: [PATCH] Polish up activemq plugin to fix missing broker tag on consumer side (#363) --- CHANGES.md | 2 + ...=> MessageConsumerDequeueInterceptor.java} | 55 ++++--- .../ActiveMQConsumerInstrumentation.java | 4 +- ...essageConsumerDequeueInterceptorTest.java} | 33 +--- .../service-agent/java-agent/Plugin-test.md | 11 +- test/plugin/agent-test-tools/pom.xml | 2 +- .../config/expectedData.yaml | 6 +- .../kafka-scenario/config/expectedData.yaml | 6 +- .../config/expectedData.yaml | 150 +++++++++--------- .../config/expectedData.yaml | 6 +- 10 files changed, 137 insertions(+), 138 deletions(-) rename apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/{ActiveMQConsumerInterceptor.java => MessageConsumerDequeueInterceptor.java} (67%) rename apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/{ActiveMQConsumerInterceptorTest.java => MessageConsumerDequeueInterceptorTest.java} (81%) diff --git a/CHANGES.md b/CHANGES.md index a67ef8636..0c0bdbdbf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,8 @@ Release Notes. * Correct the duration of the transaction span for Neo4J 4.x. * Plugin-test configuration.yml dependencies support docker service command field * Polish up rabbitmq-5.x plugin to fix missing broker tag on consumer side +* Polish up activemq plugin to fix missing broker tag on consumer side +* Enhance MQ plugin relative tests to check key tags not blank. #### Documentation diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/MessageConsumerDequeueInterceptor.java similarity index 67% rename from apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java rename to apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/MessageConsumerDequeueInterceptor.java index 4ee916205..868d57fff 100644 --- a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/MessageConsumerDequeueInterceptor.java @@ -31,7 +31,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceM import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; -public class ActiveMQConsumerInterceptor implements InstanceMethodsAroundInterceptor { +public class MessageConsumerDequeueInterceptor implements InstanceMethodsAroundInterceptor { public static final String OPERATE_NAME_PREFIX = "ActiveMQ/"; public static final String CONSUMER_OPERATE_NAME_SUFFIX = "/Consumer"; @@ -41,28 +41,48 @@ public class ActiveMQConsumerInterceptor implements InstanceMethodsAroundInterce public static final byte TEMP_QUEUE_TYPE = 5; @Override - public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, - MethodInterceptResult result) throws Throwable { + public void beforeMethod(final EnhancedInstance objInst, + final Method method, + final Object[] allArguments, + final Class[] argumentsTypes, + final MethodInterceptResult result) throws Throwable { + + } + + @Override + public Object afterMethod(final EnhancedInstance objInst, + final Method method, + final Object[] allArguments, + final Class[] argumentsTypes, + final Object ret) throws Throwable { + if (ret == null) { + return ret; + } + MessageDispatch messageDispatch = (MessageDispatch) ret; ContextCarrier contextCarrier = new ContextCarrier(); String url = (String) objInst.getSkyWalkingDynamicField(); - MessageDispatch messageDispatch = (MessageDispatch) allArguments[0]; AbstractSpan activeSpan = null; if (messageDispatch.getDestination().getDestinationType() == QUEUE_TYPE || messageDispatch.getDestination() .getDestinationType() == TEMP_QUEUE_TYPE) { - activeSpan = ContextManager.createEntrySpan(OPERATE_NAME_PREFIX + "Queue/" + messageDispatch.getDestination() - .getPhysicalName() + CONSUMER_OPERATE_NAME_SUFFIX, null) + activeSpan = ContextManager.createEntrySpan( + OPERATE_NAME_PREFIX + "Queue/" + messageDispatch.getDestination() + .getPhysicalName() + CONSUMER_OPERATE_NAME_SUFFIX, null) .start(System.currentTimeMillis()); Tags.MQ_BROKER.set(activeSpan, url); Tags.MQ_QUEUE.set(activeSpan, messageDispatch.getDestination().getPhysicalName()); } else if (messageDispatch.getDestination() .getDestinationType() == TOPIC_TYPE || messageDispatch.getDestination() .getDestinationType() == TEMP_TOPIC_TYPE) { - activeSpan = ContextManager.createEntrySpan(OPERATE_NAME_PREFIX + "Topic/" + messageDispatch.getDestination() - .getPhysicalName() + CONSUMER_OPERATE_NAME_SUFFIX, null) + activeSpan = ContextManager.createEntrySpan( + OPERATE_NAME_PREFIX + "Topic/" + messageDispatch.getDestination() + .getPhysicalName() + CONSUMER_OPERATE_NAME_SUFFIX, null) .start(System.currentTimeMillis()); Tags.MQ_BROKER.set(activeSpan, url); Tags.MQ_TOPIC.set(activeSpan, messageDispatch.getDestination().getPhysicalName()); } + if (activeSpan == null) { + return ret; + } activeSpan.setComponent(ComponentsDefine.ACTIVEMQ_CONSUMER); SpanLayer.asMQ(activeSpan); CarrierItem next = contextCarrier.items(); @@ -74,20 +94,17 @@ public class ActiveMQConsumerInterceptor implements InstanceMethodsAroundInterce } } ContextManager.extract(contextCarrier); - - } - - @Override - public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, - Object ret) throws Throwable { - ContextManager.stopSpan(); + // Close span immediately , as no chance to trace anything + ContextManager.stopSpan(activeSpan); return ret; - } @Override - public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, - Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().log(t); + public void handleMethodException(final EnhancedInstance objInst, + final Method method, + final Object[] allArguments, + final Class[] argumentsTypes, + final Throwable t) { + } } diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQConsumerInstrumentation.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQConsumerInstrumentation.java index 5cd6328a1..f6bf469b6 100644 --- a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQConsumerInstrumentation.java +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQConsumerInstrumentation.java @@ -34,10 +34,10 @@ import static org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentType * org.apache.activemq.ActiveMQMessageConsumer}. */ public class ActiveMQConsumerInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { - public static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQConsumerInterceptor"; + public static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.MessageConsumerDequeueInterceptor"; public static final String ENHANCE_CLASS_CONSUMER = "org.apache.activemq.ActiveMQMessageConsumer"; public static final String CONSTRUCTOR_INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQConsumerConstructorInterceptor"; - public static final String ENHANCE_METHOD_DISPATCH = "dispatch"; + public static final String ENHANCE_METHOD_DISPATCH = "dequeue"; public static final String CONSTRUCTOR_INTERCEPT_TYPE = "org.apache.activemq.ActiveMQSession"; @Override diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/MessageConsumerDequeueInterceptorTest.java similarity index 81% rename from apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java rename to apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/MessageConsumerDequeueInterceptorTest.java index b65f40bb1..8ee87677b 100644 --- a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/MessageConsumerDequeueInterceptorTest.java @@ -18,7 +18,6 @@ package org.apache.skywalking.apm.plugin.activemq; -import java.io.IOException; import java.util.List; import javax.jms.JMSException; import org.apache.activemq.command.ActiveMQDestination; @@ -33,7 +32,6 @@ import org.apache.skywalking.apm.agent.test.tools.SegmentStorage; import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint; import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner; import org.junit.Assert; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,7 +42,7 @@ import static org.hamcrest.CoreMatchers.is; @RunWith(PowerMockRunner.class) @PowerMockRunnerDelegate(TracingSegmentRunner.class) -public class ActiveMQConsumerInterceptorTest { +public class MessageConsumerDequeueInterceptorTest { @SegmentStoragePoint private SegmentStorage segmentStorage; @@ -52,14 +50,6 @@ public class ActiveMQConsumerInterceptorTest { @Rule public AgentServiceRule serviceRule = new AgentServiceRule(); - private ActiveMQConsumerInterceptor activeMQConsumerInterceptor; - - private Object[] arguments; - - private Class[] argumentType; - - private MessageDispatch messageDispatch; - public class Des extends ActiveMQDestination { @Override @@ -122,25 +112,14 @@ public class ActiveMQConsumerInterceptorTest { } }; - @Before - public void setUp() throws IOException { - activeMQConsumerInterceptor = new ActiveMQConsumerInterceptor(); - messageDispatch = new MessageDispatch(); - + @Test + public void testConsumerWithoutMessage() throws Throwable { + MessageDispatch messageDispatch = new MessageDispatch(); Des des = new Des(); des.setPhysicalName("test"); messageDispatch.setDestination(des); - Message msg = new Msg(); - messageDispatch.setMessage(msg); - arguments = new Object[] {messageDispatch}; - argumentType = null; - } - - @Test - public void testConsumerWithoutMessage() throws Throwable { - activeMQConsumerInterceptor.beforeMethod(enhancedInstance, null, arguments, null, null); - activeMQConsumerInterceptor.afterMethod(enhancedInstance, null, arguments, null, null); - + messageDispatch.setMessage(new Msg()); + new MessageConsumerDequeueInterceptor().afterMethod(enhancedInstance, null, new Object[0], null, messageDispatch); List traceSegments = segmentStorage.getTraceSegments(); Assert.assertThat(traceSegments.size(), is(1)); } diff --git a/docs/en/setup/service-agent/java-agent/Plugin-test.md b/docs/en/setup/service-agent/java-agent/Plugin-test.md index 55d529d96..a2df65cd5 100644 --- a/docs/en/setup/service-agent/java-agent/Plugin-test.md +++ b/docs/en/setup/service-agent/java-agent/Plugin-test.md @@ -202,11 +202,12 @@ as the version number, which will be changed in the test for each version. **Operator for String** -| Operator | Description | -| :--- | :--- | -| `not null` | Not null | -| `null` | Null or empty String | -| `eq` | Equal(default) | +| Operator | Description | +|:------------|:--------------------------------------------------------------------------------------------------------------| +| `not null` | Not null | +| `not blank` | Not blank ,it's recommended for String type field as the default value maybe blank string, such as span tags | +| `null` | Null or empty String | +| `eq` | Equal(default) | **Expected Data Format Of The Segment** ```yml diff --git a/test/plugin/agent-test-tools/pom.xml b/test/plugin/agent-test-tools/pom.xml index c22023450..c817cd03e 100644 --- a/test/plugin/agent-test-tools/pom.xml +++ b/test/plugin/agent-test-tools/pom.xml @@ -35,7 +35,7 @@ pom - 24270f8f1ee1cb9186ede5202ff1c4ae3d2d482a + 7f20775e0631356c4823d9372b09d653db0e6540 ${project.basedir}/target/agent-test-tools https://github.com/apache/skywalking-agent-test-tool.git diff --git a/test/plugin/scenarios/activemq-scenario/config/expectedData.yaml b/test/plugin/scenarios/activemq-scenario/config/expectedData.yaml index 918ffb1f5..3d2e17752 100644 --- a/test/plugin/scenarios/activemq-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/activemq-scenario/config/expectedData.yaml @@ -30,7 +30,7 @@ segmentItems: spanType: Exit peer: not null tags: - - {key: mq.broker, value: not null} + - {key: mq.broker, value: not blank} - {key: mq.queue, value: test} skipAnalysis: 'false' - operationName: GET:/activemq-scenario/case/activemq @@ -61,9 +61,9 @@ segmentItems: spanType: Entry peer: '' tags: - - {key: mq.broker, value: not null} + - {key: mq.broker, value: not blank} - {key: mq.queue, value: test} - - {key: transmission.latency, value: not null} + - {key: transmission.latency, value: ge 0} refs: - {parentEndpoint: GET:/activemq-scenario/case/activemq, networkAddress: not null, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, diff --git a/test/plugin/scenarios/kafka-scenario/config/expectedData.yaml b/test/plugin/scenarios/kafka-scenario/config/expectedData.yaml index 6d549cb5d..2f9964f7f 100644 --- a/test/plugin/scenarios/kafka-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/kafka-scenario/config/expectedData.yaml @@ -162,7 +162,7 @@ segmentItems: tags: - {key: mq.broker, value: 'kafka-server:9092'} - {key: mq.topic, value: test} - - {key: transmission.latency, value: not null} + - {key: transmission.latency, value: ge 0} refs: - {parentEndpoint: GET:/case/kafka-case, networkAddress: 'kafka-server:9092', refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not @@ -198,8 +198,8 @@ segmentItems: tags: - {key: mq.broker, value: 'kafka-server:9092'} - {key: mq.topic, value: test.} - - {key: transmission.latency, value: not null} - - {key: transmission.latency, value: not null} + - {key: transmission.latency, value: ge 0} + - {key: transmission.latency, value: ge 0} refs: - {parentEndpoint: GET:/case/kafka-case, networkAddress: 'kafka-server:9092', refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, parentServiceInstance: not diff --git a/test/plugin/scenarios/nats-2.14.x-2.15.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/nats-2.14.x-2.15.x-scenario/config/expectedData.yaml index facf8d25d..cb0ac4988 100644 --- a/test/plugin/scenarios/nats-2.14.x-2.15.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/nats-2.14.x-2.15.x-scenario/config/expectedData.yaml @@ -32,8 +32,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: Nats/Pub/$JS.API.STREAM.INFO.scenario-8080-test-stream-3 @@ -49,8 +49,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: @@ -73,8 +73,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: Nats/Pub/$JS.API.STREAM.CREATE.scenario-8080-test-stream-3 @@ -90,8 +90,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/Enqueue/$JS.API.STREAM.CREATE.scenario-8080-test-stream-3, @@ -113,8 +113,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: Nats/Pub/$JS.API.CONSUMER.CREATE.scenario-8080-test-stream-3 @@ -130,8 +130,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/Enqueue/$JS.API.CONSUMER.CREATE.scenario-8080-test-stream-3, @@ -153,8 +153,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: Nats/Pub/$JS.API.STREAM.INFO.scenario-8080-test-stream-4 @@ -170,8 +170,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/Enqueue/$JS.API.STREAM.INFO.scenario-8080-test-stream-4, @@ -193,8 +193,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: Nats/Pub/$JS.API.STREAM.CREATE.scenario-8080-test-stream-4 @@ -210,8 +210,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/Enqueue/$JS.API.STREAM.CREATE.scenario-8080-test-stream-4, @@ -233,8 +233,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/Enqueue/$JS.API.STREAM.NAMES, networkAddress: '', @@ -256,8 +256,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: Nats/Pub/Enqueue/$JS.API.STREAM.NAMES @@ -273,8 +273,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: Nats/Pub/$JS.API.CONSUMER.INFO.scenario-8080-test-stream-4.scenario-8080-test-stream-4-durable @@ -290,8 +290,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/Enqueue/$JS.API.CONSUMER.INFO.scenario-8080-test-stream-4.scenario-8080-test-stream-4-durable, @@ -313,8 +313,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: Nats/Pub/$JS.API.CONSUMER.DURABLE.CREATE.scenario-8080-test-stream-4.scenario-8080-test-stream-4-durable @@ -330,8 +330,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/Enqueue/$JS.API.CONSUMER.DURABLE.CREATE.scenario-8080-test-stream-4.scenario-8080-test-stream-4-durable, @@ -353,8 +353,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/Enqueue/$JS.API.CONSUMER.MSG.NEXT.scenario-8080-test-stream-4.scenario-8080-test-stream-4-durable, @@ -376,8 +376,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - segmentId: not null spans: - operationName: HEAD:/nats/check @@ -411,7 +411,7 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: 'GET:/nats/start', networkAddress: '', refType: CrossThread, @@ -433,9 +433,9 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: transmission.latency, value: not null} + - {key: transmission.latency, value: ge 0} - {key: sid, value: '1'} - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/scenario-8080-subject-1, networkAddress: 'nats://nats-server:4222', @@ -457,8 +457,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: 'GET:/nats/start', networkAddress: '', refType: CrossThread, @@ -480,7 +480,7 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Sub/scenario-8080-subject-2, networkAddress: '', refType: CrossThread, @@ -502,7 +502,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - operationName: Nats/Sub/scenario-8080-subject-2 operationId: 0 @@ -517,10 +517,10 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: transmission.latency, value: not null} - - {key: reply_to, value: not null} + - {key: transmission.latency, value: ge 0} + - {key: reply_to, value: not blank} - {key: sid, value: '1'} - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/scenario-8080-subject-2, networkAddress: 'nats://nats-server:4222', @@ -542,9 +542,9 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: transmission.latency, value: not null} + - {key: transmission.latency, value: ge 0} - {key: sid, value: '1'} - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: not null, @@ -567,8 +567,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: 'GET:/nats/start', networkAddress: '', refType: CrossThread, @@ -590,7 +590,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - operationName: Nats/Sub/scenario-8080-subject-3 operationId: 0 @@ -605,10 +605,10 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: transmission.latency, value: not null} - - {key: reply_to, value: not null} + - {key: transmission.latency, value: ge 0} + - {key: reply_to, value: not blank} - {key: sid, value: '2'} - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: @@ -631,7 +631,7 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Sub/scenario-8080-subject-3, networkAddress: '', refType: CrossThread, @@ -653,8 +653,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: 'GET:/nats/start', networkAddress: '', refType: CrossThread, @@ -676,8 +676,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: 'GET:/nats/start', networkAddress: '', refType: CrossThread, @@ -699,10 +699,10 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: transmission.latency, value: not null} - - {key: reply_to, value: not null} + - {key: transmission.latency, value: ge 0} + - {key: reply_to, value: not blank} - {key: sid, value: '2'} - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: Nats/Pub/scenario-8080-subject-4, networkAddress: 'nats://nats-server:4222', @@ -724,7 +724,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: mq.queue, value: not null} + - {key: mq.queue, value: not blank} - operationName: Nats/Pub/Enqueue/scenario-8080-subject-2 operationId: 0 parentSpanId: 0 @@ -738,8 +738,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - operationName: Nats/Pub/Enqueue/$JS.API.STREAM.INFO.scenario-8080-test-stream-3 operationId: 0 @@ -754,8 +754,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - operationName: Nats/Pub/Enqueue/scenario-8080-subject-3 operationId: 0 parentSpanId: 0 @@ -769,8 +769,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - operationName: Nats/Pub/Enqueue/$JS.API.STREAM.INFO.scenario-8080-test-stream-4 operationId: 0 parentSpanId: 0 @@ -784,8 +784,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - operationName: Nats/Pub/Enqueue/scenario-8080-subject-4 operationId: 0 parentSpanId: 0 @@ -799,8 +799,8 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - operationName: GET:/nats/start operationId: 0 parentSpanId: -1 @@ -832,8 +832,8 @@ segmentItems: peer: nats://nats-server:4222 skipAnalysis: false tags: - - {key: reply_to, value: not null} - - {key: mq.queue, value: not null} + - {key: reply_to, value: not blank} + - {key: mq.queue, value: not blank} - {key: mq.broker, value: 'nats://nats-server:4222'} refs: - {parentEndpoint: 'GET:/nats/start', networkAddress: '', refType: CrossThread, diff --git a/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml b/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml index ba35bc861..8ce7fb0d3 100644 --- a/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml @@ -30,10 +30,10 @@ segmentItems: spanType: Entry peer: '' tags: - - {key: mq.broker, value: not null} + - {key: mq.broker, value: not blank} - {key: mq.topic, value: ''} - {key: mq.queue, value: test} - - {key: transmission.latency, value: not null} + - {key: transmission.latency, value: ge 0} refs: - {parentEndpoint: GET:/rabbitmq-scenario/case/rabbitmq, networkAddress: not null, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not @@ -52,7 +52,7 @@ segmentItems: spanType: Exit peer: not null tags: - - {key: mq.broker, value: not null} + - {key: mq.broker, value: not blank} - {key: mq.queue, value: test} - {key: mq.topic, value: ''} skipAnalysis: 'false'