-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Group javax.jms instrumentations under a single module
- Loading branch information
Showing
6 changed files
with
55 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...t/instrumentation/jms/src/main/java/datadog/trace/instrumentation/jms/JavaxJmsModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package datadog.trace.instrumentation.jms; | ||
|
||
import com.google.auto.service.AutoService; | ||
import datadog.trace.agent.tooling.Instrumenter; | ||
import datadog.trace.agent.tooling.InstrumenterModule; | ||
import datadog.trace.bootstrap.instrumentation.jms.MessageConsumerState; | ||
import datadog.trace.bootstrap.instrumentation.jms.MessageProducerState; | ||
import datadog.trace.bootstrap.instrumentation.jms.SessionState; | ||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@AutoService(InstrumenterModule.class) | ||
public class JavaxJmsModule extends InstrumenterModule.Tracing { | ||
public JavaxJmsModule() { | ||
super("jms", "jms-1", "jms-2"); | ||
} | ||
|
||
@Override | ||
public String[] helperClassNames() { | ||
return new String[] { | ||
packageName + ".JMSDecorator", | ||
packageName + ".MessageExtractAdapter", | ||
packageName + ".MessageExtractAdapter$1", | ||
packageName + ".MessageInjectAdapter", | ||
packageName + ".DatadogMessageListener" | ||
}; | ||
} | ||
|
||
@Override | ||
public Map<String, String> contextStore() { | ||
Map<String, String> contextStore = new HashMap<>(4); | ||
contextStore.put("javax.jms.MessageConsumer", MessageConsumerState.class.getName()); | ||
contextStore.put("javax.jms.MessageProducer", MessageProducerState.class.getName()); | ||
contextStore.put("javax.jms.Message", SessionState.class.getName()); | ||
contextStore.put("javax.jms.Session", SessionState.class.getName()); | ||
return contextStore; | ||
} | ||
|
||
@Override | ||
public List<Instrumenter> typeInstrumentations() { | ||
return Arrays.asList( | ||
new JMSMessageConsumerInstrumentation(), | ||
new JMSMessageProducerInstrumentation(), | ||
new MDBMessageConsumerInstrumentation(), | ||
new MessageInstrumentation(), | ||
new SessionInstrumentation()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters