本文整理匯總了Java中io.opentracing.Tracer.activeSpan方法的典型用法代碼示例。如果您正苦於以下問題:Java Tracer.activeSpan方法的具體用法?Java Tracer.activeSpan怎麽用?Java Tracer.activeSpan使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.opentracing.Tracer
的用法示例。
在下文中一共展示了Tracer.activeSpan方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSpan
import io.opentracing.Tracer; //導入方法依賴的package包/類
private Span getSpan(Tracer tracer) {
if (SpanHolder.get() != null) {
Scope scope = SpanHolder.get();
SpanHolder.clear();
return scope.span();
}
return tracer.activeSpan();
}
示例2: extract
import io.opentracing.Tracer; //導入方法依賴的package包/類
public static SpanContext extract(AMQP.BasicProperties props, Tracer tracer) {
SpanContext spanContext = tracer
.extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(props.getHeaders()));
if (spanContext != null) {
return spanContext;
}
Span span = tracer.activeSpan();
if (span != null) {
return span.context();
}
return null;
}
示例3: extract
import io.opentracing.Tracer; //導入方法依賴的package包/類
/**
* Extract span context from JMS message properties or active span
*
* @param message JMS message
* @param tracer Tracer
* @return extracted span context
*/
public static SpanContext extract(Message message, Tracer tracer) {
SpanContext spanContext = tracer
.extract(Format.Builtin.TEXT_MAP, new JmsTextMapExtractAdapter(message));
if (spanContext != null) {
return spanContext;
}
ActiveSpan span = tracer.activeSpan();
if (span != null) {
return span.context();
}
return null;
}
開發者ID:Estafet-LTD,項目名稱:estafet-microservices-scrum-api-project-burndown,代碼行數:21,代碼來源:PropagatingTracingMessageUtils.java
示例4: extract
import io.opentracing.Tracer; //導入方法依賴的package包/類
/**
* Extract span context from JMS message properties or active span
*
* @param message JMS message
* @param tracer Tracer
* @return extracted span context
*/
public static SpanContext extract(Message message, Tracer tracer) {
SpanContext spanContext = tracer
.extract(Format.Builtin.TEXT_MAP, new JmsTextMapExtractAdapter(message));
if (spanContext != null) {
return spanContext;
}
Span span = tracer.activeSpan();
if (span != null) {
return span.context();
}
return null;
}
示例5: TracingAction
import io.opentracing.Tracer; //導入方法依賴的package包/類
TracingAction(Action0 action0, Tracer tracer) {
this.action0 = action0;
this.tracer = tracer;
span = tracer.activeSpan();
}
示例6: TracedCallable
import io.opentracing.Tracer; //導入方法依賴的package包/類
public TracedCallable(Callable<V> delegate, Tracer tracer) {
this.delegate = delegate;
this.tracer = tracer;
this.span = tracer.activeSpan();
}
示例7: TracedRunnable
import io.opentracing.Tracer; //導入方法依賴的package包/類
public TracedRunnable(Runnable delegate, Tracer tracer) {
this.delegate = delegate;
this.tracer = tracer;
this.span = tracer.activeSpan();
}