@opentelemetry/propagator-aws-xray
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -68,5 +68,13 @@ /* | ||
AWSXRayPropagator.prototype.getSpanContextFromHeader = function (carrier, getter) { | ||
var traceHeader = getter.get(carrier, AWSXRAY_TRACE_ID_HEADER); | ||
if (!traceHeader || typeof traceHeader !== 'string') | ||
var headerKeys = getter.keys(carrier); | ||
var relevantHeaderKey = headerKeys.find(function (e) { | ||
return e.toLowerCase() === AWSXRAY_TRACE_ID_HEADER; | ||
}); | ||
if (!relevantHeaderKey) { | ||
return INVALID_SPAN_CONTEXT; | ||
} | ||
var traceHeader = getter.get(carrier, relevantHeaderKey); | ||
if (!traceHeader || typeof traceHeader !== 'string') { | ||
return INVALID_SPAN_CONTEXT; | ||
} | ||
var pos = 0; | ||
@@ -73,0 +81,0 @@ var trimmedPart; |
@@ -46,3 +46,3 @@ "use strict"; | ||
const spanContext = (_a = api_1.trace.getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext(); | ||
if (!spanContext || !api_1.isSpanContextValid(spanContext)) | ||
if (!spanContext || !(0, api_1.isSpanContextValid)(spanContext)) | ||
return; | ||
@@ -62,3 +62,3 @@ const otTraceId = spanContext.traceId; | ||
const spanContext = this.getSpanContextFromHeader(carrier, getter); | ||
if (!api_1.isSpanContextValid(spanContext)) | ||
if (!(0, api_1.isSpanContextValid)(spanContext)) | ||
return context; | ||
@@ -71,5 +71,13 @@ return api_1.trace.setSpan(context, api_1.trace.wrapSpanContext(spanContext)); | ||
getSpanContextFromHeader(carrier, getter) { | ||
const traceHeader = getter.get(carrier, exports.AWSXRAY_TRACE_ID_HEADER); | ||
if (!traceHeader || typeof traceHeader !== 'string') | ||
const headerKeys = getter.keys(carrier); | ||
const relevantHeaderKey = headerKeys.find(e => { | ||
return e.toLowerCase() === exports.AWSXRAY_TRACE_ID_HEADER; | ||
}); | ||
if (!relevantHeaderKey) { | ||
return api_1.INVALID_SPAN_CONTEXT; | ||
} | ||
const traceHeader = getter.get(carrier, relevantHeaderKey); | ||
if (!traceHeader || typeof traceHeader !== 'string') { | ||
return api_1.INVALID_SPAN_CONTEXT; | ||
} | ||
let pos = 0; | ||
@@ -112,3 +120,3 @@ let trimmedPart; | ||
}; | ||
if (!api_1.isSpanContextValid(resultSpanContext)) { | ||
if (!(0, api_1.isSpanContextValid)(resultSpanContext)) { | ||
return api_1.INVALID_SPAN_CONTEXT; | ||
@@ -136,3 +144,3 @@ } | ||
// Check the content of trace id | ||
if (!api_1.isValidTraceId(resTraceId)) { | ||
if (!(0, api_1.isValidTraceId)(resTraceId)) { | ||
return api_1.INVALID_TRACEID; | ||
@@ -143,3 +151,3 @@ } | ||
static _parseSpanId(xrayParentId) { | ||
return api_1.isValidSpanId(xrayParentId) ? xrayParentId : api_1.INVALID_SPANID; | ||
return (0, api_1.isValidSpanId)(xrayParentId) ? xrayParentId : api_1.INVALID_SPANID; | ||
} | ||
@@ -146,0 +154,0 @@ static _parseTraceFlag(xraySampledFlag) { |
{ | ||
"name": "@opentelemetry/propagator-aws-xray", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "OpenTelemetry AWS Xray propagator provides context propagation for systems that are using AWS X-Ray format.", | ||
@@ -68,3 +68,3 @@ "main": "build/src/index.js", | ||
"ts-mocha": "10.0.0", | ||
"typescript": "4.3.5", | ||
"typescript": "4.4.4", | ||
"webpack": "4.46.0" | ||
@@ -76,3 +76,3 @@ }, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/propagators/opentelemetry-propagator-aws-xray#readme", | ||
"gitHead": "bd79bd04cba3f16658caf37d9a5c65e5bd5980f6" | ||
"gitHead": "63e0fc9b6b862f74304abf0343c506a5bd415191" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44169
400