Skip to content

Avoid shared internal code in sender-jdk and trace-propagators - #9039

Open
rooks-ns wants to merge 3 commits into
open-telemetry:mainfrom
rooks-ns:fix/avoid-shared-internal-senders
Open

rooks-ns wants to merge 3 commits into
open-telemetry:mainfrom
rooks-ns:fix/avoid-shared-internal-senders

Conversation

@rooks-ns

@rooks-ns rooks-ns commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Addresses #6970 by un-exempting sender and propagator modules from NoSharedInternalCodeTest:

  • Relocated cross-module shared utilities to canonical *.impl packages with @OtelImplJavadoc and regenerated jApiCmp baselines:
    • RetryUtil -> io.opentelemetry.exporter.impl (opentelemetry-exporter-common)
    • DaemonThreadFactory -> io.opentelemetry.sdk.common.impl (opentelemetry-sdk-common)
    • TlsUtil -> io.opentelemetry.exporter.impl (opentelemetry-exporter-common)
  • Removed unused Marshaler internal import in GrpcRequestBody (opentelemetry-exporter-sender-okhttp).
  • Un-exempted artifacts in NoSharedInternalCodeTest:
    • opentelemetry-exporter-sender-jdk
    • opentelemetry-extension-trace-propagators
    • opentelemetry-exporter-sender-okhttp

Related Issues

@otelbot otelbot Bot added the api-change Changes to public API surface area label Nov 14, 2026
@otelbot

otelbot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ API changes detected — additional maintainer review required

@jack-berg @jkwatson

This PR modifies the public API surface area of the following module(s):

  • opentelemetry-sdk-common

Please review the changes in docs/apidiffs/current_vs_latest/ carefully before approving.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-12-04 22:20 UTC

Review the latest changes.

Also blocked by: Merge conflicts.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with the author? Comment /dashboard route:author to route it back.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.48%. Comparing base (e05860a) to head (37b5dd5).

Files with missing lines Patch % Lines
...entelemetry/exporter/internal/TlsConfigHelper.java 84.61% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9039      +/-   ##
============================================
- Coverage     90.50%   90.48%   -0.02%     
- Complexity    11260    11266       +6     
============================================
  Files          1040     1040              
  Lines         30737    30733       -4     
  Branches       4029     4031       +2     
============================================
- Hits          27817    27810       -7     
- Misses         1934     1939       +5     
+ Partials        986      984       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rooks-ns
rooks-ns marked this pull request as ready for review November 15, 2026 08:45
@rooks-ns
rooks-ns requested a review from a team as a code owner November 15, 2026 08:45

@abdessattar23 abdessattar23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I went through the refactoring and the overall direction looks consistent with the *.impl convention and #6970.

One compatibility concern: relocating RetryUtil, TlsUtil, and DaemonThreadFactory removes their previous internal binary names. Older sender/SDK artifacts paired with newer common artifacts can therefore encounter NoClassDefFoundError. I realize internal APIs aren't covered by semver guarantees, but given the version-alignment motivation of #6970, would it make sense to retain delegating compatibility shims, or is that one-time break intentional?

Also, now that these classes are part of the stable impl API surface, a few public constructors and methods need complete Javadocs, notably DaemonThreadFactory(String), TlsUtil.keyManager, TlsUtil.trustManager, and RetryUtil.retryAfterNanos

@rooks-ns

Copy link
Copy Markdown
Contributor Author

@abdessattar23 Yes. It is intentional.

@opentelemetry-pr-dashboard

This comment has been minimized.

@jack-berg jack-berg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks - couple of comments, but this is long overdue. 🙂

@jkwatson jkwatson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm ok with the changes in the impl packages if Jack is ok with them

@rooks-ns
rooks-ns force-pushed the fix/avoid-shared-internal-senders branch 2 times, most recently from 6b30bd4 to bf6c611 Compare November 27, 2026 21:09
…opagators

- Relocate DaemonThreadFactory to io.opentelemetry.sdk.common.impl with private constructors and static factory methods, retaining a @deprecated bridge in sdk.common.internal for binary backward-compatibility
- Add HttpExportUtil.retryAfterNanos to sdk:common and remove sender-jdk dependency on exporters:common
- Pass retryable HTTP and gRPC status codes through HttpSenderConfig and GrpcSenderConfig, with OTLP configs supplying the canonical status code sets
- Resolve default trust manager statelessly in TlsConfigHelper, keeping TlsUtil internal without state mutation
- Remove sender-okhttp production dependency on exporters:common
- Un-exempt sender-jdk, sender-okhttp, and trace-propagators from NoSharedInternalCodeTest
@rooks-ns
rooks-ns force-pushed the fix/avoid-shared-internal-senders branch from bf6c611 to 6ac369c Compare November 27, 2026 23:26
@rooks-ns
rooks-ns requested a review from jack-berg November 29, 2026 19:47
…Logger to impl

- Resolve SSLContext and X509TrustManager pair via TlsConfigHelper.resolve() without mutating builder state

- Remove RetryUtil and inherit default retryable status codes on ImmutableHttpSenderConfig/ImmutableGrpcSenderConfig

- Remove deprecated internal DaemonThreadFactory forwarding shim and clean up sender constructor Javadocs

- Promote ThrottlingLogger to io.opentelemetry.sdk.common.impl for sender modules merged from main
@jack-berg

Copy link
Copy Markdown
Member

Hey thanks for incorporating the feedback. Upon further thinking, I'm nervous about making publishing ThrottlingLogger to opentelemetry-sdk-common because that location isn't accessible to opentelemetry-api, opentelemetry-context. I think opentelemetry-common is better, but it means bringing RateLimiter with it and addressing RateLimiter's dependency on io.opentelemetry.sdk.common.Clock, which cannot be reasonably be relocated.

I've addressed this and a few more minor concerns in the form of a PR against your branch: rooks-ns#1

Haven't got confirmation from other @open-telemetry/java-maintainers on the opentelemetry-common home for these utilities, but its the direction I think we should go.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Changes to public API surface area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants