Caution
Grafana Agent has reached End-of-Life (EOL) on November 1, 2025. Agent is no longer receiving vendor support and will no longer receive security or bug fixes. Current users of Agent Static mode, Agent Flow mode, and Agent Operator should proceed with migrating to Grafana Alloy. If you have already migrated to Alloy, no further action is required. Read more about why we recommend migrating to Grafana Alloy.
Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
prometheus.exporter.statsd
The prometheus.exporter.statsd component embeds
statsd_exporter for collecting StatsD-style metrics and exporting them as Prometheus metrics.
Usage
prometheus.exporter.statsd "LABEL" {
}Arguments
The following arguments can be used to configure the exporter’s behavior. All arguments are optional. Omitted fields take their default values.
At least one of listen_udp, listen_tcp, or listen_unixgram should be enabled.
For details on how to use the mapping config file, please check the official
statsd_exporter docs.
Please make sure the kernel parameter net.core.rmem_max is set to a value greater
than the value specified in read_buffer.
Blocks
The prometheus.exporter.statsd component does not support any blocks, and is configured
fully through arguments.
Exported fields
The following fields are exported and can be referenced by other components.
For example, the targets can either be passed to a discovery.relabel
component to rewrite the targets’ label sets, or to a prometheus.scrape
component that collects the exposed metrics.
The exported targets will use the configured in-memory traffic address specified by the run command.
Component health
prometheus.exporter.statsd is only reported as unhealthy if given
an invalid configuration. In those cases, exported fields retain their last
healthy values.
Debug information
prometheus.exporter.statsd does not expose any component-specific
debug information.
Debug metrics
prometheus.exporter.statsd does not expose any component-specific
debug metrics.
Example
This example uses a prometheus.scrape component to collect metrics
from prometheus.exporter.statsd:
prometheus.exporter.statsd "example" {
listen_udp = ""
listen_tcp = "9125"
listen_unixgram = ""
unix_socket_mode = "755"
mapping_config_path = "mapTest.yaml"
read_buffer = 1
cache_size = 1000
cache_type = "lru"
event_queue_size = 10000
event_flush_threshold = 1000
event_flush_interval = "200ms"
parse_dogstatsd_tags = true
parse_influxdb_tags = true
parse_librato_tags = true
parse_signalfx_tags = true
}
// Configure a prometheus.scrape component to collect statsd metrics.
prometheus.scrape "demo" {
targets = prometheus.exporter.statsd.example.targets
forward_to = [ /* ... */ ]
}


