JMS1/2: change resource names according to PR comments
MODIFY
dd-java-agent/instrumentation/jms-1/src/main/java/datadog/trace/instrumentation/jms1/JMS1MessageConsumerInstrumentation.java
dd-java-agent/instrumentation/jms-1/src/main/java/datadog/trace/instrumentation/jms1/JMS1MessageConsumerInstrumentation.java
@@ -88,14 +88,12 @@ public final class JMS1MessageConsumerInstrumentation extends Instrumenter.Confi
.withTag("span.origin.type", consumer.getClass().getName())
.withStartTimestamp(TimeUnit.MILLISECONDS.toMicros(startTime));
- String resourceNamePrefix = "JMS " + method.getName() + ": ";
if (message == null) {
- spanBuilder = spanBuilder.withTag(DDTags.RESOURCE_NAME, resourceNamePrefix + "no message");
+ spanBuilder = spanBuilder.withTag(DDTags.RESOURCE_NAME, "JMS " + method.getName());
} else {
spanBuilder =
spanBuilder.withTag(
- DDTags.RESOURCE_NAME,
- resourceNamePrefix + "consumed from " + toResourceName(message, null));
+ DDTags.RESOURCE_NAME, "Consumed from " + toResourceName(message, null));
final SpanContext extractedContext =
GlobalTracer.get()

MODIFY
dd-java-agent/instrumentation/jms-1/src/test/groovy/JMS1Test.groovy
dd-java-agent/instrumentation/jms-1/src/test/groovy/JMS1Test.groovy
@@ -55,7 +55,7 @@ class JMS1Test extends AgentTestRunner {
childOf TEST_WRITER.firstTrace().get(2)
serviceName "jms"
operationName "jms.consume"
- resourceName "JMS receive: consumed from $jmsResourceName"
+ resourceName "Consumed from $jmsResourceName"
spanType DDSpanTypes.MESSAGE_PRODUCER
errored false
@@ -151,7 +151,7 @@ class JMS1Test extends AgentTestRunner {
parent()
serviceName "jms"
operationName "jms.consume"
- resourceName "JMS receiveNoWait: no message"
+ resourceName "JMS receiveNoWait"
spanType DDSpanTypes.MESSAGE_PRODUCER
errored false
@@ -190,7 +190,7 @@ class JMS1Test extends AgentTestRunner {
parent()
serviceName "jms"
operationName "jms.consume"
- resourceName "JMS receive: no message"
+ resourceName "JMS receive"
spanType DDSpanTypes.MESSAGE_PRODUCER
errored false

MODIFY
dd-java-agent/instrumentation/jms-2/src/main/java/datadog/trace/instrumentation/jms2/JMS2MessageConsumerInstrumentation.java
dd-java-agent/instrumentation/jms-2/src/main/java/datadog/trace/instrumentation/jms2/JMS2MessageConsumerInstrumentation.java
@@ -88,14 +88,12 @@ public final class JMS2MessageConsumerInstrumentation extends Instrumenter.Confi
.withTag("span.origin.type", consumer.getClass().getName())
.withStartTimestamp(TimeUnit.MILLISECONDS.toMicros(startTime));
- String resourceNamePrefix = "JMS " + method.getName() + ": ";
if (message == null) {
- spanBuilder = spanBuilder.withTag(DDTags.RESOURCE_NAME, resourceNamePrefix + "no message");
+ spanBuilder = spanBuilder.withTag(DDTags.RESOURCE_NAME, "JMS " + method.getName());
} else {
spanBuilder =
spanBuilder.withTag(
- DDTags.RESOURCE_NAME,
- resourceNamePrefix + "consumed from " + toResourceName(message, null));
+ DDTags.RESOURCE_NAME, "Consumed from " + toResourceName(message, null));
final SpanContext extractedContext =
GlobalTracer.get()

MODIFY
dd-java-agent/instrumentation/jms-2/src/test/groovy/JMS2Test.groovy
dd-java-agent/instrumentation/jms-2/src/test/groovy/JMS2Test.groovy
@@ -88,7 +88,7 @@ class JMS2Test extends AgentTestRunner {
childOf TEST_WRITER.firstTrace().get(0)
serviceName "jms"
operationName "jms.consume"
- resourceName "JMS receive: consumed from $jmsResourceName"
+ resourceName "Consumed from $jmsResourceName"
spanType DDSpanTypes.MESSAGE_PRODUCER
errored false
@@ -185,7 +185,7 @@ class JMS2Test extends AgentTestRunner {
parent()
serviceName "jms"
operationName "jms.consume"
- resourceName "JMS receiveNoWait: no message"
+ resourceName "JMS receiveNoWait"
spanType DDSpanTypes.MESSAGE_PRODUCER
errored false
@@ -224,7 +224,7 @@ class JMS2Test extends AgentTestRunner {
parent()
serviceName "jms"
operationName "jms.consume"
- resourceName "JMS receive: no message"
+ resourceName "JMS receive"
spanType DDSpanTypes.MESSAGE_PRODUCER
errored false

JMS1/2: change resource names according to PR comments