Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public enum TargetSystem {
private static final Logger log = LoggerFactory.getLogger(InstrumenterModule.class);

protected static final String[] NO_HELPERS = {};
protected static final String[] NO_ADDITIONAL_NAMES = {};

private final List<String> instrumentationNames;
private final String instrumentationPrimaryName;
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
this(NO_ADDITIONAL_NAMES);
}

public AbstractSqsInstrumentation(String... additionalNames) {
super("sqs", Strings.concat(additionalNames, "aws-sdk"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
this(NO_ADDITIONAL_NAMES);
}

public AbstractSqsInstrumentation(String... additionalNames) {
super("sqs", Strings.concat(additionalNames, "aws-sdk"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@AutoService(InstrumenterModule.class)
public class JakartaJmsModule extends JavaxJmsModule {
public JakartaJmsModule() {
super("jakarta", "jakarta-jms");
super("jakarta", "jakarta-jms", "jms");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this existed before, but jakarta isn't a useful grouping in my view.
jakarta is so broad as to not be useful, so I don't see a situation where a user would turn off all jakarta integrations. That's akin to turning off all java-core integrations.

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

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;

public abstract class AbstractTibcoInstrumentation extends InstrumenterModule.Tracing {
public AbstractTibcoInstrumentation() {
super("tibco", "tibco_bw");
this(NO_ADDITIONAL_NAMES);
}

public AbstractTibcoInstrumentation(String... additionalNames) {
super("tibco", Strings.concat(additionalNames, "tibco_bw"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
9 changes: 9 additions & 0 deletions internal-api/src/main/java/datadog/trace/util/Strings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Loading