Skip to content

Commit 6e16a7a

Browse files
authored
add jms as an extra integration name where there is JMS involved (#8933)
* add jms as an extra integration name where there is JMS involved * address comments * keep parameters to super exlicit (at the cost of a little bit of duplication)
1 parent f48216d commit 6e16a7a

File tree

8 files changed

+37
-1
lines changed

8 files changed

+37
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package datadog.trace.instrumentation.aws.v1.sqs;
22

33
import datadog.trace.agent.tooling.InstrumenterModule;
4+
import datadog.trace.util.Strings;
45

56
public abstract class AbstractSqsInstrumentation extends InstrumenterModule.Tracing {
67
public AbstractSqsInstrumentation() {
78
super("sqs", "aws-sdk");
89
}
10+
11+
public AbstractSqsInstrumentation(String... additionalNames) {
12+
super("sqs", Strings.concat(additionalNames, "aws-sdk"));
13+
}
914
}

dd-java-agent/instrumentation/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/SqsJmsMessageInstrumentation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
public class SqsJmsMessageInstrumentation extends AbstractSqsInstrumentation
2222
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {
2323

24+
public SqsJmsMessageInstrumentation() {
25+
super("jms");
26+
}
27+
2428
@Override
2529
public String instrumentedType() {
2630
return "com.amazon.sqs.javamessaging.message.SQSMessage";
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package datadog.trace.instrumentation.aws.v2.sqs;
22

33
import datadog.trace.agent.tooling.InstrumenterModule;
4+
import datadog.trace.util.Strings;
45

56
public abstract class AbstractSqsInstrumentation extends InstrumenterModule.Tracing {
67
public AbstractSqsInstrumentation() {
78
super("sqs", "aws-sdk");
89
}
10+
11+
public AbstractSqsInstrumentation(String... additionalNames) {
12+
super("sqs", Strings.concat(additionalNames, "aws-sdk"));
13+
}
914
}

dd-java-agent/instrumentation/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsJmsMessageInstrumentation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
public class SqsJmsMessageInstrumentation extends AbstractSqsInstrumentation
2222
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {
2323

24+
public SqsJmsMessageInstrumentation() {
25+
super("jms");
26+
}
27+
2428
@Override
2529
public String instrumentedType() {
2630
return "com.amazon.sqs.javamessaging.message.SQSMessage";

dd-java-agent/instrumentation/jakarta-jms/src/main/java/datadog/trace/instrumentation/jms/JakartaJmsModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@AutoService(InstrumenterModule.class)
1010
public class JakartaJmsModule extends JavaxJmsModule {
1111
public JakartaJmsModule() {
12-
super("jakarta", "jakarta-jms");
12+
super("jakarta", "jakarta-jms", "jms");
1313
}
1414

1515
@Override

dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/AbstractTibcoInstrumentation.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import datadog.trace.agent.tooling.InstrumenterModule;
44
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
5+
import datadog.trace.util.Strings;
56
import java.util.HashMap;
67
import java.util.Map;
78

@@ -10,6 +11,10 @@ public AbstractTibcoInstrumentation() {
1011
super("tibco", "tibco_bw");
1112
}
1213

14+
public AbstractTibcoInstrumentation(String... additionalNames) {
15+
super("tibco", Strings.concat(additionalNames, "tibco_bw"));
16+
}
17+
1318
@Override
1419
protected boolean defaultEnabled() {
1520
return false;

dd-java-agent/instrumentation/tibco-businessworks/tibcobw-6/src/main/java/datadog/trace/instrumentation/tibcobw6/JmsMessageGetterInstrumentation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
public class JmsMessageGetterInstrumentation extends AbstractTibcoInstrumentation
1717
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {
1818

19+
public JmsMessageGetterInstrumentation() {
20+
super("jms");
21+
}
22+
1923
@Override
2024
public String instrumentedType() {
2125
return "com.tibco.bw.jms.shared.primitives.SingleJMSMessageGetter";

internal-api/src/main/java/datadog/trace/util/Strings.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,13 @@ public static String toHexString(byte[] value) {
220220
}
221221
return new String(bytes, US_ASCII);
222222
}
223+
224+
public static String[] concat(String[] arr, String... extra) {
225+
if (arr.length == 0) return extra;
226+
if (extra.length == 0) return arr;
227+
String[] result = new String[arr.length + extra.length];
228+
System.arraycopy(arr, 0, result, 0, arr.length);
229+
System.arraycopy(extra, 0, result, arr.length, extra.length);
230+
return result;
231+
}
223232
}

0 commit comments

Comments
 (0)