Skip to content
Closed
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
4 changes: 2 additions & 2 deletions util/tracing/env/traceenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const (
)

func init() {
appcontext.Register(initContext)
appcontext.Register(InitContext)
}
Comment on lines 16 to 18
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we need to keep the init, as that would be dead-code if appcontext is not used (but it will remain a dependency due to it being imported) 🤔

(have not looked how / where it's imported though).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I thought about making other changes to appcontext/this package for that but had concerns about that possibly silently breaking things for other downstream users. If we do that, we should do that together with other changes to make sure we don't silently break, or clearly call it out.

Copy link
Member Author

Choose a reason for hiding this comment

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

(side note, but I really hate inits for this reason, it's much harder to reason about and figure out the blast radius of changes like this)


func initContext(ctx context.Context) context.Context {
func InitContext(ctx context.Context) context.Context {
// open-telemetry/opentelemetry-specification#740
parent := os.Getenv("TRACEPARENT")
state := os.Getenv("TRACESTATE")
Expand Down