nchan_stub_status

The nchan_stub_status directive provides a way to expose status metrics for Nchan's pub/sub system through an HTTP endpoint.

Syntaxnchan_stub_status;
Defaultnone
Contextlocation
Argumentsnone

Description

The nchan_stub_status directive is designed to facilitate monitoring of the Nchan module's performance and real-time metrics. When implemented in a specific location block within the NGINX configuration, this directive allows administrators to access a URL endpoint that returns crucial statistics related to the Nchan pub/sub server's operation. These statistics typically include the number of active channels, the number of subscribers, and the number of messages published, among other performance indicators.

This directive is particularly useful for maintaining visibility into the performance characteristics of applications using Nchan, allowing for proactive management of resource usage and potential troubleshooting. The output is served in a simple plaintext format, ensuring that it's easy to read and can be integrated into various monitoring tools, such as Prometheus or other custom dashboards. As a result, operators can keep track of their pub/sub system's effectiveness and make informed decisions based on real-time data.

Given the asynchronous nature of Nchan and its ability to handle multiple connections, the nchan_stub_status directive is essential for large-scale applications that rely on the pub/sub model, providing insights that help in keeping the system scalable and efficient.

Config Example

location /nchan-status {
    nchan_stub_status;
}

Ensure that the location block for the nchan_stub_status directive is correctly defined to avoid 404 errors.

If the module is not compiled or enabled in your NGINX build, the directive will not work, leading to configuration errors.

Avoid exposing the nchan_stub_status endpoint publicly in production environments without appropriate access controls, as it provides insight into your internal message bus.

← Back to all directives