Node.js module
diagnostics_channel
The 'node:diagnostics_channel' module provides a mechanism to create named channels to report arbitrary messages and data within an application. It enables instrumenting libraries and user code without introducing heavy dependencies.
Listeners can subscribe to channels to receive structured diagnostic events, making it useful for logging, tracing, and performance monitoring in production environments.
Fully supported in Bun
Fully implemented.
Functions 6
- diagnostics_channel.boundedChannel()
Creates a BoundedChannel wrapper for the given channels.
- diagnostics_channel.channel()
This is the primary entry-point for anyone wanting to publish to a named channel.
- diagnostics_channel.hasSubscribers()
Check if there are active subscribers to the named channel.
- diagnostics_channel.subscribe()
Register a message handler to subscribe to this channel.
- diagnostics_channel.tracingChannel()
Creates a
TracingChannelwrapper for the givenTracingChannel Channels. - diagnostics_channel.unsubscribe()
Remove a message handler previously registered to this channel with subscribe.
Classes 1
- class diagnostics_channel.Channel
The class
Channelrepresents an individual named channel within the data pipeline.
Interfaces 8
- interface BoundedChannel
The class
BoundedChannelis a simplified version of TracingChannel that only traces synchronous operations. - interface BoundedChannelCollection
- interface BoundedChannelScope
The class
BoundedChannelScoperepresents a disposable scope created by - interface BoundedChannelSubscribers
- interface RunStoresScope
The class
RunStoresScoperepresents a disposable scope created by - interface TracingChannel
The class
TracingChannelis a collection ofTracingChannel Channelswhich together express a single traceable action. - interface TracingChannelCollection
- interface TracingChannelSubscribers