当前位置: 首页>>代码示例>>Java>>正文


Java Span.log方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:opentracing-contrib,项目名称:java-web-servlet-filter,代码行数:12,代码来源:ServletFilterSpanDecorator.java

示例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));
  }
}
 
开发者ID:opentracing-contrib,项目名称:java-spring-cloud,代码行数:8,代码来源:TracePostZuulFilter.java

示例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));
  }
}
 
开发者ID:opentracing-contrib,项目名称:java-redis-client,代码行数:8,代码来源:TracingHelper.java

示例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();
    }
}
 
开发者ID:yurishkuro,项目名称:opentracing-tutorial,代码行数:11,代码来源:HelloManual.java

示例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();
    }
}
 
开发者ID:yurishkuro,项目名称:opentracing-tutorial,代码行数:10,代码来源:HelloManual.java

示例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();
}
 
开发者ID:yurishkuro,项目名称:opentracing-tutorial,代码行数:13,代码来源:Hello.java

示例7: onError

import io.opentracing.Span; //导入方法依赖的package包/类
static void onError(Exception exception, Span span) {
  Tags.ERROR.set(span, Boolean.TRUE);
  span.log(errorLogs(exception));
}
 
开发者ID:opentracing-contrib,项目名称:java-kafka-client,代码行数:5,代码来源:SpanDecorator.java

示例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));
}
 
开发者ID:opentracing-contrib,项目名称:java-rxjava,代码行数:5,代码来源:AbstractTracingSubscriber.java

示例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));
}
 
开发者ID:opentracing-contrib,项目名称:java-okhttp,代码行数:6,代码来源:OkHttpClientSpanDecorator.java

示例10: onError

import io.opentracing.Span; //导入方法依赖的package包/类
static void onError(Throwable throwable, Span span) {
  Tags.ERROR.set(span, Boolean.TRUE);
  span.log(errorLogs(throwable));
}
 
开发者ID:opentracing-contrib,项目名称:java-elasticsearch-client,代码行数:5,代码来源:SpanDecorator.java

示例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));
}
 
开发者ID:OpenFeign,项目名称:feign-opentracing,代码行数:6,代码来源:FeignSpanDecorator.java

示例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));
}
 
开发者ID:opentracing-contrib,项目名称:java-jms,代码行数:12,代码来源:SpanJmsDecorator.java


注:本文中的io.opentracing.Span.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。