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

source

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

source§

fn clone(&self) -> AggregatorConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AggregatorConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for AggregatorConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AggregatorConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for AggregatorConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,