From 17329648b4a6641cdced1946d1d5cd84974766f9 Mon Sep 17 00:00:00 2001 From: andrew0 <739172+andrew0@users.noreply.github.com> Date: Fri, 5 Mar 2021 18:27:07 -0500 Subject: [PATCH] Fix global tracer delegation The base Tracer class wraps the `startSpan`, `inject`, and `extract` functions with some compatibility utilities. Subclasses need to override the `_`-prefixed functions to avoid overriding the wrapper functionality. --- src/global_tracer.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/global_tracer.ts b/src/global_tracer.ts index 4d7f1a3..801fbf1 100644 --- a/src/global_tracer.ts +++ b/src/global_tracer.ts @@ -16,17 +16,17 @@ let _globalTracer: Tracer | null = null; // case where class GlobalTracerDelegate extends Tracer { - startSpan(): any { + _startSpan(): any { const tracer = _globalTracer || noopTracer; return tracer.startSpan.apply(tracer, arguments); } - inject(): any { + _inject(): any { const tracer = _globalTracer || noopTracer; return tracer.inject.apply(tracer, arguments); } - extract(): any { + _extract(): any { const tracer = _globalTracer || noopTracer; return tracer.extract.apply(tracer, arguments); }