use of io.opentracing.tag.StringTag in project jaeger-client-java by jaegertracing.
the class JaegerSpanTest method testSetTag.
@Test
public void testSetTag() {
jaegerSpan.setTag(new StringTag("stringTag"), "stringTagValue").setTag(new IntTag("numberTag"), 1).setTag(new BooleanTag("booleanTag"), true).setTag(new AbstractTag<Object>("objectTag") {
@Override
public void set(Span span, Object tagValue) {
}
}, this);
Map<String, Object> tags = jaegerSpan.getTags();
assertEquals("stringTagValue", tags.get("stringTag"));
assertEquals(1, tags.get("numberTag"));
assertEquals(true, tags.get("booleanTag"));
assertEquals(this, tags.get("objectTag"));
}
use of io.opentracing.tag.StringTag in project jaeger-client-java by jaegertracing.
the class JaegerTracerTest method testWithTagObject.
@Test
public void testWithTagObject() {
JaegerTracer.SpanBuilder spanBuilder = tracer.buildSpan("ndnd");
spanBuilder.withTag(new StringTag("stringTag"), "stringTagValue").withTag(new IntTag("numberTag"), 1).withTag(new BooleanTag("booleanTag"), true).withTag(new AbstractTag<Object>("objectTag") {
@Override
public void set(Span span, Object tagValue) {
}
}, this);
Span span = spanBuilder.start();
Map<String, Object> tags = ((JaegerSpan) span).getTags();
assertEquals("stringTagValue", tags.get("stringTag"));
assertEquals(1, tags.get("numberTag"));
assertEquals(true, tags.get("booleanTag"));
assertEquals(this, tags.get("objectTag"));
span.finish();
}