File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
dd-trace-core/src/test/groovy/datadog/trace/core Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,26 @@ class DDSpanContextTest extends DDCoreSpecification {
314314 context. toString(). contains(" id=-" ) == false
315315 }
316316
317+ def " service name source is propagated from parent to child span" () {
318+ setup :
319+ def parent = tracer. buildSpan(" parentOperation" )
320+ .withServiceName(" fakeService" )
321+ .start()
322+
323+ when :
324+ def child = tracer. buildSpan(" childOperation" )
325+ .asChildOf(parent. context())
326+ .start()
327+ def childContext = child. context() as DDSpanContext
328+
329+ then :
330+ childContext. getServiceNameSource() == ServiceNameSources . MANUAL
331+
332+ cleanup :
333+ child. finish()
334+ parent. finish()
335+ }
336+
317337 static void assertTagmap (Map source , Map comparison , boolean removeThread = false ) {
318338 def sourceWithoutCommonTags = new HashMap (source)
319339 sourceWithoutCommonTags. remove(" runtime-id" )
You can’t perform that action at this time.
0 commit comments