Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion dd-trace-ot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ shadowJar {
exclude(dependency('org.slf4j:'))
}

relocate('com.', 'ddtrot.com.')
relocate('com.', 'ddtrot.com.') {
// don't relocate native methods
exclude('com.kenai.jffi.*')
exclude('com.kenai.jffi.internal.*')
}
relocate('dogstatsd/', 'ddtrot/dogstatsd/')
relocate('jni/', 'ddtrot/jni/')
relocate('jnr/', 'ddtrot/jnr/')
Expand Down
3 changes: 3 additions & 0 deletions test-published-dependencies/ot-is-shaded/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ tasks.register('checkJarContents', CheckJarContentsTask) {
'^[^/]*\\.version$',
'^DDSketch.proto$',
'^META-INF/.*$',
'^com/$',
'^com/kenai/$',
'^com/kenai/jffi/.*$',
'^datadog/.*$',
'^ddtrot/.*$'
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import datadog.opentracing.DDTracer;
import io.opentracing.util.GlobalTracer;
import org.junit.jupiter.api.Test;
import java.nio.file.Files;
import java.nio.file.Path;

public class CreateTracerTest {

Expand All @@ -13,4 +15,18 @@ void createTracer() throws InterruptedException {
// Sleep a bit so the trace sending machinery has a chance to start
Thread.sleep(1000);
}

@Test
void buildTracerWithUDS() throws Exception {
// trigger use of JNR and JFFI to validate native method linking
Path fakeSocketPath = Files.createTempFile("dd-java", "test-uds");
System.setProperty("dd.trace.agent.url", "unix://" + fakeSocketPath.toUri().getPath());
try {
// we don't need to actually use the tracer, just build it
DDTracer.builder().serviceName("TestServiceWithUDS").build();
} finally {
System.clearProperty("dd.trace.agent.url");
Files.delete(fakeSocketPath);
}
}
}