10000 Add jms as an extra integration name where there is JMS involved by vandonr · Pull Request #8933 · DataDog/dd-trace-java · GitHub
[go: up one dir, main page]

Skip to content

8000 Add jms as an extra integration name where there is JMS involved #8933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
add jms as an extra integration name where there is JMS involved
  • Loading branch information
vandonr committed Jun 5, 2025
commit a82b2c7b5085829ed9d994dd656c1f61d7f5401f
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 = NO_HELPERS;

private final List<String> instrumentationNames;
private final String instrumentationPrimaryName;
Expand All @@ -72,6 +73,15 @@ public InstrumenterModule(final String instrumentationName, final String... addi
enabled = InstrumenterConfig.get().isIntegrationEnabled(instrumentationNames, defaultEnabled());
}

/** Helper method for the ctor above, use to add values to an already built vararg array */
public static String[] concat(String[] arr, String... extra) {
if (arr.length == 0) return extra;
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;
}

public String name() {
return instrumentationPrimaryName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

public abstract class AbstractSqsInstrumentation extends InstrumenterModule.Tracing {
public AbstractSqsInstrumentation() {
super("sqs", "aws-sdk");
this(NO_ADDITIONAL_NAMES);
}

public AbstractSqsInstrumentation(String... additionalNames) {
super("sqs", 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 @@ -4,6 +4,10 @@

public abstract class AbstractSqsInstrumentation extends InstrumenterModule.Tracing {
public AbstractSqsInstrumentation() {
super("sqs", "aws-sdk");
this(NO_ADDITIONAL_NAMES);
}

public AbstractSqsInstrumentation(String... additionalNames) {
super("sqs", 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 @@ -7,7 +7,11 @@

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

public AbstractTibcoInstrumentation(String... additionalNames) {
super("tibco", 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
0