Skip to content

[BUG]: Documentation bug. Tracer.ChildOf is mentioned in examples, but in code it's set as deprecated #3952

@MartinKosicky

Description

@MartinKosicky

Tracer Version(s)

v2.2.3

Go Version(s)

go version go1.24.6 darwin/arm64

Bug Report

The documentation regarding dd-trace-go v2 documentation regarding distributed tracing has this code:

Then, on the server side, to continue the trace one would do:

  sctx, err := tracer.Extract(tracer.HTTPHeadersCarrier(req.Header))
  // ...
  span := tracer.StartSpan("child.span", tracer.ChildOf(sctx))

But the documentation also says that tracer.ChildOf is deprecated. So like I am confused, how am I supposed to continue with a child span in distributed tracing, if I am a server who was called by someone

Reproduction Code

No response

Error Logs

No response

Go Env Output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunintended behavior that has to be fixedneeds-triageNew issues that have not yet been triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions