Remove defaultServiceName from TracerBuilder
MODIFY
dd-trace/src/main/java/datadog/trace/tracer/Span.java
dd-trace/src/main/java/datadog/trace/tracer/Span.java
@@ -87,7 +87,6 @@ public interface Span {
*/
void setErrored(boolean errored);
- /** */
/**
* Attach a throwable to this span.
*
@@ -129,7 +128,4 @@ public interface Span {
* @param finishTimestampNanoseconds Epoch time in nanoseconds.
*/
void finish(long finishTimestampNanoseconds);
-
- // TODO: OpenTracing Span#log methods. Do we need something here to support them? Current DDSpan
- // does not implement.
}

MODIFY
dd-trace/src/main/java/datadog/trace/tracer/Tracer.java
dd-trace/src/main/java/datadog/trace/tracer/Tracer.java
@@ -9,7 +9,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.Properties;
import lombok.Builder;
import lombok.extern.slf4j.Slf4j;
@@ -31,17 +30,12 @@ public class Tracer implements Closeable {
@Builder
private Tracer(
- final String defaultServiceName,
final Config config,
final Writer writer,
final Sampler sampler,
final List<Interceptor> interceptors) {
// Apply defaults:
- final Properties serviceNameConfig = new Properties();
- if (defaultServiceName != null && !defaultServiceName.trim().isEmpty()) {
- serviceNameConfig.setProperty(Config.SERVICE_NAME, defaultServiceName);
- }
- this.config = config != null ? config : Config.get(serviceNameConfig);
+ this.config = config != null ? config : Config.get();
this.writer = writer != null ? writer : Writer.Builder.forConfig(this.config);
this.sampler = sampler != null ? sampler : new AllSampler();

MODIFY
dd-trace/src/main/java/datadog/trace/tracer/writer/AgentWriter.java
dd-trace/src/main/java/datadog/trace/tracer/writer/AgentWriter.java
@@ -52,7 +52,7 @@ public class AgentWriter implements Writer {
shutdownCallback = new ShutdownCallback(executorService);
}
- /** @return Datadog agwent URL. Visible for testing. */
+ /** @return Datadog agent URL. Visible for testing. */
URL getAgentUrl() {
return task.getClient().getAgentUrl();
}

MODIFY
dd-trace/src/test/groovy/datadog/trace/tracer/TracerTest.groovy
dd-trace/src/test/groovy/datadog/trace/tracer/TracerTest.groovy
@@ -30,21 +30,6 @@ class TracerTest extends Specification {
tracer.getWriter() instanceof AgentWriter
tracer.getSampler() instanceof AllSampler
tracer.getInterceptors() == []
- tracer.getDefaultServiceName() == config.getServiceName()
- }
-
- def "test defaultServiceName=#serviceName"() {
- when:
- def tracer = Tracer.builder().defaultServiceName(serviceName).build()
-
- then:
- tracer.config.serviceName == expected
-
- where:
- serviceName | expected
- null | Config.DEFAULT_SERVICE_NAME
- "" | Config.DEFAULT_SERVICE_NAME
- "some-service" | "some-service"
}
def "close closes writer"() {

Remove defaultServiceName from TracerBuilder