Skip to content

Commit d8a4cf9

Browse files
committed
feat: Deprecate CreateChildSpan
`github.com/coopnorge/go-datadog-lib/tracing.CreateChildSpan` nearly identical to `gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer.StartSpanFromContext` there is little value for us to maintain our own version. `CreateChildSpan` does not return a context.Context making it impossible to create child spans and attach logs to correct span. Closes: #409
1 parent c3a8afa commit d8a4cf9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tracing/tracing.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ func CreateNestedTrace(sourceCtx context.Context, operation, resource string) (d
2727
// CreateChildSpan will create a child-span of the span embedded in sourceCtx.
2828
// If there is no trace-information in sourceCtx, a noop-span will be returned.
2929
// The caller is responsible for calling span.Finish().
30+
//
31+
// Deprecated: Use gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer.StartSpanFromContext instead.
3032
func CreateChildSpan(sourceCtx context.Context, operation, resource string) ddtrace.Span {
3133
existingSpan := getSpanFromContext(sourceCtx)
3234
if existingSpan == nil {

0 commit comments

Comments
 (0)