本文整理了Java中brave.Tracing.currentTracer()
方法的一些代码示例,展示了Tracing.currentTracer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tracing.currentTracer()
方法的具体详情如下:
包路径:brave.Tracing
类名称:Tracing
方法名:currentTracer
[英]Returns the most recently created tracer if its component hasn't been closed. null otherwise.
This object should not be cached.
[中]如果跟踪程序的组件尚未关闭,则返回最近创建的跟踪程序。否则为空。
不应缓存此对象。
代码示例来源:origin: openzipkin/brave
Tracer tracer() {
return tracer != null ? tracer : Tracing.currentTracer();
}
代码示例来源:origin: openzipkin/brave
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
if (Tracing.currentTracer().currentSpan() == null) {
throw new IllegalStateException("couldn't read current span!");
}
AsyncContext ctx = req.startAsync();
ctx.start(ctx::complete);
}
}
代码示例来源:origin: lettuce-io/lettuce-core
@Override
public TraceContext getTraceContext() {
brave.Tracer tracer = brave.Tracing.currentTracer();
if (tracer != null) {
Span span = tracer.currentSpan();
if (span != null) {
return new BraveTraceContext(span.context());
}
}
return null;
}
代码示例来源:origin: jeqo/talk-kafka-zipkin
TranslationResource(TranslationRepository repository) {
this.repository = repository;
tracer = Tracing.currentTracer();
}
代码示例来源:origin: io.zipkin.brave/brave
Tracer tracer() {
return tracer != null ? tracer : Tracing.currentTracer();
}
代码示例来源:origin: io.zipkin.brave/brave-instrumentation-http-tests
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
if (Tracing.currentTracer().currentSpan() == null) {
throw new IllegalStateException("couldn't read current span!");
}
AsyncContext ctx = req.startAsync();
ctx.start(ctx::complete);
}
}
代码示例来源:origin: io.lettuce/lettuce-core
@Override
public TraceContext getTraceContext() {
brave.Tracer tracer = brave.Tracing.currentTracer();
if (tracer != null) {
Span span = tracer.currentSpan();
if (span != null) {
return new BraveTraceContext(span.context());
}
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!