use of io.jaegertracing.internal.samplers.ConstSampler in project jaeger-client-java by jaegertracing.
the class JaegerTracerTagsTest method testTracerTags.
@Test
public void testTracerTags() {
InMemoryReporter spanReporter = new InMemoryReporter();
JaegerTracer tracer = new JaegerTracer.Builder("x").withReporter(spanReporter).withSampler(new ConstSampler(true)).withZipkinSharedRpcSpan().withTag("tracer.tag.str", "y").build();
JaegerSpan jaegerSpan = tracer.buildSpan("root").start();
// span should only contain sampler tags and no tracer tags
assertEquals(2, jaegerSpan.getTags().size());
assertEquals(true, jaegerSpan.getTags().containsKey("sampler.type"));
assertEquals(true, jaegerSpan.getTags().containsKey("sampler.param"));
assertEquals(false, jaegerSpan.getTags().containsKey("tracer.tag.str"));
}
use of io.jaegertracing.internal.samplers.ConstSampler in project jaeger-client-java by jaegertracing.
the class ActiveSpanTest method testCustomScopeManager.
@Test
public void testCustomScopeManager() {
Span span = mock(Span.class);
Scope scope = mock(Scope.class);
JaegerTracer tracer = new JaegerTracer.Builder("test").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withScopeManager(new ScopeManager() {
@Override
public Scope activate(Span span) {
return scope;
}
@Override
public Span activeSpan() {
return span;
}
}).build();
assertEquals(span, tracer.scopeManager().activeSpan());
assertEquals(scope, tracer.scopeManager().activate(span));
}
use of io.jaegertracing.internal.samplers.ConstSampler in project jaeger-client-java by jaegertracing.
the class UdpSenderTest method setUp.
@Before
public void setUp() throws Exception {
server = startServer();
reporter = new InMemoryReporter();
final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder(SERVICE_NAME).withReporter(reporter).withSampler(new ConstSampler(true)).withMetricsFactory(new InMemoryMetricsFactory()).withTag("foo", "bar");
tracer = tracerBuilder.build();
tracer128 = tracerBuilder.withTraceId128Bit().build();
sender = new UdpSender(destHost, destPort, maxPacketSize);
}
use of io.jaegertracing.internal.samplers.ConstSampler in project jaeger-client-java by jaegertracing.
the class ZipkinSenderTest method setUp.
@Before
public void setUp() {
reporter = new InMemoryReporter();
final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder("test-sender").withReporter(reporter).withSampler(new ConstSampler(true)).withMetricsFactory(new InMemoryMetricsFactory());
tracer = tracerBuilder.build();
tracer128 = tracerBuilder.withTraceId128Bit().build();
sender = newSender(messageMaxBytes);
converter = new ThriftSpanConverter();
}
use of io.jaegertracing.internal.samplers.ConstSampler in project jaeger-client-java by jaegertracing.
the class V2SpanConverterTest method setUp.
@Before
public void setUp() {
final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder("test-service-name").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withZipkinSharedRpcSpan();
tracer = tracerBuilder.build();
tracer128 = tracerBuilder.withTraceId128Bit().build();
}
Aggregations