Skip to content

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Sep 16, 2024

Hopefully resolves #12234

@laurit laurit requested a review from a team September 16, 2024 11:45
return holder != null ? holder.route : null;
}

public static void set(Context context, String route) {
Copy link
Member

Choose a reason for hiding this comment

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

maybe rename to updateIfExists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are similar set methods in other ImplicitContextKeyed implementations. If we are going to rename then we should rename all the similar usages and probably the get method also. I think the holder != null check is just defensive coding. It really should not be null unless the instrumented code has changed in an unexpected way, so the IfExists suffix isn't really necessary in my opinion.

this.route = route;
}

public static Context with(Context context, String route) {
Copy link
Member

Choose a reason for hiding this comment

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

maybe rename to withIfNotExists?

Copy link
Contributor

Choose a reason for hiding this comment

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

or simply init?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed to init because init is in a couple of other ImplicitContextKeyed implementations

@trask trask merged commit d666c35 into open-telemetry:main Sep 17, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vert.x Web Router/SubRouter causes root span name / route to be incorrect

4 participants