Skip to content

Commit 38c3d8e

Browse files
geroplroboquat
authored andcommitted
[server] tracing: fix creation of "FOLLOWS_FROM" reference
1 parent af13739 commit 38c3d8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/gitpod-protocol/src/util/tracing.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ export type TraceContextWithSpan = TraceContext & {
2222

2323

2424
export namespace TraceContext {
25-
export function startSpan(operation: string, parentCtx?: TraceContext, ...referencedSpans: (opentracing.Span | opentracing.SpanContext | undefined)[]): opentracing.Span {
25+
export function startSpan(operation: string, parentCtx?: TraceContext, ...referencedSpans: (opentracing.Span | undefined)[]): opentracing.Span {
2626
const options: opentracing.SpanOptions = {};
2727
if (parentCtx) {
2828
options.childOf = parentCtx.span;
2929
}
3030
if (referencedSpans) {
31-
options.references = referencedSpans.filter(s => s !== undefined).map(s => followsFrom(s!));
31+
// note: allthough followsForm's type says it takes 'opentracing.Span | opentracing.SpanContext', it only works with SpanContext (typing mismatch)
32+
options.references = referencedSpans.filter(s => s !== undefined).map(s => followsFrom(s!.context()));
3233
}
3334

3435
return opentracing.globalTracer().startSpan(operation, options);

0 commit comments

Comments
 (0)