@Test public void testStartSpanWithOptions() { StartSpanOptions options = new StartSpanOptions(); options.setSpanKind(SpanKind.RPC_CLIENT); Timestamp ts = new Timestamp() { @Override public long getSeconds() { return 1; } @Override public int getNanos() { return 2; } }; options.setTimestamp(ts); TraceContext traceContext = tracer.startSpan("foo", options); assertThat(sink.startSpanEvents).hasSize(1); TestTraceSink.StartSpanEvent startEvent1 = sink.startSpanEvents.get(0); assertThat(traceContext.getHandle().getCurrentSpanContext()).isEqualTo(contextHandler.current()); assertThat(traceContext.getHandle().getCurrentSpanContext()).isEqualTo(startEvent1.context); assertThat(startEvent1.name).isEqualTo("foo"); assertThat(startEvent1.kind).isEqualTo(SpanKind.RPC_CLIENT); assertThat(startEvent1.timestamp).isEqualTo(ts); }
@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);  }