agent_data_plane_config/domains/
metrics_endpoint_routing.rs

1//! Selective metric routing to configured Datadog intakes.
2
3use std::collections::HashMap;
4
5use serde::Serialize;
6
7/// Resolved configuration for selectively routing metrics to configured intakes.
8#[derive(Clone, Debug, Default, PartialEq, Serialize)]
9pub struct Domain {
10    /// Exact metric names permitted to reach each configured intake.
11    ///
12    /// Defaults to an empty map, which leaves ordinary endpoint routing unchanged. Keys must exactly match the
13    /// configured primary endpoint or an entry in `additional_endpoints`. Each value is a case-sensitive exact-name
14    /// allowlist covering both series and sketches. Metrics matching either this list or `metric_prefix_allowlists`
15    /// are forwarded. If both lists for a selected endpoint are empty, all metrics to that endpoint are dropped.
16    /// Operators can use this to reduce metric volume at selected destinations. Changes require a restart.
17    pub metric_allowlists: HashMap<String, Vec<String>>,
18    /// Permits metrics whose names start with a configured literal prefix to reach each intake.
19    ///
20    /// Defaults to an empty map, which adds no prefix policies and leaves `metric_allowlists` unchanged. Keys must
21    /// exactly match the configured primary endpoint or an entry in `additional_endpoints`. Both series and sketches
22    /// are forwarded when their normalized names match either an exact name in `metric_allowlists` or one of these
23    /// prefixes. Matching is case-sensitive and treats every configured character literally.
24    ///
25    /// An empty string matches every valid metric name. If both lists for a selected endpoint are empty, all metrics
26    /// to that endpoint are dropped. Endpoints absent from both maps retain ordinary routing.
27    pub metric_prefix_allowlists: HashMap<String, Vec<String>>,
28}