Docs » Configure application receivers » Configure application receivers for networks » Statsd

Statsd 🔗

Description 🔗

The Splunk Distribution of OpenTelemetry Collector provides this integration as the statsd monitor via the Smart Agent Receiver.

This monitor receives and aggregates statsd metrics and converts them to data points. This monitor listens on a configured address and port 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 Splunk Observability Cloud 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, 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.

Installation 🔗

This monitor is available in the SignalFx Smart Agent Receiver, which is part of the Splunk Distribution of OpenTelemetry Collector.

To install this integration:

  1. Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform.

  2. Configure the monitor, as described in the next section.

Verifying installation 🔗

You can send statsd metrics locally with netcat as follows, then verify in Observability Cloud that the metric arrived (assuming the default configuration).

$ 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.

Configuration 🔗

The Splunk Distribution of OpenTelemetry Collector allows embedding a Smart Agent monitor configuration in an associated Smart Agent Receiver instance.

Note: Providing a statsd monitor entry in your Smart Agent or Collector configuration is required for its use. Use the appropriate form for your agent type.

Smart Agent 🔗

To activate this monitor in the Smart Agent, add the following to your agent configuration:

monitors:  # All monitor config goes under this key
  - type: statsd
    ...  # Additional config

See Smart Agent example configuration for an autogenerated example of a YAML configuration file, with default values where applicable.

Splunk Distribution of OpenTelemetry Collector 🔗

To activate this monitor in the Splunk Distribution of OpenTelemetry Collector, add the following to your agent configuration:

receivers:
  smartagent/statsd:
    type: statsd
    ...  # Additional config

To complete the monitor activation, you must also include the smartagent/statsd receiver item in a metrics pipeline. To do this, add the receiver item to the service > pipelines > metrics > receivers section of your configuration file.

See configuration examples for specific use cases that show how the collector can integrate and complement existing environments.

Configuration settings 🔗

The following table shows the configuration options for the statsd monitor:

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 configuration object has the following fields:

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 Smart Agent does not do any built-in filtering of metrics that come out of this monitor.

Metrics 🔗

This section describes how metrics can be collected with this monitor.

Adding dimensions to statsd metrics 🔗

The statsd monitor can parse keywords from a statsd metric name by a set of converters that was configured by user, as shown in the following example:

converters:
  - pattern: "cluster.cds_{traffic}_{mesh}_{service}-vn_{}.{action}"
    ...

This converter parses traffic, mesh, service, and action as dimensions from the cluster.cds_egress_ecommerce-demo-mesh_gateway-vn_tcp_8080.update_success metric. If a section has only a pair of brackets without a name, it does not capture a dimension.

When multiple converters are provided, a metric is converted by the first converter with a matching pattern to the metric name.

Formatting metric name 🔗

You can customize a metric name by providing a format string within the converter configuration, as shown in the following example:

converters:
  - pattern: "cluster.cds_{traffic}_{mesh}_{service}-vn_{}.{action}"
    metricName: "{traffic}.{action}"

The metrics that match to the given pattern are reported to Infrastructure Monitoring as {traffic}.{action}. For instance, metric 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.