@Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder().spanReporter(Reporter.NOOP).build()) ))); } }
@Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder() .traceId128Bit(true) .spanReporter(Reporter.NOOP) .build()) ))); } }
@Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder() .sampler(Sampler.NEVER_SAMPLE) .spanReporter(Reporter.NOOP) .build()) ))); } }
@Setup(Level.Trial) public void init() { tracer = Tracing.newBuilder() .addFinishedSpanHandler(new FinishedSpanHandler() { @Override public boolean handle(TraceContext context, MutableSpan span) { return true; // anonymous subtype prevents all recording from being no-op } }) .spanReporter(Reporter.NOOP).build().tracer(); tracerExtra = Tracing.newBuilder() .propagationFactory(ExtraFieldPropagation.newFactory( B3Propagation.FACTORY, "x-vcap-request-id")) .addFinishedSpanHandler(new FinishedSpanHandler() { @Override public boolean handle(TraceContext context, MutableSpan span) { return true; // anonymous subtype prevents all recording from being no-op } }) .spanReporter(Reporter.NOOP).build().tracer(); }
public OnlySampledLocal() { super(Tracing.newBuilder() .addFinishedSpanHandler(new FinishedSpanHandler() { @Override public boolean handle(TraceContext context, MutableSpan span) { return true; } @Override public boolean alwaysSampleLocal() { return true; } }) .sampler(Sampler.NEVER_SAMPLE) .spanReporter(AsyncReporter.create(new NoopSender())) .build()); } }
public Traced() { super(TracingFilter.create(Tracing.newBuilder().spanReporter(Reporter.NOOP).build())); } }
@Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder() .propagationFactory(ExtraFieldPropagation.newFactoryBuilder(B3Propagation.FACTORY) .addField("x-vcap-request-id") .addPrefixedFields("baggage-", asList("country-code", "user-id")) .build() ) .spanReporter(Reporter.NOOP) .build()) ))); } }
@Setup(Level.Trial) public void init() { Tracing tracing = Tracing.newBuilder().spanReporter(Reporter.NOOP).build(); producer = new FakeProducer(); tracingProducer = KafkaTracing.create(tracing).producer(producer); tracingB3SingleProducer = KafkaTracing.newBuilder(tracing).writeB3SingleFormat(true).build().producer(producer); }
@Setup(Level.Trial) public void init() { Tracing tracing = Tracing.newBuilder().spanReporter(Reporter.NOOP).build(); tracingPostProcessor = new TracingMessagePostProcessor(SpringRabbitTracing.create(tracing)); tracingB3SinglePostProcessor = new TracingMessagePostProcessor( SpringRabbitTracing.newBuilder(tracing).writeB3SingleFormat(true).build() ); }
public Traced128() { super(Tracing.newBuilder() .traceId128Bit(true) .spanReporter(AsyncReporter.create(new NoopSender())) .build()); } }
public TracedCorrelated() { super(Tracing.newBuilder() .currentTraceContext(ThreadLocalCurrentTraceContext.newBuilder() // intentionally added twice to test overhead of multiple correlations .addScopeDecorator(ThreadContextScopeDecorator.create()) .addScopeDecorator(ThreadContextScopeDecorator.create()) .build()) .spanReporter(AsyncReporter.create(new NoopSender())) .build()); } }
public Traced() { super(Tracing.newBuilder() .spanReporter(AsyncReporter.create(new NoopSender())) .build()); } }
public TracedExtra() { super(TracingFilter.create(Tracing.newBuilder() .propagationFactory(ExtraFieldPropagation.newFactoryBuilder(B3Propagation.FACTORY) .addField("x-vcap-request-id") .addPrefixedFields("baggage-", Arrays.asList("country-code", "user-id")) .build() ) .spanReporter(Reporter.NOOP) .build())); } }
public Unsampled() { super(Tracing.newBuilder() .sampler(Sampler.NEVER_SAMPLE) .spanReporter(AsyncReporter.create(new NoopSender())) .build()); } }
@Test public void shouldNotSubmitSpanWhenNotSampled() throws Exception { final SpanCollectingReporter reporter = new SpanCollectingReporter(); final Tracing tracing = Tracing.newBuilder() .localServiceName(TEST_SERVICE) .spanReporter(reporter) .sampler(Sampler.create(0.0f)) .build(); testRemoteInvocation(tracing, null); assertThat(reporter.spans().poll(1, TimeUnit.SECONDS)).isNull(); }
private static Tracing newTracing(String name) { final CurrentTraceContext currentTraceContext = RequestContextCurrentTraceContext.newBuilder() .addScopeDecorator(StrictScopeDecorator.create()) .build(); return Tracing.newBuilder() .currentTraceContext(currentTraceContext) .localServiceName(name) .spanReporter(spanReporter) .sampler(Sampler.ALWAYS_SAMPLE) .build(); }
public Traced128() { super(TracingFilter.create( Tracing.newBuilder().traceId128Bit(true).spanReporter(Reporter.NOOP).build())); } }
public Unsampled() { super(TracingFilter.create( Tracing.newBuilder().sampler(Sampler.NEVER_SAMPLE).spanReporter(Reporter.NOOP).build() )); } }
public TracedExtra() { super(Tracing.newBuilder() .propagationFactory(ExtraFieldPropagation.newFactoryBuilder(B3Propagation.FACTORY) .addField("x-vcap-request-id") .addPrefixedFields("baggage-", Arrays.asList("country-code", "user-id")) .build() ) .spanReporter(AsyncReporter.create(new NoopSender())) .build()); } }
@Setup(Level.Trial) public void init() throws MessageNotWriteableException { Tracing tracing = Tracing.newBuilder().spanReporter(Reporter.NOOP).build(); producer = new FakeMessageProducer(); message.setText("value"); tracingProducer = TracingMessageProducer.create(producer, JmsTracing.create(tracing)); }