Skip to content

Commit 1962e89

Browse files
committed
fix tests
1 parent d2c630b commit 1962e89

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/test/groovy/RabbitMQTest.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import static datadog.trace.bootstrap.instrumentation.api.ServiceNameSources.MESSAGE_BROKER_SPLIT_BY_DESTINATION
2+
13
import com.rabbitmq.client.AMQP
24
import com.rabbitmq.client.Channel
35
import com.rabbitmq.client.ConnectionFactory
@@ -773,6 +775,7 @@ abstract class RabbitMQTestBase extends VersionedNamingTestBase {
773775
measured true
774776
775777
final boolean isV0 = version() == 0
778+
final boolean isSplitByDestination = splitByDestination()
776779
777780
tags {
778781
"$Tags.COMPONENT" "rabbitmq-amqp"
@@ -829,7 +832,9 @@ abstract class RabbitMQTestBase extends VersionedNamingTestBase {
829832
if ({ isDataStreamsEnabled() }) {
830833
"$DDTags.PATHWAY_HASH" { String }
831834
}
832-
if (isV0) {
835+
if (distributedRootSpan && isSplitByDestination) {
836+
serviceNameSource MESSAGE_BROKER_SPLIT_BY_DESTINATION
837+
} else if (isV0) {
833838
// in v0 the service name is always set to DD_SERVICE while it should just be unset as v1
834839
// this is a buggy behaviour that could not be easily fixed.
835840
serviceNameSource "rabbitmq-amqp"

0 commit comments

Comments
 (0)