Merge pull request #627 from DataDog/ark/enable-priority-sampling-by-default

Enable priority sampling by default
This commit is contained in:
Andrew Kent 2018-12-13 03:03:34 +00:00 committed by GitHub
commit 99c6837cca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 13 deletions

View File

@ -61,7 +61,7 @@ public class Config {
private static final boolean DEFAULT_RUNTIME_CONTEXT_FIELD_INJECTION = true;
private static final boolean DEFAULT_PRIORITY_SAMPLING_ENABLED = false;
private static final boolean DEFAULT_PRIORITY_SAMPLING_ENABLED = true;
private static final boolean DEFAULT_TRACE_RESOLVER_ENABLED = true;
private static final boolean DEFAULT_JMX_FETCH_ENABLED = false;

View File

@ -31,7 +31,7 @@ class ConfigTest extends Specification {
config.writerType == "DDAgentWriter"
config.agentHost == "localhost"
config.agentPort == 8126
config.prioritySamplingEnabled == false
config.prioritySamplingEnabled == true
config.traceResolverEnabled == true
config.serviceMapping == [:]
config.mergedSpanTags == [:]
@ -54,7 +54,7 @@ class ConfigTest extends Specification {
System.setProperty(PREFIX + AGENT_HOST, "somehost")
System.setProperty(PREFIX + TRACE_AGENT_PORT, "123")
System.setProperty(PREFIX + AGENT_PORT_LEGACY, "456")
System.setProperty(PREFIX + PRIORITY_SAMPLING, "true")
System.setProperty(PREFIX + PRIORITY_SAMPLING, "false")
System.setProperty(PREFIX + TRACE_RESOLVER_ENABLED, "false")
System.setProperty(PREFIX + SERVICE_MAPPING, "a:1")
System.setProperty(PREFIX + GLOBAL_TAGS, "b:2")
@ -77,7 +77,7 @@ class ConfigTest extends Specification {
config.writerType == "LoggingWriter"
config.agentHost == "somehost"
config.agentPort == 123
config.prioritySamplingEnabled == true
config.prioritySamplingEnabled == false
config.traceResolverEnabled == false
config.serviceMapping == [a: "1"]
config.mergedSpanTags == [b: "2", c: "3"]
@ -177,7 +177,7 @@ class ConfigTest extends Specification {
properties.setProperty(WRITER_TYPE, "LoggingWriter")
properties.setProperty(AGENT_HOST, "somehost")
properties.setProperty(TRACE_AGENT_PORT, "123")
properties.setProperty(PRIORITY_SAMPLING, "true")
properties.setProperty(PRIORITY_SAMPLING, "false")
properties.setProperty(TRACE_RESOLVER_ENABLED, "false")
properties.setProperty(SERVICE_MAPPING, "a:1")
properties.setProperty(GLOBAL_TAGS, "b:2")
@ -198,7 +198,7 @@ class ConfigTest extends Specification {
config.writerType == "LoggingWriter"
config.agentHost == "somehost"
config.agentPort == 123
config.prioritySamplingEnabled == true
config.prioritySamplingEnabled == false
config.traceResolverEnabled == false
config.serviceMapping == [a: "1"]
config.mergedSpanTags == [b: "2", c: "3"]

View File

@ -42,21 +42,20 @@ class DDTracerTest extends Specification {
then:
tracer.serviceName == "unnamed-java-app"
tracer.sampler instanceof AllSampler
tracer.sampler instanceof RateByServiceSampler
tracer.writer.toString() == "DDAgentWriter { api=DDApi { tracesEndpoint=http://localhost:8126/v0.3/traces } }"
tracer.spanContextDecorators.size() == 12
}
def "verify overriding sampler"() {
setup:
System.setProperty(PREFIX + PRIORITY_SAMPLING, "true")
System.setProperty(PREFIX + PRIORITY_SAMPLING, "false")
when:
def tracer = new DDTracer(new Config())
then:
tracer.sampler instanceof RateByServiceSampler
tracer.sampler instanceof AllSampler
}
def "verify overriding writer"() {
@ -136,7 +135,7 @@ class DDTracerTest extends Specification {
where:
key | value
Config.PRIORITY_SAMPLING | "true"
Config.PRIORITY_SAMPLING | "false"
PRIORITY_SAMPLING | "true"
PRIORITY_SAMPLING | "false"
}
}