pub struct MetricsConfig {
pub addr: Option<String>,
pub prefix: String,
pub buffer_size: Option<usize>,
pub tags: BTreeMap<String, String>,
}Expand description
Configuration for the DogStatsD metrics exporter.
When addr is None, metrics are no-ops (the global recorder is never installed).
§Environment Variables
OS__METRICS__ADDR— StatsD address (e.g.127.0.0.1:8125orunixgram:///tmp/statsd.sock)OS__METRICS__PREFIX— global metric name prefixOS__METRICS__BUFFER_SIZE— maximum payload length in bytesOS__METRICS__TAGS__KEY=value— per-key global tags
Fields§
§addr: Option<String>Remote address to forward metrics to.
When None, metrics are disabled (the global recorder is not installed and all
metric calls are no-ops).
For UDP, the address must be in the format <host>:<port> (e.g. 127.0.0.1:8125).
For Unix domain sockets, use the format <scheme>://<path>, where the scheme is
either unix (stream, SOCK_STREAM) or unixgram (datagram, SOCK_DGRAM).
§Default
None (metrics disabled)
§Environment Variable
OS__METRICS__ADDR
prefix: StringGlobal prefix prepended to every metric name.
The prefix is prepended to every metric name, with a . separator added automatically.
§Default
"objectstore"
§Environment Variable
OS__METRICS__PREFIX
buffer_size: Option<usize>Maximum payload length in bytes.
Controls the maximum size per StatsD payload. Should match the Datadog Agent’s
dogstatsd_buffer_size setting. If None, the exporter uses its default
(1432 bytes for UDP, 8192 bytes for Unix sockets).
§Default
None (exporter default)
§Environment Variable
OS__METRICS__BUFFER_SIZE
Global tags applied to all metrics.
Key-value pairs attached to every emitted metric. Useful for identifying environment, region, or other deployment-specific dimensions.
§Default
Empty (no tags)
§Environment Variables
Each tag is set individually:
OS__METRICS__TAGS__FOO=fooOS__METRICS__TAGS__BAR=bar
§YAML Example
metrics:
tags:
foo: foo
bar: barTrait Implementations§
Source§impl Clone for MetricsConfig
impl Clone for MetricsConfig
Source§fn clone(&self) -> MetricsConfig
fn clone(&self) -> MetricsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more