Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ddtrace/tracer/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
)

// ContextWithSpan returns a copy of the given context which includes the span s.
//
// ctx must be non-nil. If ctx is nil, context.WithValue panics, "cannot create context from nil parent".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this already panics, shall we add an explicit hard assertion (panic) that could make it easier to explain.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kakkoyun what kind of assertion are you expecting ? A unit test ?

func ContextWithSpan(ctx context.Context, s *Span) context.Context {
newCtx := orchestrion.CtxWithValue(ctx, internal.ActiveSpanKey, s)
return contextWithPropagatedLLMSpan(newCtx, s)
Expand Down
Loading