pub struct DatadogMetricsConfiguration {Show 18 fields
pub max_metrics_per_payload: usize,
pub max_payload_size: usize,
pub max_uncompressed_payload_size: usize,
pub max_series_payload_size: usize,
pub max_series_uncompressed_payload_size: usize,
pub max_series_points_per_payload: usize,
pub flush_timeout: Duration,
pub compressor_kind: String,
pub zstd_compressor_level: i32,
pub use_v2_series_api: bool,
pub log_payloads: bool,
pub additional_tags: Option<SharedTagSet>,
pub v3_api: V3ApiConfig,
pub use_v3_api: UseV3ApiConfig,
pub opw_metrics: OpwMetricsConfiguration,
pub primary_endpoint: String,
pub additional_endpoints: HashMap<String, Vec<String>>,
pub routing: Option<MetricsRouting>,
}Expand description
Datadog Metrics encoder.
Generates Datadog metrics payloads for the Datadog platform.
Fields§
§max_metrics_per_payload: usizeMaximum number of input metrics to encode into a single request payload.
This applies both to the series and sketches endpoints.
max_payload_size: usizeMaximum compressed size, in bytes, of generic payloads.
This applies to V1 JSON series payloads and V2 sketch payloads, matching the Datadog Agent’s generic payload
builder. V2 series payloads use the series-specific limit instead. The effective value is clamped to
the Agent’s default intake-safe limit of 2,621,440 bytes, so larger configured values do not allow payloads that
intake may reject. If set to 0, every non-empty compressed payload exceeds the limit and is dropped during
flush.
max_uncompressed_payload_size: usizeMaximum uncompressed size, in bytes, of generic payloads.
This applies to V1 JSON series payloads and V2 sketch payloads, matching the Datadog Agent’s generic payload builder. V2 series payloads use the series-specific limit instead. The effective value is clamped to the Agent’s default intake-safe limit of 4,194,304 bytes, so larger configured values do not allow payloads that intake may reject. Values smaller than the minimum endpoint framing size prevent the request builder from starting.
max_series_payload_size: usizeMaximum compressed size, in bytes, of a V2 series payload.
This applies only when the V2 series API is in use. V1 series and sketches use the generic payload limit
instead. The effective value is clamped to the V2 series API limit of 512,000 bytes, so larger configured values
do not allow payloads that intake would reject. If set to 0, every non-empty compressed payload exceeds the
limit and is dropped during flush.
max_series_uncompressed_payload_size: usizeMaximum uncompressed size, in bytes, of a V2 series payload.
This applies only when the V2 series API is in use. V1 series and sketches use the generic uncompressed payload limit instead. The effective value is clamped to the V2 series API limit of 5,242,880 bytes, so larger configured values do not allow payloads that intake would reject. This limit protects the encoder before compression, so compressed payload size may still force a separate flush. Values smaller than the minimum endpoint framing size prevent the request builder from starting.
max_series_points_per_payload: usizeMaximum number of data points, across all series, to encode into a single series request payload.
This applies only to series metrics (counters, gauges, rates, sets) and not to sketch metrics (histograms, distributions). A single metric series may contribute multiple data points when it carries more than one timestamp/value pair. When encoding an input would cause the running data point total to exceed this limit, the current payload is flushed first and the input is placed in the next payload.
flush_timeout: DurationFlush timeout for pending requests.
When the destination has written metrics to the in-flight request payload, but it has not yet reached the payload size limits that would force the payload to be flushed, the destination will wait for a period of time before flushing the in-flight request payload. This allows for the possibility of other events to be processed and written into the request payload, thereby maximizing the payload size and reducing the number of requests generated and sent overall.
compressor_kind: StringCompression kind to use for the request payloads.
zstd_compressor_level: i32Effective zstd compression level for the request payloads.
use_v2_series_api: boolWhether to use the V2 API for series metrics.
When true, series metrics are sent to the V2 protobuf endpoint (/api/v2/series). When false, series
metrics are sent to the legacy V1 JSON endpoint (/api/v1/series). Sketch metrics always use the V2 endpoint
(/api/beta/sketches) regardless of this setting.
log_payloads: boolWhether to log metric payload contents before encoding.
This logs decoded metric objects, not the encoded JSON/protobuf HTTP body.
Additional tags to apply to all forwarded metrics, if any.
v3_api: V3ApiConfigV3 API configuration for per-endpoint V3 support.
Configures which endpoints receive V3 payloads.
use_v3_api: UseV3ApiConfigAgent-compatible V3 API configuration.
opw_metrics: OpwMetricsConfigurationMetrics routing to an alternate intake.
primary_endpoint: StringThe primary metrics endpoint, as configured and not altered in any way.
additional_endpoints: HashMap<String, Vec<String>>Additional endpoints that metrics may be dual-shipped to, keyed by endpoint URL with their API keys.
routing: Option<MetricsRouting>Routing targets that series and sketch payloads emitted by this encoder are addressed to.
When unset, payloads are not addressed to specific targets and reach every endpoint of the forwarder. See
with_routing.
Implementations§
Source§impl DatadogMetricsConfiguration
impl DatadogMetricsConfiguration
Sourcepub fn with_routing(
self,
catalog: Arc<RoutingTargetCatalog>,
targets: RoutingTargetSet,
) -> Self
pub fn with_routing( self, catalog: Arc<RoutingTargetCatalog>, targets: RoutingTargetSet, ) -> Self
Addresses series and sketch payloads to the given routing targets.
The forwarder these payloads are sent to must share catalog. Protocol selection then considers only the
targeted endpoints: for example, V2 series payloads are not encoded when every targeted endpoint accepts V3.
Sourcepub fn with_metrics_endpoint_override(self, dd_url: String) -> Self
pub fn with_metrics_endpoint_override(self, dd_url: String) -> Self
Restricts endpoint-aware protocol selection to a single overridden metrics endpoint.
This mirrors a forwarder branch that replaces the normal primary endpoint and removes additional and alternate-intake endpoints, such as Multi-Region Failover.
Sourcepub fn with_v2_series_only(self) -> Self
pub fn with_v2_series_only(self) -> Self
Forces series metrics to use V2.
This is used for local destinations that only accept the V2 series protocol, such as the Cluster Agent.
Trait Implementations§
Source§impl Clone for DatadogMetricsConfiguration
impl Clone for DatadogMetricsConfiguration
Source§fn clone(&self) -> DatadogMetricsConfiguration
fn clone(&self) -> DatadogMetricsConfiguration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl EncoderBuilder for DatadogMetricsConfiguration
impl EncoderBuilder for DatadogMetricsConfiguration
Source§fn input_event_type(&self) -> EventType
fn input_event_type(&self) -> EventType
Source§fn output_payload_type(&self) -> PayloadType
fn output_payload_type(&self) -> PayloadType
Source§impl MemoryBounds for DatadogMetricsConfiguration
impl MemoryBounds for DatadogMetricsConfiguration
Source§fn specify_bounds(&self, builder: &mut MemoryBoundsBuilder<'_>)
fn specify_bounds(&self, builder: &mut MemoryBoundsBuilder<'_>)
Auto Trait Implementations§
impl Freeze for DatadogMetricsConfiguration
impl RefUnwindSafe for DatadogMetricsConfiguration
impl Send for DatadogMetricsConfiguration
impl Sync for DatadogMetricsConfiguration
impl Unpin for DatadogMetricsConfiguration
impl UnsafeUnpin for DatadogMetricsConfiguration
impl UnwindSafe for DatadogMetricsConfiguration
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Source§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
413 Payload Too Large responses. Read moreSource§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more