|
4 | 4 | import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.DOUBLE_ATTRIBUTE; |
5 | 5 | import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.LONG_ATTRIBUTE; |
6 | 6 | import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; |
7 | | -import static datadog.trace.core.otlp.trace.OtlpTraceProto.REMOTE_TRACE_FLAG; |
8 | 7 | import static datadog.trace.core.otlp.trace.OtlpTraceProto.SAMPLED_TRACE_FLAG; |
9 | 8 | import static java.util.Arrays.asList; |
10 | 9 | import static java.util.Collections.emptyList; |
@@ -116,12 +115,6 @@ static final class LogSpec { |
116 | 115 | /** event_name (proto field 12); {@code null} → field absent. */ |
117 | 116 | @Nullable final String eventName; |
118 | 117 |
|
119 | | - /** |
120 | | - * If true, wraps the span's IDs in a remote {@link ExtractedContext} so that {@code isRemote()} |
121 | | - * returns true, setting {@code REMOTE_TRACE_FLAG}. |
122 | | - */ |
123 | | - boolean useRemoteContext; |
124 | | - |
125 | 118 | /** |
126 | 119 | * If true, the span at {@code spanContextIndex} is started under a known 128-bit trace ID so |
127 | 120 | * the high-order bytes of trace_id are non-zero. |
@@ -149,11 +142,6 @@ static final class LogSpec { |
149 | 142 | this.eventName = eventName; |
150 | 143 | } |
151 | 144 |
|
152 | | - LogSpec remoteContext() { |
153 | | - this.useRemoteContext = true; |
154 | | - return this; |
155 | | - } |
156 | | - |
157 | 145 | LogSpec use128BitTraceId() { |
158 | 146 | this.use128BitTraceId = true; |
159 | 147 | return this; |
@@ -298,9 +286,6 @@ static Stream<Arguments> cases() { |
298 | 286 | Arguments.of( |
299 | 287 | "log with 128-bit trace ID — high-order trace_id bytes non-zero", |
300 | 288 | asList(contextLog("128-bit trace", 0).use128BitTraceId())), |
301 | | - Arguments.of( |
302 | | - "log with remote span context — REMOTE flag set in flags field", |
303 | | - asList(contextLog("remote context", 0).remoteContext())), |
304 | 289 |
|
305 | 290 | // ── event name ──────────────────────────────────────────────────────── |
306 | 291 | Arguments.of( |
@@ -487,24 +472,15 @@ private static List<DDSpan> buildSpans(List<LogSpec> specs) { |
487 | 472 | } |
488 | 473 |
|
489 | 474 | /** |
490 | | - * Resolves the {@link AgentSpanContext} for a spec: null if no context, remote {@link |
491 | | - * ExtractedContext} if {@code useRemoteContext}, or the span's own context otherwise. |
| 475 | + * Resolves the {@link AgentSpanContext} for a spec: the span's own context, or null if no |
| 476 | + * context. |
492 | 477 | */ |
493 | 478 | @Nullable |
494 | 479 | private static AgentSpanContext resolveContext(List<DDSpan> spans, LogSpec spec) { |
495 | 480 | if (spec.spanContextIndex < 0) { |
496 | 481 | return null; |
497 | 482 | } |
498 | 483 | DDSpan span = spans.get(spec.spanContextIndex); |
499 | | - if (spec.useRemoteContext) { |
500 | | - return new ExtractedContext( |
501 | | - span.getTraceId(), |
502 | | - span.getSpanId(), |
503 | | - PrioritySampling.USER_KEEP, |
504 | | - null, |
505 | | - PropagationTags.factory().empty(), |
506 | | - TracePropagationStyle.DATADOG); |
507 | | - } |
508 | 484 | return span.context(); |
509 | 485 | } |
510 | 486 |
|
@@ -718,11 +694,6 @@ private static void verifyLogRecord( |
718 | 694 | (parsedFlags & SAMPLED_TRACE_FLAG) != 0, |
719 | 695 | "SAMPLED flag must be set in flags [" + caseName + "]"); |
720 | 696 | } |
721 | | - if (ctx.isRemote()) { |
722 | | - assertTrue( |
723 | | - (parsedFlags & REMOTE_TRACE_FLAG) != 0, |
724 | | - "REMOTE flag must be set in flags [" + caseName + "]"); |
725 | | - } |
726 | 697 | if (spec.use128BitTraceId) { |
727 | 698 | long highOrderBytes = readBigEndianLong(parsedTraceId); |
728 | 699 | assertNotEquals( |
|
0 commit comments