Class TraceUtils

  • public class TraceUtils
    extends Object
    Utilities for distributed tracing.
    • Field Detail


        public static final Predicate<io.opentracing.Span> DEFAULT_IS_RECORDING

        public static Predicate<io.opentracing.Span> IS_RECORDING
        this should only be changed in the context of testing, otherwise it would risk not recording trace data.
    • Constructor Detail

      • TraceUtils

        public TraceUtils()
    • Method Detail

      • ifNotNoop

        public static void ifNotNoop​(io.opentracing.Span span,
                                     Consumer<io.opentracing.Span> consumer)
      • injectTraceContext

        public static void injectTraceContext​(org.eclipse.jetty.client.api.Request req,
                                              io.opentracing.Span span)
      • injectTraceContext

        public static void injectTraceContext​(org.apache.http.HttpRequest req)
      • startCollectionApiCommandSpan

        public static io.opentracing.Span startCollectionApiCommandSpan​(io.opentracing.Tracer tracer,
                                                                        String name,
                                                                        String collection,
                                                                        boolean isAsync)