Skip to content

Commit

Permalink
exclude propagation for now so we can test the algo
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Dec 4, 2024
1 parent c5fbef3 commit 903dbab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ public SamplingResult shouldSample(
.shouldSample(parentContext, traceId, name, spanKind, attributes, parentLinks)
.getDecision();
if (SamplingDecision.RECORD_AND_SAMPLE.equals(parentDecision)) {
DynamicSampler.setSampled(traceId);
// todo: fix propagation
// DynamicSampler.setSampled(traceId);
}

// always return true - because a child span might be sampled even if the parent is not
// todo: fix propagation
// return SamplingResult.recordOnly();
return SamplingResult.recordAndSample();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public <RESPONSE> void customize(
static String toHeaderValue(Context context) {
ReadWriteSpan span = (ReadWriteSpan) Span.fromContext(context);
SpanContext spanContext = span.getSpanContext();
boolean sampled = DynamicSampler.evaluateSampled(span);
// boolean sampled = DynamicSampler.evaluateSampled(span);
// todo: fix propagation
boolean sampled = false;
TraceParentHolder traceParentHolder = new TraceParentHolder();
W3CTraceContextPropagator.getInstance()
.inject(
Expand Down

0 comments on commit 903dbab

Please sign in to comment.