Our StatsD integration lets you easily get StatsD-format data into New Relic. You can also add any arbitrary tags (key-value pairs) to your data. Once your metrics are in New Relic, you can query your data and create custom charts and dashboards.
In the install procedure, you run nri-statsd with environment variables, and this generates a TOML configuration file. Additionally, you can set these configuration options:
If a metric is not updated for this amount of time, we stop reporting that metric. Default is 5m.
If you want to send the metrics only if the value was updated between the flush intervals, configure this to 1ms. To never expire metrics, set it to 0.
list of integers
Specifies the percentiles used for metrics aggregation. Default: 90.
Indicates address on which to listen for metrics. Default: :8125.
From nri-statsd v2.3.0 (goStatsD v34.2.1), connection via Unix Domain Socket (UDS) is supported. Use "metrics-addr=/some/path/newrelic-statsd.socket" instead of "[host]:port" in the configuration.
To ensure FedRAMP compliance when using the StatsD integration you must define the following endpoints in the custom configuration:
By default, nri_statsd calculates the following for timer metrics: standard deviation, mean, median, sum, lower, and upper bounds for the flush interval. If you want to disable those metrics you can do it by adding a disabled-sub-metrics configuration section and set true for the ones you want disabled. Here's an example:
The best approach to configure nri-statsd running in Kubernetes is to use a configMap and mount the configMap into the container. (This is a similar process to mounting the configuration file in Docker.)
Optional for simple counters or timer counters. When many metrics must be sent, you can use sampling to reduce network traffic. The downside is a reduction in the resolution of the data.
An example of how this would work for sample rates below 1: If you set this to 0.1, the counter would send a measurement one out of every 10 times.
Optional. Tags attached to your metrics are converted into attributes (key-value pairs). For more on tagging options, see Tags.
Here are the types of metrics and how to format them:
A counter measures the number of occurrences of an event. Examples include cache hits per reporting interval and the number of threads created per reporting interval.
A counter can be incremented or decremented during the same flush interval by adding a sign to the value. In the following example, the counter value will be 2:
At each flush, the current count is sent and reset to 0. If the count is not updated, at the next flush it will send the value 0. You can opt to disable this behavior by setting expiry-interval to 1ms.
Here’s an example of a counter that is being sampled 1 out of 10 times:
A gauge represents a value that can increase or decrease with time. Examples of gauges include temperature, CPU usage, and memory. Here's an example:
If the gauge is not updated, at the next flush it will send the previous value. You can opt to disable this behavior by setting expiry-interval to 1ms.
The timer metric type measures timing data.
By default, nri_statsd calculates the following for timer metrics: standard deviation, mean, median, sum, lower, and upper bounds for the flush interval. These are sent as sub-metrics in the following format:
The configured percentiles will generate the following metrics. The percentile threshold value will be attached as a tag.