Add Http Trace Propagation and implement extract and inject methods in ThundraTracer #40
Conversation
|
||
_extractBaggageItems(carrier: any, spanContext: ThundraSpanContext) { | ||
Object.keys(carrier).forEach((key) => { | ||
const pattern = new RegExp(`^${TextMapPropagator.BAGGAGE_PREFIX}(.+)$`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be constant at the TextMapPropagator
level so there won't be parse for the regexp itself every time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
|
||
if (!HttpIntegration.isValidUrl(host)) { | ||
return request.apply(this, [options, callback]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, in case of invalid url that we are not interested in, headers should not be passed in the options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, if the url is invalid we do not create span and inject any headers.
Pull Request Test Coverage Report for Build 240
💛 - Coveralls |
src/plugins/Trace.ts
Outdated
className: ClassNames.LAMBDA, | ||
}); | ||
|
||
this.rootSpan.spanContext.parentId = propagatedSpanContext.spanId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this be done by passing span context to _startSpan
here? (Passing traceId
, transactionId
, parentId
and baggageItems
at once in the span context itself) So we don't need to modify span context after created it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, added parentContext
option to _startSpan
method.
No description provided.