diff --git a/src/js/node/diagnostics_channel.ts b/src/js/node/diagnostics_channel.ts index 4c26ff1017fe..8ff68c60567a 100644 --- a/src/js/node/diagnostics_channel.ts +++ b/src/js/node/diagnostics_channel.ts @@ -255,6 +255,14 @@ class TracingChannel { asyncEnd; error; + get hasSubscribers() { + return this.start.hasSubscribers || + this.end.hasSubscribers || + this.asyncStart.hasSubscribers || + this.asyncEnd.hasSubscribers || + this.error.hasSubscribers; + } + constructor(nameOrChannels) { if (typeof nameOrChannels === "string") { this.start = channel(`tracing:${nameOrChannels}:start`);