@Test public void testStartSpanWithTraceOptionsTrue() { SpanContext initial = new SpanContext( new TraceId(BigInteger.valueOf(1000)), new SpanId(2000), new TraceOptions()); contextHandler.attach(initial); StartSpanOptions options = new StartSpanOptions() .setEnableTrace(true) .setEnableStackTrace(true); TraceContext traceContext = tracer.startSpan("foo", options); assertThat(sink.startSpanEvents).hasSize(1); TestTraceSink.StartSpanEvent startEvent1 = sink.startSpanEvents.get(0); SpanContext currentContext = traceContext.getHandle().getCurrentSpanContext(); assertThat(currentContext).isEqualTo(contextHandler.current()); assertThat(currentContext).isEqualTo(startEvent1.context); assertThat(currentContext.getTraceOptions().getTraceEnabled()).isEqualTo(true); assertThat(currentContext.getTraceOptions().getStackTraceEnabled()).isEqualTo(true); assertThat(startEvent1.name).isEqualTo("foo"); }
@Override public TraceContext startSpan(String name) { StartSpanOptions defaultOptions = new StartSpanOptions(); return startSpan(name, defaultOptions); }
SpanContextHandlerTracer implements Tracer { @Override public TraceContext startSpan(String name) { StartSpanOptions defaultOptions = new StartSpanOptions(); return startSpan(name, defaultOptions); } }
SpanContextHandlerTracer implements Tracer { @Override public TraceContext startSpan(String name) { StartSpanOptions defaultOptions = new StartSpanOptions(); return startSpan(name, defaultOptions); } SpanContextHandlerTracer(Set<TraceSink> sinks, SpanContextHandler contextHandler, SpanContextFactory spanContextFactory, TimestampFactory timestampFactory);  SpanContextHandlerTracer(TraceSink sink, SpanContextHandler contextHandler, SpanContextFactory spanContextFactory, TimestampFactory timestampFactory); }
SpanContextHandlerTracer implements Tracer { @Override public TraceContext startSpan(String name) { StartSpanOptions defaultOptions = new StartSpanOptions(); return startSpan(name, defaultOptions); } SpanContextHandlerTracer(Set<TraceSink> sinks, SpanContextHandler contextHandler, SpanContextFactory spanContextFactory, TimestampFactory timestampFactory);  SpanContextHandlerTracer(TraceSink sink, SpanContextHandler contextHandler, SpanContextFactory spanContextFactory, TimestampFactory timestampFactory); @Override TraceContext startSpan(String name); @Override TraceContext startSpan(String name, StartSpanOptions options); @Override void endSpan(TraceContext traceContext); @Override void endSpan(TraceContext traceContext, EndSpanOptions options); @Override void annotateSpan(TraceContext traceContext, Labels labels); @Override void setStackTrace(TraceContext traceContext, StackTrace stackTrace); }
SpanContextHandlerTracer implements Tracer { @Override public TraceContext startSpan(String name) { StartSpanOptions defaultOptions = new StartSpanOptions(); return startSpan(name, defaultOptions); } SpanContextHandlerTracer(Set<TraceSink> sinks, SpanContextHandler contextHandler, SpanContextFactory spanContextFactory, TimestampFactory timestampFactory);  SpanContextHandlerTracer(TraceSink sink, SpanContextHandler contextHandler, SpanContextFactory spanContextFactory, TimestampFactory timestampFactory); @Override TraceContext startSpan(String name); @Override TraceContext startSpan(String name, StartSpanOptions options); @Override void endSpan(TraceContext traceContext); @Override void endSpan(TraceContext traceContext, EndSpanOptions options); @Override void annotateSpan(TraceContext traceContext, Labels labels); @Override void setStackTrace(TraceContext traceContext, StackTrace stackTrace);  }