Skip to content

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

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

rooks-ns wants to merge 1 commit 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 the author · refreshed 2026-11-26 07:21 UTC

Two things need attention:

  • Required checks are failing — investigate the failures.
  • 1 review item — respond to each (e.g. link a commit, explain why not, ask a follow-up):
    • Inline threads: 1
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 reviewers? Comment /dashboard route:reviewers to route it to them.
  • 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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.45%. Comparing base (4ce8c01) to head (eb58500).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9039      +/-   ##
============================================
- Coverage     90.45%   90.45%   -0.01%     
+ Complexity    11179    11178       -1     
============================================
  Files          1032     1032              
  Lines         30500    30500              
  Branches       3991     3991              
============================================
- Hits          27590    27588       -2     
  Misses         1935     1935              
- Partials        975      977       +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

Copy link
Copy Markdown

Hi @rooks-ns — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.

  • Replying is enough to hand it off — answer, explain why no change is needed, or ask a follow-up. The dashboard routes it onward once nothing on the list is waiting on you.
  • To hand it back for any other reason, including the dashboard getting this wrong, comment /dashboard route:reviewers.

@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. 🙂

Comment on lines +39 to +40
* <p>This class is not intended for use by application developers. Its API is stable and will not
* be changed or removed in a backwards-incompatible manner.

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.

Could we resolve the default trust manager in TlsConfigHelper and pass it alongside the SSL context through HttpSenderConfig / GrpcSenderConfig, instead of making TlsUtil.defaultTrustManager() stable? Those interfaces already promise a non-null trust manager when the context is non-null. Initializing the context with that manager would satisfy the contract and avoid delegating this default to individual senders.

*/

package io.opentelemetry.exporter.internal;
package io.opentelemetry.exporter.impl;

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.

Could TlsUtil.keyManager and TlsUtil.trustManager stay internal? Their only production caller is TlsConfigHelper, in this module. The other callers are tests, which can use shared internal code without requiring a stable API commitment.

Comment on lines +24 to +25
* This class is not intended for use by application developers. Its API is stable and will not be
* changed or removed in a backwards-incompatible manner.

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.

retryableGrpcStatusCodes() and retryableHttpResponseCodes() encode OTLP retry policy, but the senders are not restricted to OTLP. Rather than stabilizing these as generic retry utilities, could we pass retryable status codes through HttpSenderConfig / GrpcSenderConfig and have the OTLP implementations supply the OTLP-specific sets? Any new configuration methods would need compatibility-preserving defaults.

*/

package io.opentelemetry.exporter.internal;
package io.opentelemetry.exporter.impl;

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.

Making retryAfterNanos stable makes sense, but could it live in sdk:common, alongside the sender SPI in io.opentelemetry.sdk.common.export, under an HTTP-specific utility name? Parsing Retry-After is HTTP transport functionality, not exporter-specific policy.

Comment on lines +17 to +18
* <p>This class is not intended for use by application developers. Its API is stable and will not
* be changed or removed in a backwards-incompatible manner.

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.

Moving this to impl makes sense. Before stabilizing the constructors, could we replace them with static factories, e.g. create(namePrefix) and createWithDelegate(namePrefix, delegate)? Named factories let us express the purpose of each creation variant without committing to constructor overloads.

@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

…opagators

- Relocate DaemonThreadFactory to io.opentelemetry.sdk.common.impl with shielded private constructors and static factory methods
- 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
- Resolve default trust manager in TlsConfigHelper when client certs are present, keeping TlsUtil internal
- 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 eb58500 to 6b30bd4 Compare November 26, 2026 06:53

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