diff --git a/packages/core/src/tracing/clsHooked/async_local_storage_context.js b/packages/core/src/tracing/clsHooked/async_local_storage_context.js index 2b5112add1..c40485eb92 100644 --- a/packages/core/src/tracing/clsHooked/async_local_storage_context.js +++ b/packages/core/src/tracing/clsHooked/async_local_storage_context.js @@ -20,8 +20,6 @@ const unset = require('./unset'); const CONTEXTS_SYMBOL = 'instanaClsHooked@contexts'; -const DEBUG_CLS = !!process.env.DEBUG_CLS; - const storage = new AsyncLocalStorage(); module.exports = { @@ -130,7 +128,6 @@ class Namespace { * @returns {InstanaCLSContext} */ createRootContext() { - // Prototype inherit existing context if created a new child context within existing context. const context = Object.create(Object.prototype); context._ns_name = this.name; context.id = executionAsyncId(); @@ -147,7 +144,6 @@ class Namespace { */ run(fn, ctx) { const context = ctx || this.createContext(); - debug('ALS run enter', context.id, 'active:', this.active ? this.active.id : 'ROOT'); storage.run(context, () => fn(context)); return context; @@ -180,7 +176,6 @@ class Namespace { */ runPromise(fn, ctx) { const context = ctx || this.createContext(); - debug('ALS runPromise enter', context.id, 'active:', this.active ? this.active.id : 'ROOT'); /** * We need the new context to be set as the active context before the promise is called. @@ -354,12 +349,3 @@ function reset() { // @ts-ignore: Property 'instanaNamespaces' does not exist on type 'Process' process.instanaNamespaces = process.instanaNamespaces || {}; - -// @ts-ignore -function debug(...args) { - if (DEBUG_CLS) { - // fs.writeSync(1, `${util.format(...args)}\n`); - // @ts-ignore - process._rawDebug(`${util.format(...args)}`); - } -} diff --git a/packages/core/src/tracing/clsHooked/context.js b/packages/core/src/tracing/clsHooked/context.js index 7a131c35ab..ead5b820c1 100644 --- a/packages/core/src/tracing/clsHooked/context.js +++ b/packages/core/src/tracing/clsHooked/context.js @@ -26,8 +26,6 @@ const unset = require('./unset'); const CONTEXTS_SYMBOL = 'instanaClsHooked@contexts'; -const DEBUG_CLS = !!process.env.DEBUG_CLS; - let currentUid = -1; module.exports = { @@ -120,8 +118,6 @@ Namespace.prototype.createRootContext = function createRootContext() { */ Namespace.prototype.run = function run(fn, ctx) { let context = ctx || this.createContext(); - debug('CLS-HOOKED run enter', context.id, 'active:', this.active ? this.active.id : 'ROOT'); - this.enter(context); try { @@ -159,7 +155,6 @@ Namespace.prototype.runAndReturn = function runAndReturn(fn, ctx) { */ Namespace.prototype.runPromise = function runPromise(fn, ctx) { let context = ctx || this.createContext(); - debug('CLS-HOOKED runPromise enter', context.id, 'active:', this.active ? this.active.id : 'ROOT'); this.enter(context); let promise = fn(context); @@ -424,12 +419,3 @@ function reset() { } // @ts-ignore process.instanaNamespaces = process.instanaNamespaces || {}; - -// @ts-ignore -function debug(...args) { - if (DEBUG_CLS) { - // fs.writeSync(1, `${util.format(...args)}\n`); - // @ts-ignore - process._rawDebug(`${util.format(...args)}`); - } -}