[PR Interface should not use the impl instead of the interface
MODIFY
src/main/java/com/datadoghq/trace/Sampler.java
src/main/java/com/datadoghq/trace/Sampler.java
package com.datadoghq.trace;
-import com.datadoghq.trace.impl.DDSpan;
+import io.opentracing.Span;
/**
* Main interface to sample a collection of traces.
@@ -14,6 +14,6 @@ public interface Sampler {
* @param span the parent span with its context
* @return true when the trace/spans has to be reported/written
*/
- boolean sample(DDSpan span);
+ boolean sample(Span span);
}

MODIFY
src/main/java/com/datadoghq/trace/impl/AllSampler.java
src/main/java/com/datadoghq/trace/impl/AllSampler.java
package com.datadoghq.trace.impl;
import com.datadoghq.trace.Sampler;
+import io.opentracing.Span;
/**
* Sampler that always says yes...
@@ -8,7 +9,7 @@ import com.datadoghq.trace.Sampler;
public class AllSampler implements Sampler {
@Override
- public boolean sample(DDSpan span) {
+ public boolean sample(Span span) {
return true;
}

MODIFY
src/main/java/com/datadoghq/trace/impl/RateSampler.java
src/main/java/com/datadoghq/trace/impl/RateSampler.java
@@ -2,6 +2,7 @@ package com.datadoghq.trace.impl;
import com.datadoghq.trace.Sampler;
+import io.opentracing.Span;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,7 +42,7 @@ public class RateSampler implements Sampler {
}
@Override
- public boolean sample(DDSpan span) {
+ public boolean sample(Span span) {
boolean sample = Math.random() <= this.sampleRate;
logger.debug("{} - Span is sampled: {}", span, sample);
return sample;

[PR #1] Interface should not use the impl instead of the interface