Skip to content

RATIS-2553. Isolate OpenTelemetry tracing dependencies#1478

Open
HTHou wants to merge 1 commit into
apache:masterfrom
HTHou:RATIS-2553
Open

RATIS-2553. Isolate OpenTelemetry tracing dependencies#1478
HTHou wants to merge 1 commit into
apache:masterfrom
HTHou:RATIS-2553

Conversation

@HTHou

@HTHou HTHou commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This patch isolates OpenTelemetry-specific tracing code behind a TraceProvider facade. The default tracing path uses a no-op provider, so downstream projects can exclude OpenTelemetry jars without loading OTel classes from the default Ratis tracing path.

OpenTelemetry tracing behavior is preserved when tracing is enabled and the OpenTelemetry jars are available. The patch also removes OpenTelemetry SDK and semantic convention dependencies from the main dependency path and keeps SDK testing dependencies in test scope.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2553

How was this patch tested?

  • ./mvnw -pl ratis-common,ratis-server,ratis-test -am test-compile -DskipTests
  • ./mvnw -pl ratis-server -am -Dtest=RaftServerImplTracingTests -DfailIfNoTests=false test
  • ./mvnw -pl ratis-server -am dependency:tree -Dscope=compile -Dincludes=io.opentelemetry,io.opentelemetry.semconv -DskipTests
  • Manually verified with a classpath excluding OpenTelemetry jars that TraceUtils.setTracerWhenEnabled(true) falls back to no-op tracing instead of failing with linkage errors.

@HTHou HTHou marked this pull request as ready for review June 11, 2026 09:23
@szetszwo

szetszwo commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@HTHou , We do plan to make tracing configurable; see #1341 (comment)

Thanks a lot for starting the work! Will review this soon.

Cc @taklwu

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