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

Convert TextMapSetters and TextMapGetters to enums #4522

Merged
merged 4 commits into from
Nov 8, 2021

Conversation

iNikem
Copy link
Contributor

@iNikem iNikem commented Oct 27, 2021

All effectively singletons setters and getters were converted to enums. A couple of them which accept a list of propagators for semi-manual propagation could not be converted and so remained.

@trask
Copy link
Member

trask commented Oct 27, 2021

I'm not sure the singleton-ness is used in the new instrumenter api?

@iNikem
Copy link
Contributor Author

iNikem commented Oct 28, 2021

I'm not sure the singleton-ness is used in the new instrumenter api?

WDYM by "used"?

@trask
Copy link
Member

trask commented Oct 28, 2021

I'm not sure the singleton-ness is used in the new instrumenter api?

WDYM by "used"?

we only use the singleton references once (when constructing the instrumenter), so doesn't seem like any advantage to them being singletons over being normal objects?

@iNikem
Copy link
Contributor Author

iNikem commented Oct 30, 2021

Are there any downsides?

@iNikem
Copy link
Contributor Author

iNikem commented Nov 1, 2021

Based on #995 (comment) and the next several comments, I understood that we want to convert these setters and getters to enums. @anuraaga is clearly in favour of this change. Remaining @open-telemetry/java-instrumentation-maintainers , do you vote in favour, against or abstain?

@trask
Copy link
Member

trask commented Nov 1, 2021

Based on #995 (comment) and the next several comments, I understood that we want to convert these setters and getters to enums

that discussion predated the Instrumenter API

@anuraaga is clearly in favour of this change. Remaining @open-telemetry/java-instrumentation-maintainers , do you vote in favour, against or abstain?

I would just ask you or @anuraaga to explain the reason for making them singletons, maybe it's obvious, but I am missing it. Then I would be happy to vote in favor.

@anuraaga
Copy link
Contributor

anuraaga commented Nov 2, 2021

I guess the main reason would be just to make sure they're singletons - for example, while there often isn't a use case, a user could initialize a *Tracing module multiple times for some reason, and there is some benefit then to keep things singleton where possible. In many cases, there won't be a difference though, but it probably doesn't hurt to guarantee singleton just in case.

@mateuszrzeszutek
Copy link
Member

Remaining @open-telemetry/java-instrumentation-maintainers , do you vote in favour, against or abstain?

I think I'd like to abstain - it seems to me that this is purely a stylistic choice; the setter classes perform exactly the same no matter how many instances exist. I don't mind making them all singletons if we decide so.

@iNikem iNikem merged commit e7b8cca into open-telemetry:main Nov 8, 2021
@iNikem iNikem deleted the enums branch November 8, 2021 20:01
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Convert TextMapSetters to enums

* Convert TextMapGetters to enums
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.

None yet

4 participants