The DC/OS statsd plugin gathers metrics from applications running as mesos tasks. Tasks with appropriate labels are instrumented for metrics. Service discovery is achieved via task labels.
Each task instrumented for statsd has a dedicated statsd server process. The address of the server is injected into the
container via the standard STATSD_UDP_HOST
and STATSD_UDP_PORT
environment variables.
The metrics received on this server are annotated with the task name and retransmitted to the statsd plugin.
When a task finishes, any metrics it reported that haven't yet been gathered by Telegraf will be discarded. Tasks that
live for a duration shorter than the configured interval
for this input may not have their metrics gathered.
Sample marathon app configuration:
{
id: "statsd-emitter",
cmd: "/opt/mesosphere/bin/statsd-emitter",
labels: {
DCOS_METRICS_TYPE: "statsd"
}
}
This section contains the default TOML to configure the plugin. You can
generate it using telegraf --usage dcos_statsd
.
# Telegraf plugin for gathering metrics from mesos tasks
[[inputs.dcos_statsd]]
## The address on which the command API should listen
listen = "localhost:8888"
## The name of the systemd socket on which the command API should listen. Leave unset to listen on an address.
#systemd_socket_name = "dcos-statsd.socket"
## The directory in which container information is persisted
containers_dir = "/run/dcos/mesos/isolators/com_mesosphere_MetricsIsolatorModule/containers"
## The period after which requests to the API should time out
timeout = "15s"
## The hostname or IP address on which to host statsd servers
statsd_host = "198.51.100.1"
## The number of pending messages each statsd server can hold (default 10000)
#allowed_pending_messages = 10000
With minimal configuration, this plugin expects the cluster to be in permissive mode. Strict mode requires TLS configuration.
This plugin is a special case in that it relays metrics generated by userland code. It is not possible to list these metrics.
All metrics have the following tags:
- container_id
- metrics_type
$ telegraf --config dcos.conf --input-filter dcos_statsd --test
* Plugin: dcos_statsd
cpus,host=172.17.8.102,container_id=12377985-615c-4a1a-a491-721ce7cd807,metrics_type=counter
database.rows.written=12345,database.iops=100 1453831884664956455