Skip to content

Commit 3a6090f

Browse files
committed
more cleanup
1 parent efbb27f commit 3a6090f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

aws-xray-propagator/src/main/java/io/opentelemetry/contrib/awsxray/propagator/AwsXrayPropagator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public final class AwsXrayPropagator implements TextMapPropagator {
7878
private static final int LINEAGE_MAX_COUNTER2 = 255;
7979
private static final int LINEAGE_MIN_COUNTER = 0;
8080
private static final String INVALID_LINEAGE = "-1:11111111:0";
81+
private static final int NUM_OF_LINEAGE_DELIMITERS = 2;
8182

8283
private static final List<String> FIELDS = Collections.singletonList(TRACE_HEADER_KEY);
8384

@@ -225,6 +226,8 @@ private static <C> Context getContextFromHeader(
225226
lineageHeader = parseLineageHeader(value);
226227
if (isValidLineage(lineageHeader)) {
227228
baggageBuilder.put(LINEAGE_KEY, lineageHeader);
229+
} else {
230+
logger.fine("Invalid Lineage header: " + value);
228231
}
229232
}
230233
}
@@ -331,7 +334,7 @@ private static String parseLineageHeader(String xrayLineageHeader) {
331334

332335
if (xrayLineageHeader.length() < LINEAGE_MIN_LENGTH
333336
|| xrayLineageHeader.length() > LINEAGE_MAX_LENGTH
334-
|| numOfDelimiters != 2) {
337+
|| numOfDelimiters != NUM_OF_LINEAGE_DELIMITERS) {
335338
return INVALID_LINEAGE;
336339
}
337340

0 commit comments

Comments
 (0)