CurrentSpanCustomizer implements SpanCustomizer { @Override public SpanCustomizer tag(String key, String value) { return tracer.currentSpanCustomizer().tag(key, value); } CurrentSpanCustomizer(Tracing tracing); static CurrentSpanCustomizer create(Tracing tracing); @Override SpanCustomizer name(String name); @Override SpanCustomizer tag(String key, String value); @Override SpanCustomizer annotate(String value);  }
@Test public void tag() { span.start(); try (SpanInScope ws = tracing.tracer().withSpanInScope(span)) { spanCustomizer.tag("foo", "bar"); } span.flush(); assertThat(spans).flatExtracting(s -> s.tags().entrySet()) .containsExactly(entry("foo", "bar")); }
@Test public void tag_when_no_current_span() { spanCustomizer.tag("foo", "bar"); }