Uh oh!
There was an error while loading. Please reload this page.
HDDS-15579. Replace SimpleSpanProcessor with BatchSpanProcessor - #10569
Conversation
sravani-revuri
commented
Jun 22, 2026
@sumitagrawl , could you please review these changes. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adoroszlai
commented
Jun 23, 2026
@sumitagrawl please take a look |
sarvekshayr
left a comment
There was a problem hiding this comment.
Thanks @sravani-revuri for the improvement.
Uh oh!
There was an error while loading. Please reload this page.
This reverts commit 9fcff8c.
sumitagrawl
left a comment
There was a problem hiding this comment.
@sravani-revuri it will cause an unbounded accumulation of telemetry data in the heap memory, Please check limiting the memory for this, loosy is fine if crossing it.
The concern of unbounded heap can be addressed by OTEL_BSP_MAX_QUEUE_SIZE (default=2048). With the default value it's only going to use at most 30MB, which is negligible. |
There was a problem hiding this comment.
Pull request overview
This PR addresses major CLI tracing overhead by switching OpenTelemetry span exporting from synchronous SimpleSpanProcessor to asynchronous BatchSpanProcessor, and by adding a helper to ensure short-lived CLI processes flush buffered spans before exiting.
Changes:
- Replace
SimpleSpanProcessorwithBatchSpanProcessorinTracingUtiland addTracingUtil.execute(...)+flushTracing()for CLI usage. - Update CLI entrypoints (Shell, Freon, OzoneFsShell, OzoneRatis) to use the new
TracingUtil.execute(...)wrapper instead of manual init +executeInNewSpan. - Update compose monitoring config to use
ozone.tracing.enabled(instead of the deprecatedhdds.tracing.enabled).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java | Switch to BatchSpanProcessor; add CLI-oriented execute/flush helpers; improve shutdown handling logic. |
| hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/Shell.java | Use TracingUtil.execute(...) to wrap CLI execution in a span with flushing. |
| hadoop-ozone/freon/src/main/java/org/apache/hadoop/ozone/freon/Freon.java | Wrap Freon execution in TracingUtil.execute(...) to avoid sync export overhead. |
| hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/OzoneRatis.java | Use TracingUtil.execute(...) for tracing span creation + flushing around Ratis shell run. |
| hadoop-ozone/tools/src/main/java/org/apache/hadoop/fs/ozone/OzoneFsShell.java | Wrap fs command execution in TracingUtil.execute(...) and keep conf initialization within the traced scope. |
| hadoop-ozone/dist/src/main/compose/ozone/monitoring.conf | Switch tracing enablement key to ozone.tracing.enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| try { | ||
| // Best-effort: wait up to 10s for span export; remaining spans may be dropped on exit. | ||
| batchSpanProcessor.forceFlush().join(10, TimeUnit.SECONDS); | ||
| } catch (Exception e) { | ||
| LOG.warn("Tracing flush: forceFlush failed", e); | ||
| } |
There was a problem hiding this comment.
This suggestion was considered not critical according to the above review suggestions. do i go ahead with making the change @jojochuang ?
There was a problem hiding this comment.
Copilot doesn't understand prior review comments?
Uh oh!
There was an error while loading. Please reload this page.
jojochuang
left a comment
There was a problem hiding this comment.
lgtm i'd like to merge along with the first copilot suggestion.
One thing to notice is the thread safety. Variables like sdkTracerProvider should ideally be made a volatile. Same for tracer. That is out of the scope so let's move that to a separate task if needed.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adoroszlai
commented
Jul 6, 2026
Thanks @sravani-revuri for the patch, @jojochuang, @sarvekshayr, @sumitagrawl for the review. |
* master: (519 commits) HDDS-14544. OM DB Insights: Duplicate API calls triggered when changing limit selector (apache#10677). HDDS-15587. [Recon] Show 0 for offline DN pending deletion instead of -1 (apache#10585). HDDS-15521. StreamBlockInputStream fails with TimeoutIOException without retry or failover. (apache#10479) HDDS-15170. Add mock-based unit tests for DataStream write path (apache#10230) HDDS-15552. Ratis events should not be published as metrics (apache#10523) HDDS-15746. Bump kerby to 2.1.2 (apache#10666) HDDS-15579. Replace SimpleSpanProcessor with BatchSpanProcessor (apache#10569) HDDS-15747. Address review comments for HDDS-15083 (apache#10669) HDDS-15732. Some ozone commands ignore OZONE_MODULE_ACCESS_ARGS (apache#10655) HDDS-15605. Fix flaky testContainerExclusionWithClosedContainerException (apache#10621) HDDS-11855. Fix flaky TestContainerBalancerDatanodeNodeLimit#checkIterationResultException (apache#10667) HDDS-15741. Bump awssdk to 2.46.17 (apache#10661) HDDS-10307. Speed up TestOzoneManagerHAWithStoppedNodes (apache#10658) HDDS-15651. Test case for DiskBalancer when markContainerForDelete fails (apache#10593) HDDS-15742. Bump nimbus-jose-jwt to 10.9.1 (apache#10662) HDDS-15719. Add check for allowed action usage in workflows (apache#10641) HDDS-15744. Bump javassist to 3.32.0-GA (apache#10665) HDDS-15737. Fix intermittent failure in balancerShouldOnlySelectConfiguredIncludeContainers (apache#10660) HDDS-15743. Bump gson to 2.14.0 (apache#10664) HDDS-11093. Fix intermittent failure in TestContainerBalancerDatanodeNodeLimit#testMetrics (apache#10659) ... Conflicts: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerScanHelper.java
What changes were proposed in this pull request?
while running tracing while creating 100000 keys.
with tracing enabled it currently takes around 25-30 min but with it off it takes around 1-2 min.
currently we are using simplespanprocessor which works synchronously for spans being exported , therefore taking so long.
We should change usage to batchspanprocessor which does the same thing asynchronously
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15579
How was this patch tested?
Manual test.
Command:
BEFORE:
AFTER: