@Test public void testAlwaysSampleErrors() { long startTime = System.currentTimeMillis(); String traceId = UUID.randomUUID().toString(); Span span = Span.newBuilder(). setCustomer("dummy"). setStartMillis(startTime). setDuration(4). setName("testSpanName"). setSource("testsource"). setSpanId("testspanid"). setTraceId(traceId). setAnnotations(ImmutableList.of(new Annotation("error", "true"))). build(); SpanSampler sampler = new SpanSampler(new DurationSampler(5), true); assertTrue(sampler.sample(span)); sampler = new SpanSampler(new DurationSampler(5), false); assertFalse(sampler.sample(span)); }
public boolean sample(Span span) { return sample(span, null); }
SpanSampler { public boolean sample(Span span) { return sample(span, null); } }
SpanSampler { public boolean sample(Span span) { return sample(span, null); } SpanSampler(Sampler delegate, boolean alwaysSampleErrors); }
SpanSampler { public boolean sample(Span span) { return sample(span, null); } SpanSampler(Sampler delegate, boolean alwaysSampleErrors); boolean sample(Span span); boolean sample(Span span, @Nullable Counter discarded); }
SpanSampler { public boolean sample(Span span) { return sample(span, null); } SpanSampler(Sampler delegate, boolean alwaysSampleErrors); boolean sample(Span span); boolean sample(Span span, @Nullable Counter discarded);  }