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 moreSource§impl Debug for MetricsConfig
impl Debug for MetricsConfig
Source§impl Default for MetricsConfig
impl Default for MetricsConfig
Source§impl<'de> Deserialize<'de> for MetricsConfig
impl<'de> Deserialize<'de> for MetricsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MetricsConfig
impl RefUnwindSafe for MetricsConfig
impl Send for MetricsConfig
impl Sync for MetricsConfig
impl Unpin for MetricsConfig
impl UnsafeUnpin for MetricsConfig
impl UnwindSafe for MetricsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more