Struct relay_metrics::aggregator::AggregatorConfig
source · pub struct AggregatorConfig {
pub bucket_interval: u64,
pub initial_delay: u64,
pub max_secs_in_past: u64,
pub max_secs_in_future: u64,
pub max_name_length: usize,
pub max_tag_key_length: usize,
pub max_tag_value_length: usize,
pub max_project_key_bucket_bytes: Option<usize>,
pub max_total_bucket_bytes: Option<usize>,
pub flush_partitions: Option<u64>,
pub flush_batching: FlushBatching,
}
Expand description
Parameters used by the Aggregator
.
Fields§
§bucket_interval: u64
Determines the wall clock time interval for buckets in seconds.
Defaults to 10
seconds. Every metric is sorted into a bucket of this size based on its
timestamp. This defines the minimum granularity with which metrics can be queried later.
initial_delay: u64
The initial delay in seconds to wait before flushing a bucket.
Defaults to 30
seconds. Before sending an aggregated bucket, this is the time Relay waits
for buckets that are being reported in real time.
Relay applies up to a full bucket_interval
of additional jitter after the initial delay to spread out flushing real time buckets.
max_secs_in_past: u64
The age in seconds of the oldest allowed bucket timestamp.
Defaults to 5 days.
max_secs_in_future: u64
The time in seconds that a timestamp may be in the future.
Defaults to 1 minute.
max_name_length: usize
The length the name of a metric is allowed to be.
Defaults to 200
bytes.
max_tag_key_length: usize
The length the tag key is allowed to be.
Defaults to 200
bytes.
max_tag_value_length: usize
The length the tag value is allowed to be.
Defaults to 200
chars.
max_project_key_bucket_bytes: Option<usize>
Maximum amount of bytes used for metrics aggregation per project key.
Similar measuring technique to Self::max_total_bucket_bytes
, but instead of a
global/process-wide limit, it is enforced per project key.
Defaults to None
, i.e. no limit.
max_total_bucket_bytes: Option<usize>
Maximum amount of bytes used for metrics aggregation.
When aggregating metrics, Relay keeps track of how many bytes a metric takes in memory. This is only an approximation and does not take into account things such as pre-allocation in hashmaps.
Defaults to None
, i.e. no limit.
flush_partitions: Option<u64>
The number of logical partitions that can receive flushed buckets.
If set, buckets are partitioned by (bucket key % flush_partitions), and routed
by setting the header X-Sentry-Relay-Shard
.
This setting will take effect only when paired with FlushBatching::Partition
.
flush_batching: FlushBatching
The batching mode for the flushing of the aggregator.
Batching is applied via shifts to the flushing time that is determined when the first bucket is inserted. Thanks to the shifts, Relay is able to prevent flushing all buckets from a bucket interval at the same time.
For example, the aggregator can choose to shift by the same value all buckets within a given partition, effectively allowing all the elements of that partition to be flushed together.
Implementations§
source§impl AggregatorConfig
impl AggregatorConfig
sourcepub fn timestamp_range(&self) -> Range<UnixTimestamp>
pub fn timestamp_range(&self) -> Range<UnixTimestamp>
Returns the valid range for metrics timestamps.
Metrics or buckets outside of this range should be discarded.
Trait Implementations§
source§impl Clone for AggregatorConfig
impl Clone for AggregatorConfig
source§fn clone(&self) -> AggregatorConfig
fn clone(&self) -> AggregatorConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AggregatorConfig
impl Debug for AggregatorConfig
source§impl Default for AggregatorConfig
impl Default for AggregatorConfig
source§impl<'de> Deserialize<'de> for AggregatorConfigwhere
AggregatorConfig: Default,
impl<'de> Deserialize<'de> for AggregatorConfigwhere
AggregatorConfig: Default,
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 AggregatorConfig
impl RefUnwindSafe for AggregatorConfig
impl Send for AggregatorConfig
impl Sync for AggregatorConfig
impl Unpin for AggregatorConfig
impl UnwindSafe for AggregatorConfig
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)