push_stream_channels_statistics

Activates channels statistics for the NGINX Push Stream module.

Syntaxpush_stream_channels_statistics;
Defaultnone
Contextlocation
Argumentsnone

Description

The push_stream_channels_statistics directive is used in the NGINX Push Stream module to enable the collection and retrieval of statistics for various channels. This can be particularly useful for monitoring purposes, as it allows users to track data such as the number of active subscribers per channel, the number of messages sent, and other relevant metrics. When enabled in a location block, it converts that endpoint into a channel statistics reporting endpoint, which can output data in JSON format based on request parameters.

This directive does not take any arguments and is added to a location context, meaning its scope is limited to the specific URL patterns defined in the server configuration. Once the directive is activated at a given location, users can access channel statistics with specific query parameters, such as specifying a channel ID or requesting consolidated statistics for all channels. This functionality helps administrators gain insights into channel activity and resource usage to enhance the overall performance of applications using the push stream capabilities.

Config Example

server {
    location /channels-stats {
        push_stream_channels_statistics;
        push_stream_channels_path $arg_id;
    }
}

Ensure that the directive is used within a location block; it is context-sensitive and will not operate correctly outside of this context.

Remember to specify query parameters correctly when accessing statistics to avoid error responses.

← Back to all directives