|
@@ -56,7 +56,7 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
broker.stop()
|
|
|
}
|
|
|
|
|
|
- def "sending a message to #destinationName #destinationType generates spans"() {
|
|
|
+ def "sending a message to #destinationName generates spans"() {
|
|
|
setup:
|
|
|
def producer = session.createProducer(destination)
|
|
|
def consumer = session.createConsumer(destination)
|
|
@@ -79,7 +79,7 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
name "producer parent"
|
|
|
hasNoParent()
|
|
|
}
|
|
|
- producerSpan(it, 1, destinationType, destinationName, span(0))
|
|
|
+ producerSpan(it, 1, destinationName, span(0))
|
|
|
|
|
|
producerSpanData = span(1)
|
|
|
}
|
|
@@ -88,7 +88,7 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
name "consumer parent"
|
|
|
hasNoParent()
|
|
|
}
|
|
|
- consumerSpan(it, 1, destinationType, destinationName, messageId, "receive", span(0), producerSpanData)
|
|
|
+ consumerSpan(it, 1, destinationName, messageId, "receive", span(0), producerSpanData)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -97,14 +97,14 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
consumer.close()
|
|
|
|
|
|
where:
|
|
|
- destination | destinationType | destinationName
|
|
|
- session.createQueue("someQueue") | "queue" | "someQueue"
|
|
|
- session.createTopic("someTopic") | "topic" | "someTopic"
|
|
|
- session.createTemporaryQueue() | "queue" | "(temporary)"
|
|
|
- session.createTemporaryTopic() | "topic" | "(temporary)"
|
|
|
+ destination | destinationName
|
|
|
+ session.createQueue("someQueue") | "someQueue"
|
|
|
+ session.createTopic("someTopic") | "someTopic"
|
|
|
+ session.createTemporaryQueue() | "(temporary)"
|
|
|
+ session.createTemporaryTopic() | "(temporary)"
|
|
|
}
|
|
|
|
|
|
- def "sending to a MessageListener on #destinationName #destinationType generates a span"() {
|
|
|
+ def "sending to a MessageListener on #destinationName generates a span"() {
|
|
|
setup:
|
|
|
def lock = new CountDownLatch(1)
|
|
|
def messageRef = new AtomicReference<TextMessage>()
|
|
@@ -124,8 +124,8 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
expect:
|
|
|
assertTraces(1) {
|
|
|
trace(0, 2) {
|
|
|
- producerSpan(it, 0, destinationType, destinationName)
|
|
|
- consumerSpan(it, 1, destinationType, destinationName, messageRef.get().getJMSMessageID(), "process", span(0))
|
|
|
+ producerSpan(it, 0, destinationName)
|
|
|
+ consumerSpan(it, 1, destinationName, messageRef.get().getJMSMessageID(), "process", span(0))
|
|
|
}
|
|
|
}
|
|
|
// This check needs to go after all traces have been accounted for
|
|
@@ -136,14 +136,14 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
consumer.close()
|
|
|
|
|
|
where:
|
|
|
- destination | destinationType | destinationName
|
|
|
- session.createQueue("someQueue") | "queue" | "someQueue"
|
|
|
- session.createTopic("someTopic") | "topic" | "someTopic"
|
|
|
- session.createTemporaryQueue() | "queue" | "(temporary)"
|
|
|
- session.createTemporaryTopic() | "topic" | "(temporary)"
|
|
|
+ destination | destinationName
|
|
|
+ session.createQueue("someQueue") | "someQueue"
|
|
|
+ session.createTopic("someTopic") | "someTopic"
|
|
|
+ session.createTemporaryQueue() | "(temporary)"
|
|
|
+ session.createTemporaryTopic() | "(temporary)"
|
|
|
}
|
|
|
|
|
|
- def "failing to receive message with receiveNoWait on #destinationName #destinationType works"() {
|
|
|
+ def "failing to receive message with receiveNoWait on #destinationName works"() {
|
|
|
setup:
|
|
|
def consumer = session.createConsumer(destination)
|
|
|
|
|
@@ -159,12 +159,12 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
consumer.close()
|
|
|
|
|
|
where:
|
|
|
- destination | destinationType | destinationName
|
|
|
- session.createQueue("someQueue") | "queue" | "someQueue"
|
|
|
- session.createTopic("someTopic") | "topic" | "someTopic"
|
|
|
+ destination | destinationName
|
|
|
+ session.createQueue("someQueue") | "someQueue"
|
|
|
+ session.createTopic("someTopic") | "someTopic"
|
|
|
}
|
|
|
|
|
|
- def "failing to receive message with wait(timeout) on #destinationName #destinationType works"() {
|
|
|
+ def "failing to receive message with wait(timeout) on #destinationName works"() {
|
|
|
setup:
|
|
|
def consumer = session.createConsumer(destination)
|
|
|
|
|
@@ -180,12 +180,12 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
consumer.close()
|
|
|
|
|
|
where:
|
|
|
- destination | destinationType | destinationName
|
|
|
- session.createQueue("someQueue") | "queue" | "someQueue"
|
|
|
- session.createTopic("someTopic") | "topic" | "someTopic"
|
|
|
+ destination | destinationName
|
|
|
+ session.createQueue("someQueue") | "someQueue"
|
|
|
+ session.createTopic("someTopic") | "someTopic"
|
|
|
}
|
|
|
|
|
|
- def "sending a read-only message to #destinationName #destinationType fails"() {
|
|
|
+ def "sending a read-only message to #destinationName fails"() {
|
|
|
setup:
|
|
|
def producer = session.createProducer(destination)
|
|
|
def consumer = session.createConsumer(destination)
|
|
@@ -208,10 +208,10 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
// The consumer span will also not be linked to the parent.
|
|
|
assertTraces(2) {
|
|
|
trace(0, 1) {
|
|
|
- producerSpan(it, 0, destinationType, destinationName)
|
|
|
+ producerSpan(it, 0, destinationName)
|
|
|
}
|
|
|
trace(1, 1) {
|
|
|
- consumerSpan(it, 0, destinationType, destinationName, "", "receive", null)
|
|
|
+ consumerSpan(it, 0, destinationName, "", "receive", null)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -220,14 +220,14 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
consumer.close()
|
|
|
|
|
|
where:
|
|
|
- destination | destinationType | destinationName
|
|
|
- session.createQueue("someQueue") | "queue" | "someQueue"
|
|
|
- session.createTopic("someTopic") | "topic" | "someTopic"
|
|
|
- session.createTemporaryQueue() | "queue" | "(temporary)"
|
|
|
- session.createTemporaryTopic() | "topic" | "(temporary)"
|
|
|
+ destination | destinationName
|
|
|
+ session.createQueue("someQueue") | "someQueue"
|
|
|
+ session.createTopic("someTopic") | "someTopic"
|
|
|
+ session.createTemporaryQueue() | "(temporary)"
|
|
|
+ session.createTemporaryTopic() | "(temporary)"
|
|
|
}
|
|
|
|
|
|
- def "sending a message to #destinationName #destinationType with explicit destination propagates context"() {
|
|
|
+ def "sending a message to #destinationName with explicit destination propagates context"() {
|
|
|
given:
|
|
|
def producer = session.createProducer(null)
|
|
|
def consumer = session.createConsumer(destination)
|
|
@@ -255,8 +255,8 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
name "parent"
|
|
|
hasNoParent()
|
|
|
}
|
|
|
- producerSpan(it, 1, destinationType, destinationName, span(0))
|
|
|
- consumerSpan(it, 2, destinationType, destinationName, messageRef.get().getJMSMessageID(), "process", span(1))
|
|
|
+ producerSpan(it, 1, destinationName, span(0))
|
|
|
+ consumerSpan(it, 2, destinationName, messageRef.get().getJMSMessageID(), "process", span(1))
|
|
|
}
|
|
|
}
|
|
|
// This check needs to go after all traces have been accounted for
|
|
@@ -267,17 +267,16 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
consumer.close()
|
|
|
|
|
|
where:
|
|
|
- destination | destinationType | destinationName
|
|
|
- session.createQueue("someQueue") | "queue" | "someQueue"
|
|
|
- session.createTopic("someTopic") | "topic" | "someTopic"
|
|
|
- session.createTemporaryQueue() | "queue" | "(temporary)"
|
|
|
- session.createTemporaryTopic() | "topic" | "(temporary)"
|
|
|
+ destination | destinationName
|
|
|
+ session.createQueue("someQueue") | "someQueue"
|
|
|
+ session.createTopic("someTopic") | "someTopic"
|
|
|
+ session.createTemporaryQueue() | "(temporary)"
|
|
|
+ session.createTemporaryTopic() | "(temporary)"
|
|
|
}
|
|
|
|
|
|
def "capture message header as span attribute"() {
|
|
|
setup:
|
|
|
def destinationName = "someQueue"
|
|
|
- def destinationType = "queue"
|
|
|
def destination = session.createQueue(destinationName)
|
|
|
def producer = session.createProducer(destination)
|
|
|
def consumer = session.createConsumer(destination)
|
|
@@ -303,7 +302,7 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
name "producer parent"
|
|
|
hasNoParent()
|
|
|
}
|
|
|
- producerSpan(it, 1, destinationType, destinationName, span(0), true)
|
|
|
+ producerSpan(it, 1, destinationName, span(0), true)
|
|
|
|
|
|
producerSpanData = span(1)
|
|
|
}
|
|
@@ -312,7 +311,7 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
name "consumer parent"
|
|
|
hasNoParent()
|
|
|
}
|
|
|
- consumerSpan(it, 1, destinationType, destinationName, messageId, "receive", span(0), producerSpanData, true)
|
|
|
+ consumerSpan(it, 1, destinationName, messageId, "receive", span(0), producerSpanData, true)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -321,7 +320,7 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
consumer.close()
|
|
|
}
|
|
|
|
|
|
- static producerSpan(TraceAssert trace, int index, String destinationType, String destinationName, SpanData parentSpan = null, boolean testHeaders = false) {
|
|
|
+ static producerSpan(TraceAssert trace, int index, String destinationName, SpanData parentSpan = null, boolean testHeaders = false) {
|
|
|
trace.span(index) {
|
|
|
name destinationName + " send"
|
|
|
kind PRODUCER
|
|
@@ -333,7 +332,6 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
attributes {
|
|
|
"$SemanticAttributes.MESSAGING_SYSTEM" "jms"
|
|
|
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName
|
|
|
- "$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType
|
|
|
if (destinationName == "(temporary)") {
|
|
|
"$SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY" true
|
|
|
}
|
|
@@ -349,7 +347,7 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
// passing messageId = null will verify message.id is not captured,
|
|
|
// passing messageId = "" will verify message.id is captured (but won't verify anything about the value),
|
|
|
// any other value for messageId will verify that message.id is captured and has that same value
|
|
|
- static consumerSpan(TraceAssert trace, int index, String destinationType, String destinationName, String messageId, String operation, SpanData parentSpan, SpanData linkedSpan = null, boolean testHeaders = false) {
|
|
|
+ static consumerSpan(TraceAssert trace, int index, String destinationName, String messageId, String operation, SpanData parentSpan, SpanData linkedSpan = null, boolean testHeaders = false) {
|
|
|
trace.span(index) {
|
|
|
name destinationName + " " + operation
|
|
|
kind CONSUMER
|
|
@@ -366,7 +364,6 @@ class Jms1Test extends AgentInstrumentationSpecification {
|
|
|
attributes {
|
|
|
"$SemanticAttributes.MESSAGING_SYSTEM" "jms"
|
|
|
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName
|
|
|
- "$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType
|
|
|
"$SemanticAttributes.MESSAGING_OPERATION" operation
|
|
|
if (messageId != null) {
|
|
|
//In some tests we don't know exact messageId, so we pass "" and verify just the existence of the attribute
|