Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ServerSpanNaming to HttpRouteHolder #5211

Merged
merged 2 commits into from
Jan 25, 2022

Conversation

mateuszrzeszutek
Copy link
Member

... and ServerSpanNameSupplier/ServerSpanNameTwoArgSupplier to HttpRouteGetter/HttpRouteGetter2 - I used the functional libs/languages as an inspiration here, they usually have interfaces with names like Function2 (e.g. Kotlin).

Another part of #442

@mateuszrzeszutek mateuszrzeszutek requested a review from a team January 24, 2022 09:51

/** An interface for getting the {@code http.route} attribute. */
@FunctionalInterface
public interface HttpRouteGetter2<T, U> {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not obvious to me that it's better but as a reminder, the JDK idiom is to use Bi, not 2, e.g. BiFunction BiConsumer. I guess here our naming is constrained by having a fixed Context param along with the arbitrary ones

Copy link
Contributor

Choose a reason for hiding this comment

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

That being said, I guess having these types is to avoid capturing lambdas, but are we sure the performance improvement is really enough to avoid the simpler Supplier<String> or Function<Context, String>? With inlining and such it's always hard for me to really understand how bad a capturing lambda is

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not obvious to me that it's better but as a reminder, the JDK idiom is to use Bi, not 2, e.g. BiFunction BiConsumer

Changed it HttpRouteBiGetter (because of ToDoubleBiFunction in the JDK)

Copy link
Member

Choose a reason for hiding this comment

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

With inlining and such it's always hard for me to really understand how bad a capturing lambda is

I opened #5215 (targeted to Stable API project) to make sure that this is an optimization worth keeping

@trask trask merged commit edc185b into open-telemetry:main Jan 25, 2022
@mateuszrzeszutek mateuszrzeszutek deleted the rename-ServerSpanNaming branch January 25, 2022 17:46
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Rename ServerSpanNaming to HttpRouteHolder

* HttpRouteBiGetter
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.

3 participants