diff --git a/components/gitpod-protocol/src/util/tracing.ts b/components/gitpod-protocol/src/util/tracing.ts index 89d0ffe604b748..3bc49a56f263ef 100644 --- a/components/gitpod-protocol/src/util/tracing.ts +++ b/components/gitpod-protocol/src/util/tracing.ts @@ -22,9 +22,16 @@ export type TraceContextWithSpan = TraceContext & { export namespace TraceContext { export function startSpan(operation: string, parentCtx?: TraceContext): opentracing.Span { const options: opentracing.SpanOptions = {}; - if (parentCtx && parentCtx.span && !!parentCtx.span.context().toSpanId()) { - options.childOf = parentCtx.span; + + // try out: https://github.com/jaegertracing/jaeger-client-node/issues/432 + if (!!parentCtx?.span) { + options.references = [opentracing.followsFrom(parentCtx?.span)]; } + + // if (parentCtx && parentCtx.span && !!parentCtx.span.context().toSpanId()) { + // options.childOf = parentCtx.span; + // } + // TODO(gpl) references lead to a huge amount of errors in prod logs. Avoid those until we have time to figure out how to fix it. // if (referencedSpans) { // // note: allthough followsForm's type says it takes 'opentracing.Span | opentracing.SpanContext', it only works with SpanContext (typing mismatch)