Skip to content

Commit a58ca9a

Browse files
darccioclaude
andcommitted
fix(orchestrion): move nil-ctx test spans to children of test.root
GLS propagates the active span through goroutine-local storage even when context.TODO() is used, so spanWithNilNamedCtx and spanWithNilOtherCtx end up as children of test.root rather than separate root traces. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
1 parent b7b6c99 commit a58ca9a

2 files changed

Lines changed: 40 additions & 40 deletions

File tree

internal/orchestrion/_integration/dd-span/no-tag.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,26 @@ func (*TestCase) ExpectedTraces() trace.Traces {
3939
},
4040
},
4141
},
42-
},
43-
},
44-
// Nil *customCtx arguments fall back to context.TODO(), so these spans
45-
// have no parent and appear as separate root traces.
46-
{
47-
Tags: map[string]any{
48-
"name": "spanWithNilNamedCtx",
49-
},
50-
Meta: map[string]string{
51-
"function-name": "spanWithNilNamedCtx",
52-
"nil.ctx": "named",
53-
},
54-
},
55-
{
56-
Tags: map[string]any{
57-
"name": "spanWithNilOtherCtx",
58-
},
59-
Meta: map[string]string{
60-
"function-name": "spanWithNilOtherCtx",
61-
"nil.ctx": "other",
42+
// Nil *customCtx arguments fall back to context.TODO(), but GLS
43+
// propagates the parent span, so these appear as children of test.root.
44+
{
45+
Tags: map[string]any{
46+
"name": "spanWithNilNamedCtx",
47+
},
48+
Meta: map[string]string{
49+
"function-name": "spanWithNilNamedCtx",
50+
"nil.ctx": "named",
51+
},
52+
},
53+
{
54+
Tags: map[string]any{
55+
"name": "spanWithNilOtherCtx",
56+
},
57+
Meta: map[string]string{
58+
"function-name": "spanWithNilOtherCtx",
59+
"nil.ctx": "other",
60+
},
61+
},
6262
},
6363
},
6464
}

internal/orchestrion/_integration/dd-span/tag.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,26 @@ func (tc *TestCase) ExpectedTraces() trace.Traces {
4242
},
4343
},
4444
},
45-
},
46-
},
47-
// Nil *customCtx arguments fall back to context.TODO(), so these spans
48-
// have no parent and appear as separate root traces.
49-
{
50-
Tags: map[string]any{
51-
"name": "spanWithNilNamedCtx",
52-
},
53-
Meta: map[string]string{
54-
"function-name": "spanWithNilNamedCtx",
55-
"nil.ctx": "named",
56-
},
57-
},
58-
{
59-
Tags: map[string]any{
60-
"name": "spanWithNilOtherCtx",
61-
},
62-
Meta: map[string]string{
63-
"function-name": "spanWithNilOtherCtx",
64-
"nil.ctx": "other",
45+
// Nil *customCtx arguments fall back to context.TODO(), but GLS
46+
// propagates the parent span, so these appear as children of test.root.
47+
{
48+
Tags: map[string]any{
49+
"name": "spanWithNilNamedCtx",
50+
},
51+
Meta: map[string]string{
52+
"function-name": "spanWithNilNamedCtx",
53+
"nil.ctx": "named",
54+
},
55+
},
56+
{
57+
Tags: map[string]any{
58+
"name": "spanWithNilOtherCtx",
59+
},
60+
Meta: map[string]string{
61+
"function-name": "spanWithNilOtherCtx",
62+
"nil.ctx": "other",
63+
},
64+
},
6565
},
6666
},
6767
}

0 commit comments

Comments
 (0)