我怎么能强迫一个Zipkin跨度被出口?在下面的代码跨度中,有时是可导出的,有时不是不可重复的。
在我看来,如果我评论第一个scopedSpan,而不是第二个手动创建的spanInScope是可导出的,但是第一个scopedSpan如何阻止第二个spanInScope可导出呢?他们是怎么干涉的?
@SneakyThrows
private void debugScopedSpan(final String label) {
ScopedSpan scopedSpan = tracer.startScopedSpan(label + "_1").tag("type", "manual");
try {
log.info("===== debugScopedSpan_1 {}", label);
} catch (RuntimeException | Error e) {
scopedSpan.error(e);
throw e;
} finally {
scopedSpan.finish();
}
// Why both above scopedSpan and below spanInScope cant be exportable at the same time??? How do they iterfere with each other?
Span trace = tracer.nextSpan().name(label+"_2").tag("type", "manual").start();
final Tracer.SpanInScope spanInScope = tracer.withSpanInScope(trace);
log.info("===== debugScopedSpan_2 {}", label);
spanInScope.close();
trace.finish();
}发布于 2020-08-12 21:15:25
因为抽样调查。请创建一个取样类型的bean,其值可以是Sampler.ALWAYS,或者将概率属性设置为1.0
https://stackoverflow.com/questions/63384688
复制相似问题