1 | # Supported Servers
|
2 |
|
3 | StatsD supports pluggable server modules that listen for incoming
|
4 | metrics.
|
5 |
|
6 | StatsD includes the following built-in servers:
|
7 |
|
8 | * UDP (`udp`): Listens for metrics on a UDP port. One UDP packet contains at
|
9 | least one StatsD metric. Multiple metrics can be received in a single packet
|
10 | if separated by the \n character.
|
11 | * TCP (`tcp`): Listens for metrics on a TCP port. Metrics can span multiple TCP
|
12 | packets, meaning each metric must be terminated by the \n character when
|
13 | received over TCP.
|
14 |
|
15 | By default, the `udp` server will be loaded automatically. Currently only a
|
16 | single server can be run at once. To select which server is loaded, set
|
17 | the `server` configuration variable to the server module to load.
|
18 |
|
19 | Servers are just npm modules which implement the interface described in
|
20 | section [Server Interface](./server_interface.md). In order to be able to load the server,
|
21 | add the module name into the `server` variable in your config. As the name is also
|
22 | used in the `require` directive, you can load one of the provided servers by
|
23 | giving the relative path (e.g. `./servers/udp`).
|