Skip to content

HDDS-14814. Unify Fragmented Traces for Freon randomkeys Command#9957

Open
sravani-revuri wants to merge 5 commits intoapache:masterfrom
sravani-revuri:HDDS-14814
Open

HDDS-14814. Unify Fragmented Traces for Freon randomkeys Command#9957
sravani-revuri wants to merge 5 commits intoapache:masterfrom
sravani-revuri:HDDS-14814

Conversation

@sravani-revuri
Copy link
Contributor

What changes were proposed in this pull request?

Tracing for Freon randomkeys is currently fragmented and has the following issues:

  • Instead of a single trace for a command execution, multiple traces are being created. Therefore breaking the parent-child hierarchy.
  • The root span doesnt contain command name as it appears for ozone sh commands.
  • A single freon rk command creates multiple repetitive spans.

Proposed Changes:
Proper handling of spans is required to ensure a chain of spans is created for the same trace.
Implement span level sampling through custom sampler and enable it through OTEL_SPAN_SAMPLING.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14814

How was this patch tested?

Manual Testing through Jaeger UI and unit tests.

Running Regular Freon Command

Command:

ozone freon rk --numOfVolumes=1 --numOfBuckets=1 --numOfKeys=3 
OTEL_SPAN_SAMPLING=""

Output:

image

Running Span Sampling only

Command:

ozone freon rk --numOfVolumes=1 --numOfBuckets=4 --numOfKeys=2
OTEL_SPAN_SAMPLING=createVolume:1,createBucket:2,createKey:5

Output:

1 CreateVolume call:
image

2 CreateBucket calls:
image

1 CreateKey call:
image

Running Span Sampling with Trace Sampling

Command:

ozone freon rk --numOfVolumes=1 --numOfBuckets=1 --numOfKeys=10 
OTEL_TRACES_SAMPLER_ARG=0.5
OTEL_SPAN_SAMPLING=createVolume:1,createBucket:1,createKey:5

Output:

8 traces visible when command is run 16 times.

image

without sampling 180 spans are generated.

image

Copy link
Contributor

@Gargi-jais11 Gargi-jais11 left a comment

Choose a reason for hiding this comment

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

Thanks @sravani-revuri for the patch.
Left few comments.

@errose28 errose28 requested a review from sumitagrawl March 23, 2026 16:14
Copy link
Contributor

@sumitagrawl sumitagrawl left a comment

Choose a reason for hiding this comment

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

@sravani-revuri thanks for working over this, few comments given

Copy link
Contributor

@sumitagrawl sumitagrawl left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @sravani-revuri for the patch.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @sravani-revuri for updating the patch.

Comment on lines +49 to +51
Method method = TracingUtil.class.getDeclaredMethod("parseSpanSamplingConfig", String.class);
method.setAccessible(true);
Map<String, LoopSampler> result = (Map<String, LoopSampler>) method.invoke(null, config);
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I just noticed this. We should increase visibility of parseSpanSamplingConfig to package-private to avoid reflection in the test.

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.

4 participants