Check if any of the start or end channels have subscribers.
import { boundedChannel } from 'node:diagnostics_channel';
const wc = boundedChannel('my-operation');
if (wc.hasSubscribers) {
// There are subscribers, perform traced operation
}
property
Check if any of the start or end channels have subscribers.
import { boundedChannel } from 'node:diagnostics_channel';
const wc = boundedChannel('my-operation');
if (wc.hasSubscribers) {
// There are subscribers, perform traced operation
}