@Test public void testStartSpanAddsAgentLabel() { TraceContext traceContext = tracer.startSpan("foo"); assertThat(sink.annotateEvents).hasSize(1); TestTraceSink.AnnotateEvent annotateEvent = sink.annotateEvents.get(0); assertThat(annotateEvent.context).isEqualTo(traceContext.getHandle().getCurrentSpanContext()); String expectedAgent = "cloud-trace-java " + SdkVersion.get(); assertThat(annotateEvent.labels.getLabels()).contains(new Label("/agent", expectedAgent)); }
@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);  }