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 ApacheHttpClient5Telemetry to ApacheHttpClientTelemetry (since already under v5 package) #12854

Merged
merged 9 commits into from
Dec 11, 2024

Conversation

trask
Copy link
Member

@trask trask commented Dec 8, 2024

ApacheHttpClient5* classes have been deprecated and renamed to ApacheHttpClient*

Part of #12846

See #12867 for change log migration notes entry

@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Dec 8, 2024
@github-actions github-actions bot requested a review from theletterf December 8, 2024 21:07
@trask trask force-pushed the rename-apache-http-client-5 branch from 21004dc to 48d5fac Compare December 9, 2024 00:50
@trask trask force-pushed the rename-apache-http-client-5 branch from 48d5fac to 9c3a4d0 Compare December 9, 2024 04:33
@trask trask marked this pull request as ready for review December 9, 2024 05:24
@trask trask requested a review from a team as a code owner December 9, 2024 05:24
* APIs (or a version of them) may be promoted to the public stable API in the future, but no
* guarantees are made.
*/
public class Experimental {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I don't fully understand why we need to create a Experimental class here. If it's an experimental class, I guest the name may be changed at least in the future. If we recommend users to use it instead of original method with @deprecated. Users may need to make a change when we change the Experimental class. Is there any discussion context about this point before?

Copy link
Member Author

Choose a reason for hiding this comment

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

our stability guarantee doesn't apply to things under .internal. packages

https://github.com/open-telemetry/opentelemetry-java/blob/main/VERSIONING.md#compatibility-requirements

The public API is any public class or method that is not in a package which includes the word internal.

I may not have understood your question though, let me know if this answers or if it was something else, thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

The public API is any public class or method that is not in a package which includes the word internal.

In fact, I want to know why we use an Experimental class to wrap the previous setEmitExperimentalHttpClientMetrics method.
Thank for your hints, because we need to stabilize the HTTP library here, for some experimental methods, in order to modify them easily, we put them in internal package firstly. Is it correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, the experimental methods won't live forever, so we don't want to make them part of public API

public final class Experimental {

@Nullable
private static volatile BiConsumer<ApacheHttpClientTelemetryBuilder, Boolean>
Copy link
Contributor

Choose a reason for hiding this comment

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

Elsewhere we didn't use volatile. I guess it won't do harm but shouldn't also be needed for correctness as this field is set from the static initializer of ApacheHttpClientTelemetryBuilder.

Copy link
Member Author

Choose a reason for hiding this comment

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

shouldn't also be needed for correctness as this field is set from the static initializer of ApacheHttpClientTelemetryBuilder

oh, even if the static field is in a different class than the static initializer?

Copy link
Contributor

@laurit laurit Dec 11, 2024

Choose a reason for hiding this comment

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

I don't think that the barriers care where the fields are, so that at the end of ApacheHttpClientTelemetryBuilder class initializer everything that happened in any class should be visible. Also the setEmitExperimentalTelemetry needs an ApacheHttpClientTelemetryBuilder which requires that the class initializer is run.

@trask trask merged commit de9c891 into open-telemetry:main Dec 11, 2024
56 checks passed
@trask trask deleted the rename-apache-http-client-5 branch December 11, 2024 14:49
}
}

public static void setSetEmitExperimentalTelemetry(
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe consider renaming to something like setEmitExperimentalTelemetryCallback or something similar to get rid of the double set in the name that looks like a typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test native This label can be applied to PRs to trigger them to run native tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants