From 4b27b68ceb73077c2c97cc4401b26318e8e459d1 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Sat, 3 Dec 2022 16:15:51 +0100 Subject: [PATCH] Prevent using telemetry if ZIPKIN_URL is not set --- src/telemetry.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/telemetry.ts b/src/telemetry.ts index 085b8310..864e2ec1 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -19,6 +19,10 @@ let provider: NodeTracerProvider; export function TelemetryClass() { return function (classObj) { + if (!process.env.ZIPKIN_URL) { + return; + } + const stackTrace = new Error().stack.split('\n'); if (stackTrace.length < 3) { return;