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

Remove -alpha artifacts from runtime classpath of stable components #6944

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jack-berg
Copy link
Member

Sketch out what it looks like to remove -alpha artifacts (especially opentelemetry-api-incubator) from the runtime classpath of stable components.

Approach is:

  • Switch from implementation to compileOnly dependencies
  • Adjust internals to detect whether -alpha artifact is present on classpath (i.e. provided by the user) and toggle behavior based on whether it is or isnt
  • To ensure safety when -alpha artifacts are not provided by user, make sure main test suite runs without -alpha artifacts.
  • To ensure safety when -alpha artifacts are present, introduce new test suite including the -alpha artifacts, and test the impacted behavior

This is related to a possible adjustment of our versioning guidelines. If we went in this direction, a user adding only stable dependencies could always run ./gradlew dependencies and will not see any -alpha artifacts on the runtime classpath.

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 88.00000% with 24 lines in your changes missing coverage. Please review.

Project coverage is 90.01%. Comparing base (efdacc1) to head (6361036).

Files with missing lines Patch % Lines
...pentelemetry/sdk/trace/ExtendedSdkSpanBuilder.java 63.63% 16 Missing ⚠️
...elemetry/sdk/logs/ExtendedSdkLogRecordBuilder.java 63.63% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6944      +/-   ##
============================================
- Coverage     90.09%   90.01%   -0.09%     
- Complexity     6601     6630      +29     
============================================
  Files           730      746      +16     
  Lines         19843    19982     +139     
  Branches       1955     1955              
============================================
+ Hits          17877    17986     +109     
- Misses         1371     1401      +30     
  Partials        595      595              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

"-Xlint:-options",
// Fail build on any warning
"-Werror",
"-Xlint:-options"
Copy link
Member Author

Choose a reason for hiding this comment

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

Revert

@@ -16,7 +16,6 @@ dependencies {
protoSource("io.opentelemetry.proto:opentelemetry-proto:${versions["io.opentelemetry.proto"]}")

api(project(":exporters:common"))
implementation(project(":api:incubator"))
Copy link
Member Author

Choose a reason for hiding this comment

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

Unused now that Value is stable.

return NOOP_METER.counterBuilder(NOOP_INSTRUMENT_NAME);
}
try {
Class.forName("io.opentelemetry.api.incubator.metrics.ExtendedLongCounter");
Copy link
Member Author

Choose a reason for hiding this comment

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

Was fast and loose with this. Before considering merging, would refactor to call this once and cache the result.

Comment on lines +39 to +45
try {
Class.forName("io.opentelemetry.api.incubator.trace.ExtendedTracer");
return IncubatingUtil.createIncubatingTracer(
sharedState, instrumentationScopeInfo, tracerConfig);
} catch (Exception e) {
return new SdkTracer(sharedState, instrumentationScopeInfo, tracerConfig);
}
Copy link
Member

Choose a reason for hiding this comment

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

maybe?

Suggested change
try {
Class.forName("io.opentelemetry.api.incubator.trace.ExtendedTracer");
return IncubatingUtil.createIncubatingTracer(
sharedState, instrumentationScopeInfo, tracerConfig);
} catch (Exception e) {
return new SdkTracer(sharedState, instrumentationScopeInfo, tracerConfig);
}
if (IncubatingUtil.isPresent()) {
return IncubatingUtil.createIncubatingTracer(
sharedState, instrumentationScopeInfo, tracerConfig);
} else {
return new SdkTracer(sharedState, instrumentationScopeInfo, tracerConfig);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup yup that's my plan

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.

2 participants