File tree Expand file tree Collapse file tree
dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/test/groovy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import static datadog.trace.bootstrap.instrumentation.api.ServiceNameSources.MESSAGE_BROKER_SPLIT_BY_DESTINATION
2+
13import com.rabbitmq.client.AMQP
24import com.rabbitmq.client.Channel
35import 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"
You can’t perform that action at this time.
0 commit comments