@Test public void testNonNullSpanContext() { val testChildSpanContext = noOpsTracer.buildSpan("testChildOperationName").asChildOf(testSpanContext); when(tracer.buildSpan("testChildOperationName")).thenReturn(testChildSpanContext); val resultChildSpan = utilUnderTest.startSpan("testChildOperationName", testSpanContext); Assert.assertEquals(testSpanContext.toTraceId(), resultChildSpan.context().toTraceId()); Assert.assertEquals(testSpanContext.toSpanId(), resultChildSpan.context().getParentId().toString()); }
public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; }
Trace { public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; } }
Trace { public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; } @Autowired  Trace(Tracer tracer); }
Trace { public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; } @Autowired  Trace(Tracer tracer); Span startSpan(String operationName, SpanContext spnContext); SpanContext extractParentSpan(HttpHeaders headers); }
Trace { public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; } @Autowired  Trace(Tracer tracer); Span startSpan(String operationName, SpanContext spnContext); SpanContext extractParentSpan(HttpHeaders headers);  }