本文整理汇总了Java中com.github.kristofa.brave.Brave.getClientTracer方法的典型用法代码示例。如果您正苦于以下问题:Java Brave.getClientTracer方法的具体用法?Java Brave.getClientTracer怎么用?Java Brave.getClientTracer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.kristofa.brave.Brave
的用法示例。
在下文中一共展示了Brave.getClientTracer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startTrace
import com.github.kristofa.brave.Brave; //导入方法依赖的package包/类
public static void startTrace(Block block, Request request) {
if (!isTracingEnabledRequest() || !trace(block)) {
return;
}
String name = getName(block);
ClientTracer clientTracer = Brave.getClientTracer(SPAN_COLLECTOR, TRACING_ON_FILTERS);
clientTracer.startNewSpan(name);
clientTracer.setCurrentClientServiceName(name);
if (request != null) {
clientTracer.submitBinaryAnnotation(REQUEST_ANNOTATION, request.toString());
}
clientTracer.setClientSent();
}
示例2: endTrace
import com.github.kristofa.brave.Brave; //导入方法依赖的package包/类
public static void endTrace(Block block, boolean success) {
if (!isTracingEnabledRequest() || !trace(block)) {
return;
}
ClientTracer clientTracer = Brave.getClientTracer(SPAN_COLLECTOR, TRACING_ON_FILTERS);
if (!success) {
clientTracer.submitAnnotation(FAILURE_ANNOTATION);
}
clientTracer.setClientReceived();
}
示例3: clientTracer
import com.github.kristofa.brave.Brave; //导入方法依赖的package包/类
@Bean
@Scope(value = "singleton")
public ClientTracer clientTracer()
{
return Brave.getClientTracer(spanCollector(), traceFilters().getTraceFilters());
}