本文整理了Java中brave.Tracer.toSpan()
方法的一些代码示例,展示了Tracer.toSpan()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tracer.toSpan()
方法的具体详情如下:
包路径:brave.Tracer
类名称:Tracer
方法名:toSpan
[英]Converts the context to a Span object after decorating it for propagation
[中]在装饰上下文以进行传播后,将其转换为跨度对象
代码示例来源:origin: openzipkin/brave
/**
* Returns the current span in scope or null if there isn't one.
*
* <p>When entering user code, prefer {@link #currentSpanCustomizer()} as it is a stable type and
* will never return null.
*/
@Nullable public Span currentSpan() {
TraceContext currentContext = currentTraceContext.get();
return currentContext != null ? toSpan(currentContext) : null;
}
代码示例来源:origin: spring-cloud/spring-cloud-sleuth
boolean created = false;
if (span != null) {
span = this.tracer.toSpan(this.parent.context());
代码示例来源:origin: io.zipkin.brave/brave-core
public static brave.Span toSpan(Tracer tracer, SpanId spanId) {
if (tracer == null) throw new NullPointerException("tracer == null");
return tracer.toSpan(toTraceContext(spanId));
}
代码示例来源:origin: io.zipkin.brave/brave-core
public static brave.Span toSpan(Tracer tracer, Span span) {
if (tracer == null) throw new NullPointerException("tracer == null");
return tracer.toSpan(toTraceContext(Brave.context(span)));
}
代码示例来源:origin: io.zipkin.brave/brave
/**
* Returns the current span in scope or null if there isn't one.
*
* <p>When entering user code, prefer {@link #currentSpanCustomizer()} as it is a stable type and
* will never return null.
*/
@Nullable public Span currentSpan() {
TraceContext currentContext = currentTraceContext.get();
return currentContext != null ? toSpan(currentContext) : null;
}
代码示例来源:origin: io.zipkin.brave/brave-core
brave.Span brave4(Span span) {
return tracer.toSpan(toTraceContext(InternalSpan.instance.context(span)));
}
代码示例来源:origin: org.springframework.cloud/spring-cloud-sleuth-core
boolean created = false;
if (span != null) {
span = this.tracer.toSpan(this.parent.context());
代码示例来源:origin: openzipkin-contrib/brave-opentracing
/**
* <em>Note:</em>If the key is {@linkplain Tags#SAMPLING_PRIORITY} and the value is zero, the
* current span will be abandoned and future references to the {@link #context()} will be
* unsampled. This does not affect the active span, nor does it affect any equivalent instances of
* this object. This is a best efforts means to handle late sampling decisions.
*/
@Override public BraveSpan setTag(String key, Number value) {
if (finishCalled) return this;
if (trySetPeer(key, value)) return this;
// handle late sampling decision
if (Tags.SAMPLING_PRIORITY.getKey().equals(key) && value.intValue() == 0) {
delegate.abandon();
// convert the span to no-op
delegate = tracer.toSpan(delegate.context().toBuilder().sampled(false).build());
}
return setTag(key, value.toString());
}
代码示例来源:origin: jiangmin168168/jim-framework
.sampled(true)
.build();
Span span = tracer.toSpan(traceContext).start();
代码示例来源:origin: jiangmin168168/jim-framework
.build();
Span span=tracer.toSpan(traceContext).start();
内容来源于网络,如有侵权,请联系作者删除!