From f62d08e67a30193e9a3b3bca2c612a9c8e6cd34d Mon Sep 17 00:00:00 2001 From: Tristan Colgate Date: Wed, 27 Jun 2018 11:44:34 +0100 Subject: [PATCH] Fix for non-null parentSpanId --- packages/opencensus-exporter-jaeger/src/jaeger-driver/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/opencensus-exporter-jaeger/src/jaeger-driver/index.ts b/packages/opencensus-exporter-jaeger/src/jaeger-driver/index.ts index 734ce921a..bc58b1712 100644 --- a/packages/opencensus-exporter-jaeger/src/jaeger-driver/index.ts +++ b/packages/opencensus-exporter-jaeger/src/jaeger-driver/index.ts @@ -60,12 +60,13 @@ export function spanToThrift(span: Span) { const spanLogs = []; const unsigned = true; const length = span.spanContext.traceId.length; + const parentSpan = span.parentSpanId ? Utils.encodeInt64(span.parentSpanId) : ThriftUtils.emptyBuffer; return { traceIdLow: Utils.encodeInt64(span.spanContext.traceId), traceIdHigh: ThriftUtils.emptyBuffer, spanId: Utils.encodeInt64(span.spanContext.spanId), - parentSpanId: span.parentSpanId || ThriftUtils.emptyBuffer, + parentSpanId: parentSpan, operationName: span.name, references: [], flags: span.spanContext.options || 0x1,