server_traffic_status_filter

Enables filtering of stream server traffic status data based on specific criteria.

Syntaxserver_traffic_status_filter on|off;
Defaultoff
Contextstream, stream server
Argumentsflag

Description

The server_traffic_status_filter directive allows administrators to filter the data returned by the stream server traffic status module in NGINX. When enabled, this directive can help in narrowing down the traffic statistics that are relevant for specific conditions or requirements. This is particularly useful for optimizing performance monitoring and analytics by targeting specific streams or servers without overwhelming the user with irrelevant data.

This directive can be added to the stream or stream server contexts, reflecting its capability to manage traffic statistics at both the general stream level and the specific server level. The acceptance of a flag as its argument indicates that it can be turned on or off, providing flexibility for the administrator's needs and allowing for dynamic changes without the necessity to reload configurations completely.

The behavior of this directive is closely tied to other stream status directives, where enabling filters may work in conjunction with configuring specific keys, limiting the types of connections counted, or managing how data gets aggregated for reporting. By utilizing this filter, users are encouraged to combine it with other directives to ensure the data reflects what is genuinely needed for their analytical or monitoring tasks, maintaining a streamlined view of the server's status.

Config Example

stream {
    server {
        listen 12345;
        ...
        server_traffic_status_filter on;
    }
}

Ensure that the server has the NGINX stream server traffic status core module installed; otherwise, this directive will not function.

Avoid combining multiple filter directives that might conflict, leading to data inconsistencies in traffic statistics.

Be cautious when using this directive in a high-load environment as filtering may introduce additional overhead.

← Back to all directives