Monitor Type: statsd
(Source)
Accepts Endpoints: No
Multiple Instances Allowed: Yes
This monitor will receive and aggergate Statsd metrics and convert them to data points. It listens on a configured address and port in order to receive the statsd metrics. Note that this monitor does not support statsd extensions such as tags.
The monitor supports the Counter
, Timer
, Gauge
, and Set
types, which
are dispatched as the SignalFx types counter
, gauge
, gauge
, and
gauge
respectively.
Note: Data points get a host
dimension of the current host that
the agent is running on, not the host from which the statsd metric was sent.
For this reason, it is recommended to send statsd metrics to a local agent
instance. If you don't want the host
dimension, you can set
disableHostDimensions: true
on the monitor configuration.
You can send StatsD metrics locally with netcat
as follows, then verify
in SignalFx that the metric arrived (assuming the default config).
$ echo "statsd.test:1|g" | nc -w 1 -u 127.0.0.1 8125
For Kubernetes environments, use the status.hostIP
environment variable to verify the installation. This environment variable
is the IP address of the node where the pod is running. See Expose Pod Information to Containers Through Files.
The StatsD monitor can parse keywords from a statsd metric name by a set of converters previously configured by the user.
converters:
- pattern: "cluster.cds_{traffic}_{mesh}_{service}-vn_{}.{action}"
...
This parses traffic
, mesh
, service
, and action
as dimensions
from a metric name cluster.cds_egress_ecommerce-demo-mesh_gateway-vn_tcp_8080.update_success
.
If a section has only a pair of brackets without a name, it does not capture a dimension.
If multiple converters are provided, a metric is converted by the first converter with a matching pattern to the metric name.
You can customize a metric name by providing a format string within the converter configuration.
converters:
- pattern: "cluster.cds_{traffic}_{mesh}_{service}-vn_{}.{action}"
metricName: "{traffic}.{action}"
The metrics that match to the given pattern are reported to SignalFx as {traffic}.{action}
.
For instance, metric name cluster.cds_egress_ecommerce-demo-mesh_gateway-vn_tcp_8080.update_success
is reported as egress.update_success
.
metricName
is required for a converter configuration. A converter is
disabled if metricName
is not provided.
To activate this monitor in the Smart Agent, add the following to your agent config:
monitors: # All monitor config goes under this key
- type: statsd
... # Additional config
For a list of monitor options that are common to all monitors, see Common Configuration.
Config option | Required | Type | Description |
---|---|---|---|
listenAddress |
no | string |
The host/address on which to bind the UDP listener that accepts statsd datagrams (default: localhost ) |
listenPort |
no | integer |
The port on which to listen for statsd messages (default: 8125 ) |
metricPrefix |
no | string |
A prefix in metric names that needs to be removed before metric name conversion |
converters |
no | list of objects (see below) |
A list converters to convert StatsD metric names into SignalFx metric names and dimensions |
The nested converters
config object has the following fields:
Config option | Required | Type | Description |
---|---|---|---|
pattern |
no | string |
A pattern to match against StatsD metric names |
metricName |
no | string |
A format to compose a metric name to report to SignalFx |
The agent does not do any built-in filtering of metrics coming out of this monitor.