diff --git a/dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/AbstractSqsInstrumentation.java b/dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/AbstractSqsInstrumentation.java index 56fd9f5364b..7db3c720b72 100644 --- a/dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/AbstractSqsInstrumentation.java +++ b/dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/AbstractSqsInstrumentation.java @@ -1,9 +1,14 @@ package datadog.trace.instrumentation.aws.v1.sqs; import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.util.Strings; public abstract class AbstractSqsInstrumentation extends InstrumenterModule.Tracing { public AbstractSqsInstrumentation() { super("sqs", "aws-sdk"); } + + public AbstractSqsInstrumentation(String... additionalNames) { + super("sqs", Strings.concat(additionalNames, "aws-sdk")); + } } diff --git a/dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/SqsJmsMessageInstrumentation.java b/dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/SqsJmsMessageInstrumentation.java index 1230881e728..9d43c3229b4 100644 --- a/dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/SqsJmsMessageInstrumentation.java +++ b/dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/SqsJmsMessageInstrumentation.java @@ -21,6 +21,10 @@ public class SqsJmsMessageInstrumentation extends AbstractSqsInstrumentation implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + public SqsJmsMessageInstrumentation() { + super("jms"); + } + @Override public String instrumentedType() { return "com.amazon.sqs.javamessaging.message.SQSMessage"; diff --git a/dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/AbstractSqsInstrumentation.java b/dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/AbstractSqsInstrumentation.java index 4e7665a4c7f..53e711db7ac 100644 --- a/dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/AbstractSqsInstrumentation.java +++ b/dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/AbstractSqsInstrumentation.java @@ -1,9 +1,14 @@ package datadog.trace.instrumentation.aws.v2.sqs; import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.util.Strings; public abstract class AbstractSqsInstrumentation extends InstrumenterModule.Tracing { public AbstractSqsInstrumentation() { super("sqs", "aws-sdk"); } + + public AbstractSqsInstrumentation(String... additionalNames) { + super("sqs", Strings.concat(additionalNames, "aws-sdk")); + } } diff --git a/dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsJmsMessageInstrumentation.java b/dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsJmsMessageInstrumentation.java index 005700c037c..28c488fd896 100644 --- a/dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsJmsMessageInstrumentation.java +++ b/dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsJmsMessageInstrumentation.java @@ -21,6 +21,10 @@ public class SqsJmsMessageInstrumentation extends AbstractSqsInstrumentation implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + public SqsJmsMessageInstrumentation() { + super("jms"); + } + @Override public String instrumentedType() { return "com.amazon.sqs.javamessaging.message.SQSMessage"; diff --git a/dd-java-agent/instrumentation/jakarta-jms/src/main/java/datadog/trace/instrumentation/jms/JakartaJmsModule.java b/dd-java-agent/instrumentation/jakarta-jms/src/main/java/datadog/trace/instrumentation/jms/JakartaJmsModule.java index 4c09fa76324..7b8ead719b5 100644 --- a/dd-java-agent/instrumentation/jakarta-jms/src/main/java/datadog/trace/instrumentation/jms/JakartaJmsModule.java +++ b/dd-java-agent/instrumentation/jakarta-jms/src/main/java/datadog/trace/instrumentation/jms/JakartaJmsModule.java @@ -9,7 +9,7 @@ @AutoService(InstrumenterModule.class) public class JakartaJmsModule extends JavaxJmsModule { public JakartaJmsModule() { - super("jakarta", "jakarta-jms"); + super("jakarta", "jakarta-jms", "jms"); } @Override diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/AbstractTibcoInstrumentation.java b/dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/AbstractTibcoInstrumentation.java index b4c020ddf49..0e5c427c636 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/AbstractTibcoInstrumentation.java +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/AbstractTibcoInstrumentation.java @@ -2,6 +2,7 @@ import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.util.Strings; import java.util.HashMap; import java.util.Map; @@ -10,6 +11,10 @@ public AbstractTibcoInstrumentation() { super("tibco", "tibco_bw"); } + public AbstractTibcoInstrumentation(String... additionalNames) { + super("tibco", Strings.concat(additionalNames, "tibco_bw")); + } + @Override protected boolean defaultEnabled() { return false; diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/JmsMessageGetterInstrumentation.java b/dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/JmsMessageGetterInstrumentation.java index dd447d9f86f..f553abd1c46 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/JmsMessageGetterInstrumentation.java +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/JmsMessageGetterInstrumentation.java @@ -16,6 +16,10 @@ public class JmsMessageGetterInstrumentation extends AbstractTibcoInstrumentation implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + public JmsMessageGetterInstrumentation() { + super("jms"); + } + @Override public String instrumentedType() { return "com.tibco.bw.jms.shared.primitives.SingleJMSMessageGetter"; diff --git a/internal-api/src/main/java/datadog/trace/util/Strings.java b/internal-api/src/main/java/datadog/trace/util/Strings.java index 2fea0e107e5..ec7cfc230a6 100644 --- a/internal-api/src/main/java/datadog/trace/util/Strings.java +++ b/internal-api/src/main/java/datadog/trace/util/Strings.java @@ -220,4 +220,13 @@ public static String toHexString(byte[] value) { } return new String(bytes, US_ASCII); } + + public static String[] concat(String[] arr, String... extra) { + if (arr.length == 0) return extra; + if (extra.length == 0) return arr; + String[] result = new String[arr.length + extra.length]; + System.arraycopy(arr, 0, result, 0, arr.length); + System.arraycopy(extra, 0, result, arr.length, extra.length); + return result; + } }