Skip to content

Commit 6ae3fa4

Browse files
committed
change lineage variable names
1 parent 5f8c69d commit 6ae3fa4

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

propagators/propagator-aws-xray/src/AWSXRayPropagator.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ const NOT_SAMPLED = '0';
5353
const LINEAGE_KEY = 'Lineage';
5454
const LINEAGE_DELIMITER = ':';
5555
const LINEAGE_HASH_LENGTH = 8;
56-
const LINEAGE_MAX_REQUEST_COUNTER = 255;
57-
const LINEAGE_MAX_LOOP_COUNTER = 32767;
56+
const LINEAGE_MAX_COUNTER_1 = 255;
57+
const LINEAGE_MAX_COUNTER_2 = 32767;
5858

5959
/**
6060
* Implementation of the AWS X-Ray Trace Header propagation protocol. See <a href=
@@ -241,19 +241,19 @@ export class AWSXRayPropagator implements TextMapPropagator {
241241
return false;
242242
}
243243

244-
const requestCounter = parseInt(lineageSubstrings[0]);
245-
const hashedResourceId = lineageSubstrings[1];
246-
const loopCounter = parseInt(lineageSubstrings[2]);
244+
const lineageCounter1 = parseInt(lineageSubstrings[0]);
245+
const hashedString = lineageSubstrings[1];
246+
const lineageCounter2 = parseInt(lineageSubstrings[2]);
247247

248-
const isValidKey =
249-
hashedResourceId.length === LINEAGE_HASH_LENGTH &&
250-
!!hashedResourceId.match(/^[0-9a-fA-F]+$/);
251-
const isValidRequestCounter =
252-
requestCounter >= 0 && requestCounter <= LINEAGE_MAX_REQUEST_COUNTER;
253-
const isValidLoopCounter =
254-
loopCounter >= 0 && loopCounter <= LINEAGE_MAX_LOOP_COUNTER;
248+
const isValidHash =
249+
hashedString.length === LINEAGE_HASH_LENGTH &&
250+
!!hashedString.match(/^[0-9a-fA-F]+$/);
251+
const isValidCounter1 =
252+
lineageCounter1 >= 0 && lineageCounter1 <= LINEAGE_MAX_COUNTER_1;
253+
const isValidCounter2 =
254+
lineageCounter2 >= 0 && lineageCounter2 <= LINEAGE_MAX_COUNTER_2;
255255

256-
return isValidKey && isValidRequestCounter && isValidLoopCounter;
256+
return isValidHash && isValidCounter1 && isValidCounter2;
257257
}
258258

259259
private static _parseTraceFlag(xraySampledFlag: string): TraceFlags | null {

0 commit comments

Comments
 (0)