1
<!--
2
title: "statsd.plugin"
3
-description: "The Netdata Agent is a fully-featured statsd server that collects metrics from any custom application and visualizes them in real-time."
3
+description: "The Netdata Agent is a fully-featured StatsD server that collects metrics from any custom application and visualizes them in real-time."
4
custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/statsd.plugin/README.md
5
-->
6
10
11
If you want to learn more about the StatsD protocol, we have written a [blog post](https://www.netdata.cloud/blog/introduction-to-statsd/) about it!
12
13
-There is a [plethora of client libraries](https://github.com/etsy/statsd/wiki#client-implementations) for embedding statsd metrics to any application framework. This makes statsd quite popular for custom application metrics.
13
14
Netdata is a fully featured statsd server. It can collect statsd formatted metrics, visualize them on its dashboards and store them in it's database for long-term retention.
15
21
22
## Metrics supported by Netdata
23
25
-Netdata fully supports the statsd protocol. All statsd client libraries can be used with Netdata too.
24
+Netdata fully supports the StatsD protocol. All StatsD client libraries can be used with Netdata too.
25
26
- **Gauges**
27
29
- The application sends `name:value|g`, where `value` is any **decimal/fractional** number, statsd reports the latest value collected and the number of times it was updated (events).
28
+ The application sends `name:value|g`, where `value` is any **decimal/fractional** number, StatsD reports the latest value collected and the number of times it was updated (events).
29
30
The application may increment or decrement a previous value, by setting the first character of the value to `+` or `-` (so, the only way to set a gauge to an absolute negative value, is to first set it to zero).
31
35
36
- **Counters** and **Meters**
37
39
- The application sends `name:value|c`, `name:value|C` or `name:value|m`, where `value` is a positive or negative **integer** number of events occurred, statsd reports the **rate** and the number of times it was updated (events).
38
+ The application sends `name:value|c`, `name:value|C` or `name:value|m`, where `value` is a positive or negative **integer** number of events occurred, StatsD reports the **rate** and the number of times it was updated (events).
39
41
- `:value` can be omitted and statsd will assume it is `1`. `|c`, `|C` and `|m` can be omitted an statsd will assume it is `|m`. So, the application may send just `name` and statsd will parse it as `name:1|m`.
40
+ `:value` can be omitted and StatsD will assume it is `1`. `|c`, `|C` and `|m` can be omitted an StatsD will assume it is `|m`. So, the application may send just `name` and StatsD will parse it as `name:1|m`.
41
43
- - Counters use `|c` (etsy/statsd compatible) or `|C` (brubeck compatible)
42
+ - Counters use `|c` (etsy/StatsD compatible) or `|C` (brubeck compatible)
43
- Meters use `|m`
44
45
[Sampling rate](#sampling-rates) is supported.
48
49
- **Timers** and **Histograms**
50
52
- The application sends `name:value|ms` or `name:value|h`, where `value` is any **decimal/fractional** number, statsd reports **min**, **max**, **average**, **sum**, **95th percentile**, **median** and **standard deviation** and the total number of times it was updated (events).
51
+ The application sends `name:value|ms` or `name:value|h`, where `value` is any **decimal/fractional** number, StatsD reports **min**, **max**, **average**, **sum**, **95th percentile**, **median** and **standard deviation** and the total number of times it was updated (events).
52
53
- Timers use `|ms`
54
- Histograms use `|h`
61
62
- **Sets**
63
65
- The application sends `name:value|s`, where `value` is anything (**number or text**, leading and trailing spaces are removed), statsd reports the number of unique values sent and the number of times it was updated (events).
64
+ The application sends `name:value|s`, where `value` is anything (**number or text**, leading and trailing spaces are removed), StatsD reports the number of unique values sent and the number of times it was updated (events).
65
66
Sampling rate is **not** supported for Sets. `value` is always considered text.
67
87
88
#### UDP packets
89
91
-When sending multiple packets over UDP, it is important not to exceed the network MTU, usually about 1500 packets.
90
+When sending multiple packets over UDP, it is important not to exceed the network MTU, which is usually 1500 bytes.
91
92
Netdata will accept UDP packets up to 9000 bytes, but the underlying network will not exceed MTU.
93
151
152
### Private metric charts
153
155
-Private charts are controlled with `create private charts for metrics matching = *`. This setting accepts a space separated list of [simple patterns](/libnetdata/simple_pattern/README.md). Netdata will create private charts for all metrics **by default**
154
+Private charts are controlled with `create private charts for metrics matching = *`. This setting accepts a space-separated list of [simple patterns](/libnetdata/simple_pattern/README.md). Netdata will create private charts for all metrics **by default**.
155
156
For example, to render charts for all `myapp.*` metrics, except `myapp.*.badmetric`, use:
157
165
- `private charts memory mode`
166
- `private charts history`
167
169
-### Optimise private metric charts visualization and storage
168
+### Optimize private metric charts visualization and storage
169
+
170
171
If you have thousands of metrics, each with its own private chart, you may notice that your web browser becomes slow when you view the Netdata dashboard (this is a web browser issue we need to address at the Netdata UI). So, Netdata has a protection to stop creating charts when `max private charts allowed = 200` (soft limit) is reached.
172
246
247
For each application you need to create a `.conf` file in `/etc/netdata/statsd.d`.
248
249
-For example, if you want to monitor the application `myapp` using StatD and Netdata, create the file `/etc/netdata/statsd.d/myapp.conf`, with this content:
250
-
249
+For example, if you want to monitor the application `myapp` using StatsD and Netdata, create the file `/etc/netdata/statsd.d/myapp.conf`, with this content:
250
```
251
[app]
252
name = myapp
283
- `private charts = yes|no`, enables or disables private charts for the metrics matched.
284
- `gaps when not collected = yes|no`, enables or disables gaps on the charts of the application in case that no metrics are collected.
285
- `memory mode` sets the memory mode for all charts of the application. The default is the global default for Netdata (not the global default for StatsD private charts).
287
-- `history` sets the size of the round robin database for this application. The default is the global default for Netdata (not the global default for StatsD private charts). This is only relevant if you use `memory mode = save`. Read more on our guide: [longer metrics storage](https://learn.netdata.cloud/guides/longer-metrics-storage).
286
+
287
+- `history` sets the size of the round robin database for this application. The default is the global default for Netdata (not the global default for StatsD private charts). This is only relevant if you use `memory mode = save`. Read more on our [metrics storage(]/docs/store/change-metrics-storage.md) doc.
288
289
`[dictionary]` defines name-value associations. These are used to renaming metrics, when added to synthetic charts. Metric names are also defined at each `dimension` line. However, using the dictionary dimension names can be declared globally, for each app and is the only way to rename dimensions when using patterns. Of course the dictionary can be empty or missing.
290
526
527
### Shell
528
529
-Getting the proper support for a programming language is not always easy, but shell is always available on most UNIX systems. You can use shell and `nc` to easily instrument your systems and send metric data to Netdata StatsD. Here is how:
529
+Getting the proper support for a programming language is not always easy, but the Unix shell is available on most Unix systems. You can use shell and `nc` to instrument your systems and send metric data to Netdata's StatsD implementation. Here's how:
530
531
The command you need to run is:
532
600
```
601
The function is smart enough to call `nc` just once and pass all the metrics to it. It will also automatically switch to TCP if the metrics to send are above 1000 bytes.
602
603
-If you have gotten thus far, make sure to check out our [Community Forums](https://community.netdata.cloud) to share your experience using Netdata with StatsD.
603
+If you have gotten thus far, make sure to check out our [community forums](https://community.netdata.cloud) to share your experience using Netdata with StatsD.
604
605
[](<>)