本文整理汇总了Java中io.opentracing.Span.log方法的典型用法代码示例。如果您正苦于以下问题:Java Span.log方法的具体用法?Java Span.log怎么用?Java Span.log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.opentracing.Span
的用法示例。
在下文中一共展示了Span.log方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onError
import io.opentracing.Span; //导入方法依赖的package包/类
@Override
public void onError(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,
Throwable exception, Span span) {
Tags.ERROR.set(span, Boolean.TRUE);
span.log(logsForException(exception));
if (httpServletResponse.getStatus() == HttpServletResponse.SC_OK) {
// exception is thrown in filter chain, but status code is incorrect
Tags.HTTP_STATUS.set(span, 500);
}
}
示例2: onError
import io.opentracing.Span; //导入方法依赖的package包/类
private static void onError(Throwable throwable, Span span) {
Tags.ERROR.set(span, Boolean.TRUE);
if (throwable != null) {
span.log(errorLogs(throwable));
}
}
示例3: onError
import io.opentracing.Span; //导入方法依赖的package包/类
public static void onError(Throwable throwable, Span span) {
Tags.ERROR.set(span, Boolean.TRUE);
if (throwable != null) {
span.log(errorLogs(throwable));
}
}
示例4: formatString
import io.opentracing.Span; //导入方法依赖的package包/类
private String formatString(Span rootSpan, String helloTo) {
Span span = tracer.buildSpan("formatString").asChildOf(rootSpan).startManual();
try {
String helloStr = String.format("Hello, %s!", helloTo);
span.log(ImmutableMap.of("event", "string-format", "value", helloStr));
return helloStr;
} finally {
span.finish();
}
}
示例5: printHello
import io.opentracing.Span; //导入方法依赖的package包/类
private void printHello(Span rootSpan, String helloStr) {
Span span = tracer.buildSpan("printHello").asChildOf(rootSpan).startManual();
try {
System.out.println(helloStr);
span.log(ImmutableMap.of("event", "println"));
} finally {
span.finish();
}
}
示例6: sayHello
import io.opentracing.Span; //导入方法依赖的package包/类
private void sayHello(String helloTo) {
Span span = tracer.buildSpan("say-hello").startManual();
span.setTag("hello-to", helloTo);
String helloStr = String.format("Hello, %s!", helloTo);
span.log(ImmutableMap.of("event", "string-format", "value", helloStr));
System.out.println(helloStr);
span.log(ImmutableMap.of("event", "println"));
span.finish();
}
示例7: onError
import io.opentracing.Span; //导入方法依赖的package包/类
static void onError(Exception exception, Span span) {
Tags.ERROR.set(span, Boolean.TRUE);
span.log(errorLogs(exception));
}
示例8: onError
import io.opentracing.Span; //导入方法依赖的package包/类
private static void onError(Throwable throwable, Span span) {
span.setTag(Tags.ERROR.getKey(), Boolean.TRUE);
span.log(errorLogs(throwable));
}
示例9: onError
import io.opentracing.Span; //导入方法依赖的package包/类
@Override
public void onError(Throwable throwable, Span span) {
Tags.ERROR.set(span, Boolean.TRUE);
span.log(errorLogs(throwable));
}
示例10: onError
import io.opentracing.Span; //导入方法依赖的package包/类
static void onError(Throwable throwable, Span span) {
Tags.ERROR.set(span, Boolean.TRUE);
span.log(errorLogs(throwable));
}
示例11: onError
import io.opentracing.Span; //导入方法依赖的package包/类
@Override
public void onError(Exception exception, Request request, Span span) {
Tags.ERROR.set(span, Boolean.TRUE);
span.log(errorLogs(exception));
}
示例12: onError
import io.opentracing.Span; //导入方法依赖的package包/类
/**
* Decorate span on an error e.g. {@link java.net.UnknownHostException} or any exception in
* interceptor.
*
* @param throwable exception
* @param span span
*/
public static void onError(Throwable throwable, Span span) {
Tags.ERROR.set(span, Boolean.TRUE);
span.log(errorLogs(throwable));
}