本文整理了Java中brave.Tracing.newBuilder()
方法的一些代码示例,展示了Tracing.newBuilder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tracing.newBuilder()
方法的具体详情如下:
包路径:brave.Tracing
类名称:Tracing
方法名:newBuilder
暂无
代码示例来源:origin: openzipkin/brave
@Override public Set<Object> getSingletons() {
return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create(
HttpTracing.create(Tracing.newBuilder().spanReporter(Reporter.NOOP).build())
)));
}
}
代码示例来源:origin: openzipkin/brave
public Unsampled() {
super(TracingFilter.create(
Tracing.newBuilder().sampler(Sampler.NEVER_SAMPLE).spanReporter(Reporter.NOOP).build()
));
}
}
代码示例来源:origin: openzipkin/brave
public Traced128() {
super(TracingFilter.create(
Tracing.newBuilder().traceId128Bit(true).spanReporter(Reporter.NOOP).build()));
}
}
代码示例来源:origin: openzipkin/brave
public Traced() {
super(Tracing.newBuilder()
.spanReporter(AsyncReporter.create(new NoopSender()))
.build());
}
}
代码示例来源:origin: openzipkin/brave
@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())
)));
}
}
代码示例来源:origin: openzipkin/brave
@Override public Set<Object> getSingletons() {
return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create(
HttpTracing.create(Tracing.newBuilder()
.traceId128Bit(true)
.spanReporter(Reporter.NOOP)
.build())
)));
}
}
代码示例来源:origin: line/armeria
@Test
public void newDecorator_shouldFailFastWhenRequestContextCurrentTraceContextNotConfigured() {
assertThatThrownBy(() -> HttpTracingService.newDecorator(Tracing.newBuilder().build()))
.isInstanceOf(IllegalStateException.class).hasMessage(
"Tracing.currentTraceContext is not a RequestContextCurrentTraceContext scope. " +
"Please call Tracing.Builder.currentTraceContext(RequestContextCurrentTraceContext.INSTANCE)."
);
}
代码示例来源:origin: line/armeria
@Test
public void newDecorator_shouldFailFastWhenRequestContextCurrentTraceContextNotConfigured() {
assertThatThrownBy(() -> HttpTracingClient.newDecorator(Tracing.newBuilder().build()))
.isInstanceOf(IllegalStateException.class).hasMessage(
"Tracing.currentTraceContext is not a RequestContextCurrentTraceContext scope. " +
"Please call Tracing.Builder.currentTraceContext(RequestContextCurrentTraceContext.INSTANCE)."
);
}
代码示例来源:origin: openzipkin/brave
public Unsampled() {
super(Tracing.newBuilder()
.sampler(Sampler.NEVER_SAMPLE)
.spanReporter(AsyncReporter.create(new NoopSender()))
.build());
}
}
代码示例来源:origin: openzipkin/brave
public Traced128() {
super(Tracing.newBuilder()
.traceId128Bit(true)
.spanReporter(AsyncReporter.create(new NoopSender()))
.build());
}
}
代码示例来源:origin: openzipkin/brave
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()));
}
}
代码示例来源:origin: openzipkin/brave
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());
}
}
代码示例来源:origin: openzipkin/brave
@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));
}
代码示例来源:origin: line/armeria
@Test
public void newDecorator_shouldWorkWhenRequestContextCurrentTraceContextConfigured() {
HttpTracingService.newDecorator(
Tracing.newBuilder().currentTraceContext(RequestContextCurrentTraceContext.DEFAULT).build());
}
代码示例来源:origin: line/armeria
@Test
public void newDecorator_shouldWorkWhenRequestContextCurrentTraceContextConfigured() {
HttpTracingClient.newDecorator(
Tracing.newBuilder().currentTraceContext(RequestContextCurrentTraceContext.DEFAULT).build());
}
代码示例来源:origin: openzipkin/brave
@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);
}
代码示例来源:origin: openzipkin/brave
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());
}
}
代码示例来源:origin: stagemonitor/stagemonitor
@Override
public Tracer getTracer(StagemonitorPlugin.InitArguments initArguments) {
final Tracing braveTracer = Tracing.newBuilder()
.localServiceName(initArguments.getMeasurementSession().getApplicationName())
.reporter(getZipkinReporterBuilder(initArguments).build())
.sampler(getSampler())
.build();
return BraveTracer.newBuilder(braveTracer)
.textMapPropagation(B3HeaderFormat.INSTANCE, Propagation.B3_STRING)
.build();
}
代码示例来源:origin: line/armeria
@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();
}
代码示例来源:origin: line/armeria
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();
}
内容来源于网络,如有侵权,请联系作者删除!