StatsD Configuration
StatsD Statistics
The statsd
top-level configuration object is used to define a destination for the delivery of statistics counters in
StatsD format. Statistics counter values are only stored in memory and will be lost
when N2SVCD is restarted. If you wish to maintain a permanent record of statistics counters then you must deliver
output statistics to a separate StatsD server (such as Telegraf or Prometheus).
An example StatsD configuration using Telegraf-specific output might be:
<statsd>
<host>localhost</host>
<tags>
<tag name="foo" value="bar"/>
<tag name="foo2" value="bar2"/>
</tags>
</statsd>
Configuration Details
The statsd
configuration object supports the following attributes:
Attribute | Type | Description |
---|---|---|
host |
String | IPv4 hostname or A.B.C.D address for the UDP StatsD destination. (Default = 127.0.0.1 ) |
port |
Integer | Port number for UDP StatsD destination. (Default = 8125 ) |
prefix |
String | Common prefix to put on all StatsD statistics. If defined and not an empty string, will have a period appended to it if not already present. Prefix population is not affected by the unique parameter/(Default = empty string, do not use prefix) |
unique |
String | Whether statistic names are forced to be unique. If truthy, application names (and indexes when repeated) are prepended to the statistic name along with the prefix , if any.Otherwise, application names/indexes are automatically sent in tags along with any other specific configured or product tags. The prefix , if any, is sent regardless.(Default: 0 , do not make statistic names unique) |
tags |
Array | Additional static tags to be sent for all statistics. Each tag must specify a name and a value . Configured tags may be overridden at runtime. |
All attributes other than tags
and the content of each tag value
may be evaluated.
Automatic Statistic Tags
When unique
is not truthy, the following tags are populated automatically:
app
: the configured application name.app_instance
: the application index, if repeated.
These tag names may not be defined manually.
Statistic Output
The configuration parameter unique
is used to define the output statistic names.
For example, consider the following statistic details:
- Statistic name:
some.statistic
- Raising application:
Some Application
- Raising application index:
1
(repeated) - Hostname:
somehost
With all other values as the default, this statistic would be sent in each mode as:
unique
is truthy:n2svcd.somehost.Some Application_1.some.statistic
unique
is not truthy:n2svcd.somehost.some.statistic
with tags:app
:Some Application
app_instance
:1
If the application were not repeated, the output would be:
unique
is truthy:n2svcd.somehost.Some Application.some.statistic
unique
is not truthy:n2svcd.somehost.some.statistic
with tags:app
:Some Application
app_instance
: (not sent)