add b3 header for trace propagation on initial webhook

This commit is contained in:
Dave Horton
2022-03-30 15:12:44 -04:00
parent ff8d7f3648
commit dbe925af05
4 changed files with 29 additions and 5 deletions

View File

@@ -44,6 +44,21 @@ class RootSpan {
return this._span.spanContext().traceId;
}
get spanId() {
return this._span.spanContext().spanId;
}
get traceFlags() {
return this._span.spanContext().traceFlags;
}
getTracingPropagation(encoding) {
// TODO: support encodings beyond b3 https://github.com/openzipkin/b3-propagation
if (this._span && this.traceId !== '00000000000000000000000000000000') {
return `${this.traceId}-${this.spanId}-1`;
}
}
setAttributes(attrs) {
this._span.setAttributes(attrs);
}