graphite_param

The `graphite_param` directive defines a parameter for metrics sent to the Graphite server, allowing for customization of the collected stats.

Syntaxgraphite_param key value;
Defaultnone
Contexthttp, server, location, if in location
Arguments4

Description

The graphite_param directive is used to configure additional parameters for the metrics collected by the NGINX Graphite module. It enables users to specify various types of metrics that should be reported to a Graphite server, which can be used for performance monitoring and analytics. The directive is available in several contexts such as http, server, location, and also within an if directive inside a location. This flexibility allows for fine-grained control over what metrics are sent, based on the specific needs of the application or server block.

Parameters that can be specified in the graphite_param directive include various data points concerning the server's performance, like response times, connection counts, or customized metrics defined by the user using a specific syntax. By configuring these parameters, administrators can ensure that only the most relevant data is captured and reported, thus improving monitoring efficiency and potentially reducing overhead on the server.

In practical use, a user might configure multiple graphite_param directives to capture different metrics for different locations or server blocks. This allows tailored metrics gathering that aligns with the needs of distinct application routes or services hosted on the same NGINX instance, leading to better insights into the performance and behavior of each service.

Config Example

http {
    graphite_config server=127.0.0.1;
    server {
        location /api/ {
            graphite_param response_time avg;
            graphite_param request_count sum;
        }
    }
}

Ensure that parameters specified are supported by the Graphite server.

Using incorrect types of metrics can result in errors when sending data to Graphite.

The context in which graphite_param is used may influence which parameters can be defined.

← Back to all directives