diff --git a/relay_event_schema/processor/derive.ProcessValue.html b/relay_event_schema/processor/derive.ProcessValue.html index 02b5fe400b..8c7dec95e3 100644 --- a/relay_event_schema/processor/derive.ProcessValue.html +++ b/relay_event_schema/processor/derive.ProcessValue.html @@ -1,4 +1,4 @@ -ProcessValue in relay_event_schema::processor - Rust

Derive Macro relay_event_schema::processor::ProcessValue

#[derive(ProcessValue)]
+ProcessValue in relay_event_schema::processor - Rust

Derive Macro relay_event_schema::processor::ProcessValue

source ·
#[derive(ProcessValue)]
 {
     // Attributes available to this derive:
     #[metastructure]
diff --git a/relay_filter/trait.Filterable.html b/relay_filter/trait.Filterable.html
index 0387996335..c7ed184553 100644
--- a/relay_filter/trait.Filterable.html
+++ b/relay_filter/trait.Filterable.html
@@ -1,20 +1,20 @@
 Filterable in relay_filter - Rust

Trait relay_filter::Filterable

source ·
pub trait Filterable {
     // Required methods
-    fn csp(&self) -> Option<&Csp>;
-    fn exceptions(&self) -> Option<&Values<Exception>>;
+    fn csp(&self) -> Option<&Csp>;
+    fn exceptions(&self) -> Option<&Values<Exception>>;
     fn ip_addr(&self) -> Option<&str>;
-    fn logentry(&self) -> Option<&LogEntry>;
+    fn logentry(&self) -> Option<&LogEntry>;
     fn release(&self) -> Option<&str>;
     fn transaction(&self) -> Option<&str>;
     fn url(&self) -> Option<Url>;
     fn user_agent(&self) -> Option<&str>;
 }
Expand description

A data item to which filters can be applied.

-

Required Methods§

source

fn csp(&self) -> Option<&Csp>

The CSP report contained in the item. Only for CSP reports.

-
source

fn exceptions(&self) -> Option<&Values<Exception>>

The exception values of the item. Only for error events.

+

Required Methods§

source

fn csp(&self) -> Option<&Csp>

The CSP report contained in the item. Only for CSP reports.

+
source

fn exceptions(&self) -> Option<&Values<Exception>>

The exception values of the item. Only for error events.

source

fn ip_addr(&self) -> Option<&str>

The IP address of the client that sent the data.

-
source

fn logentry(&self) -> Option<&LogEntry>

The logentry message. Only for error events.

+
source

fn logentry(&self) -> Option<&LogEntry>

The logentry message. Only for error events.

source

fn release(&self) -> Option<&str>

The release string of the data item.

source

fn transaction(&self) -> Option<&str>

The transaction name. Only for transaction events.

source

fn url(&self) -> Option<Url>

The URL from which the request originates. Used for localhost filtering.

source

fn user_agent(&self) -> Option<&str>

The user agent of the client that sent the data.

-

Implementations on Foreign Types§

source§

impl Filterable for Event

source§

fn csp(&self) -> Option<&Csp>

source§

fn exceptions(&self) -> Option<&Values<Exception>>

source§

fn ip_addr(&self) -> Option<&str>

source§

fn logentry(&self) -> Option<&LogEntry>

source§

fn release(&self) -> Option<&str>

source§

fn transaction(&self) -> Option<&str>

source§

fn url(&self) -> Option<Url>

source§

fn user_agent(&self) -> Option<&str>

source§

impl Filterable for Replay

source§

fn csp(&self) -> Option<&Csp>

source§

fn exceptions(&self) -> Option<&Values<Exception>>

source§

fn ip_addr(&self) -> Option<&str>

source§

fn logentry(&self) -> Option<&LogEntry>

source§

fn release(&self) -> Option<&str>

source§

fn transaction(&self) -> Option<&str>

source§

fn url(&self) -> Option<Url>

source§

fn user_agent(&self) -> Option<&str>

source§

impl Filterable for Span

source§

fn csp(&self) -> Option<&Csp>

source§

fn exceptions(&self) -> Option<&Values<Exception>>

source§

fn ip_addr(&self) -> Option<&str>

source§

fn logentry(&self) -> Option<&LogEntry>

source§

fn release(&self) -> Option<&str>

source§

fn transaction(&self) -> Option<&str>

source§

fn url(&self) -> Option<Url>

source§

fn user_agent(&self) -> Option<&str>

Implementors§

\ No newline at end of file +

Implementations on Foreign Types§

source§

impl Filterable for Event

source§

impl Filterable for Replay

source§

impl Filterable for Span

Implementors§

\ No newline at end of file diff --git a/relay_monitors/fn.process_check_in.html b/relay_monitors/fn.process_check_in.html index 40294da4b0..c49e88d438 100644 --- a/relay_monitors/fn.process_check_in.html +++ b/relay_monitors/fn.process_check_in.html @@ -1,5 +1,5 @@ process_check_in in relay_monitors - Rust

Function relay_monitors::process_check_in

source ·
pub fn process_check_in(
     payload: &[u8],
-    project_id: ProjectId,
+    project_id: ProjectId,
 ) -> Result<ProcessedCheckInResult, ProcessCheckInError>
Expand description

Normalizes a monitor check-in payload.

\ No newline at end of file diff --git a/relay_server/enum.PolymorphicEnvelopeBuffer.html b/relay_server/enum.PolymorphicEnvelopeBuffer.html index 4fd3e2c38d..c972f52fa8 100644 --- a/relay_server/enum.PolymorphicEnvelopeBuffer.html +++ b/relay_server/enum.PolymorphicEnvelopeBuffer.html @@ -8,29 +8,29 @@ object safe.

Variants§

§

InMemory(EnvelopeBuffer<MemoryStackProvider>)

An enveloper buffer that uses in-memory envelopes stacks.

§

Sqlite(EnvelopeBuffer<SqliteStackProvider>)

An enveloper buffer that uses sqlite envelopes stacks.

-

Implementations§

source§

impl PolymorphicEnvelopeBuffer

source

pub fn is_external(&self) -> bool

Returns true if the implementation stores envelopes on external storage (e.g. disk).

+

Implementations§

source§

impl PolymorphicEnvelopeBuffer

source

pub fn is_external(&self) -> bool

Returns true if the implementation stores envelopes on external storage (e.g. disk).

source

pub async fn from_config( config: &Config, memory_checker: MemoryChecker, ) -> Result<Self, EnvelopeBufferError>

Creates either a memory-based or a disk-based envelope buffer, depending on the given configuration.

source

pub async fn initialize(&mut self)

Initializes the envelope buffer.

-
source

pub async fn push( +

source

pub async fn push( &mut self, envelope: Box<Envelope>, ) -> Result<(), EnvelopeBufferError>

Adds an envelope to the buffer.

-
source

pub async fn peek(&mut self) -> Result<Peek<'_>, EnvelopeBufferError>

Returns a reference to the next-in-line envelope.

-
source

pub async fn pop( +

source

pub async fn peek(&mut self) -> Result<Peek<'_>, EnvelopeBufferError>

Returns a reference to the next-in-line envelope.

+
source

pub async fn pop( &mut self, ) -> Result<Option<Box<Envelope>>, EnvelopeBufferError>

Pops the next-in-line envelope.

-
source

pub fn mark_ready(&mut self, project: &ProjectKey, is_ready: bool) -> bool

Marks a project as ready or not ready.

+
source

pub fn mark_ready(&mut self, project: &ProjectKey, is_ready: bool) -> bool

Marks a project as ready or not ready.

The buffer re-prioritizes its envelopes based on this information. Returns true if at least one priority was changed.

-
source

pub fn mark_seen(&mut self, project_key_pair: &ProjectKeyPair)

Marks a stack as seen.

+
source

pub fn mark_seen(&mut self, project_key_pair: &ProjectKeyPair)

Marks a stack as seen.

Non-ready stacks are deprioritized when they are marked as seen, such that the next call to .peek() will look at a different stack. This prevents head-of-line blocking.

-
source

pub fn has_capacity(&self) -> bool

Returns true whether the buffer has capacity to accept new [Envelope]s.

+
source

pub fn has_capacity(&self) -> bool

Returns true whether the buffer has capacity to accept new [Envelope]s.

Trait Implementations§

source§

impl Debug for PolymorphicEnvelopeBuffer

source§

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

Formats the value using the given formatter. 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 diff --git a/relay_server/struct.SqliteEnvelopeStack.html b/relay_server/struct.SqliteEnvelopeStack.html index 1671a9983b..f22d0d9946 100644 --- a/relay_server/struct.SqliteEnvelopeStack.html +++ b/relay_server/struct.SqliteEnvelopeStack.html @@ -1,7 +1,7 @@ SqliteEnvelopeStack in relay_server - Rust

Struct relay_server::SqliteEnvelopeStack

source ·
pub struct SqliteEnvelopeStack { /* private fields */ }
Expand description

An EnvelopeStack that is implemented on an SQLite database.

For efficiency reasons, the implementation has an in-memory buffer that is periodically spooled to disk in a batched way.

-

Implementations§

source§

impl SqliteEnvelopeStack

source

pub fn new( +

Implementations§

source§

impl SqliteEnvelopeStack

source

pub fn new( envelope_store: SqliteEnvelopeStore, disk_batch_size: usize, max_batches: usize, @@ -9,8 +9,8 @@ sampling_key: ProjectKey, check_disk: bool, ) -> Self

Creates a new empty SqliteEnvelopeStack.

-

Trait Implementations§

source§

impl Debug for SqliteEnvelopeStack

source§

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

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

impl EnvelopeStack for SqliteEnvelopeStack

§

type Error = SqliteEnvelopeStackError

The error type that is returned when an error is encountered during reading or writing the -EnvelopeStack.
source§

async fn push(&mut self, envelope: Box<Envelope>) -> Result<(), Self::Error>

Pushes an [Envelope] on top of the stack.
source§

async fn peek(&mut self) -> Result<Option<&Envelope>, Self::Error>

Peeks the [Envelope] on top of the stack.
source§

async fn pop(&mut self) -> Result<Option<Box<Envelope>>, Self::Error>

Pops the [Envelope] on top of the stack.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for SqliteEnvelopeStack

source§

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

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

impl EnvelopeStack for SqliteEnvelopeStack

§

type Error = SqliteEnvelopeStackError

The error type that is returned when an error is encountered during reading or writing the +EnvelopeStack.
source§

async fn push(&mut self, envelope: Box<Envelope>) -> Result<(), Self::Error>

Pushes an [Envelope] on top of the stack.
source§

async fn peek(&mut self) -> Result<Option<&Envelope>, Self::Error>

Peeks the [Envelope] on top of the stack.
source§

async fn pop(&mut self) -> Result<Option<Box<Envelope>>, Self::Error>

Pops the [Envelope] on top of the stack.

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/relay_server/trait.EnvelopeStack.html b/relay_server/trait.EnvelopeStack.html index bf92a5c8fb..76da828ba5 100644 --- a/relay_server/trait.EnvelopeStack.html +++ b/relay_server/trait.EnvelopeStack.html @@ -25,4 +25,4 @@
source

fn pop( &mut self, ) -> impl Future<Output = Result<Option<Box<Envelope>>, Self::Error>>

Pops the [Envelope] on top of the stack.

-

Object Safety§

This trait is not object safe.

Implementors§

source§

impl EnvelopeStack for SqliteEnvelopeStack

§

type Error = SqliteEnvelopeStackError

\ No newline at end of file +

Object Safety§

This trait is not object safe.

Implementors§

source§

impl EnvelopeStack for SqliteEnvelopeStack

§

type Error = SqliteEnvelopeStackError

\ No newline at end of file diff --git a/relay_spans/fn.otel_to_sentry_span.html b/relay_spans/fn.otel_to_sentry_span.html index 3c9fab8239..4d63534753 100644 --- a/relay_spans/fn.otel_to_sentry_span.html +++ b/relay_spans/fn.otel_to_sentry_span.html @@ -1,2 +1,2 @@ -otel_to_sentry_span in relay_spans - Rust

Function relay_spans::otel_to_sentry_span

source ·
pub fn otel_to_sentry_span(otel_span: Span) -> Span
Expand description

Transform an OtelSpan to a Sentry span.

+otel_to_sentry_span in relay_spans - Rust

Function relay_spans::otel_to_sentry_span

source ·
pub fn otel_to_sentry_span(otel_span: Span) -> Span
Expand description

Transform an OtelSpan to a Sentry span.

\ No newline at end of file diff --git a/src/relay_server/services/buffer/envelope_buffer/mod.rs.html b/src/relay_server/services/buffer/envelope_buffer/mod.rs.html index 5943dbd3f1..f9d7af84a5 100644 --- a/src/relay_server/services/buffer/envelope_buffer/mod.rs.html +++ b/src/relay_server/services/buffer/envelope_buffer/mod.rs.html @@ -1047,6 +1047,12 @@ 1047 1048 1049 +1050 +1051 +1052 +1053 +1054 +1055
use std::cmp::Ordering;
 use std::collections::BTreeSet;
 use std::convert::Infallible;
@@ -1124,28 +1130,34 @@
 
     /// Adds an envelope to the buffer.
     pub async fn push(&mut self, envelope: Box<Envelope>) -> Result<(), EnvelopeBufferError> {
-        match self {
-            Self::Sqlite(buffer) => buffer.push(envelope).await,
-            Self::InMemory(buffer) => buffer.push(envelope).await,
-        }?;
+        relay_statsd::metric!(timer(RelayTimers::BufferPush), {
+            match self {
+                Self::Sqlite(buffer) => buffer.push(envelope).await,
+                Self::InMemory(buffer) => buffer.push(envelope).await,
+            }?;
+        });
         relay_statsd::metric!(counter(RelayCounters::BufferEnvelopesWritten) += 1);
         Ok(())
     }
 
     /// Returns a reference to the next-in-line envelope.
     pub async fn peek(&mut self) -> Result<Peek, EnvelopeBufferError> {
-        match self {
-            Self::Sqlite(buffer) => buffer.peek().await,
-            Self::InMemory(buffer) => buffer.peek().await,
-        }
+        relay_statsd::metric!(timer(RelayTimers::BufferPeek), {
+            match self {
+                Self::Sqlite(buffer) => buffer.peek().await,
+                Self::InMemory(buffer) => buffer.peek().await,
+            }
+        })
     }
 
     /// Pops the next-in-line envelope.
     pub async fn pop(&mut self) -> Result<Option<Box<Envelope>>, EnvelopeBufferError> {
-        let envelope = match self {
-            Self::Sqlite(buffer) => buffer.pop().await,
-            Self::InMemory(buffer) => buffer.pop().await,
-        }?;
+        let envelope = relay_statsd::metric!(timer(RelayTimers::BufferPop), {
+            match self {
+                Self::Sqlite(buffer) => buffer.pop().await,
+                Self::InMemory(buffer) => buffer.pop().await,
+            }?
+        });
         relay_statsd::metric!(counter(RelayCounters::BufferEnvelopesRead) += 1);
         Ok(envelope)
     }
diff --git a/src/relay_server/services/buffer/envelope_stack/sqlite.rs.html b/src/relay_server/services/buffer/envelope_stack/sqlite.rs.html
index 0ec09b154e..91da0082d3 100644
--- a/src/relay_server/services/buffer/envelope_stack/sqlite.rs.html
+++ b/src/relay_server/services/buffer/envelope_stack/sqlite.rs.html
@@ -454,6 +454,14 @@
 454
 455
 456
+457
+458
+459
+460
+461
+462
+463
+464
 
use std::collections::VecDeque;
 use std::fmt::Debug;
 use std::num::NonZeroUsize;
@@ -465,7 +473,7 @@
 use crate::services::buffer::envelope_store::sqlite::{
     SqliteEnvelopeStore, SqliteEnvelopeStoreError,
 };
-use crate::statsd::RelayTimers;
+use crate::statsd::{RelayCounters, RelayTimers};
 
 /// An error returned when doing an operation on [`SqliteEnvelopeStack`].
 #[derive(Debug, thiserror::Error)]
@@ -547,6 +555,10 @@
         };
         self.batches_buffer_size -= envelopes.len();
 
+        relay_statsd::metric!(
+            counter(RelayCounters::BufferSpooledEnvelopes) += envelopes.len() as u64
+        );
+
         // We convert envelopes into a format which simplifies insertion in the store. If an
         // envelope can't be serialized, we will not insert it.
         let envelopes = envelopes.iter().filter_map(|e| e.as_ref().try_into().ok());
@@ -595,6 +607,10 @@
             return Ok(());
         }
 
+        relay_statsd::metric!(
+            counter(RelayCounters::BufferUnspooledEnvelopes) += envelopes.len() as u64
+        );
+
         // We push in the back of the buffer, since we still want to give priority to
         // incoming envelopes that have a more recent timestamp.
         self.batches_buffer_size += envelopes.len();
diff --git a/src/relay_server/services/buffer/mod.rs.html b/src/relay_server/services/buffer/mod.rs.html
index ebc421c3ea..42e3947db5 100644
--- a/src/relay_server/services/buffer/mod.rs.html
+++ b/src/relay_server/services/buffer/mod.rs.html
@@ -472,6 +472,28 @@
 472
 473
 474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
 
//! Types for buffering envelopes.
 
 use std::sync::atomic::AtomicBool;
@@ -615,6 +637,11 @@
         &mut self,
         buffer: &mut PolymorphicEnvelopeBuffer,
     ) -> Result<(), SendError> {
+        relay_statsd::metric!(
+            counter(RelayCounters::BufferReadyToPop) += 1,
+            status = "checking"
+        );
+
         self.system_ready(buffer).await;
         tokio::time::sleep(self.sleep).await;
         if let Some(project_cache_ready) = self.project_cache_ready.as_mut() {
@@ -622,6 +649,11 @@
             self.project_cache_ready = None;
         }
 
+        relay_statsd::metric!(
+            counter(RelayCounters::BufferReadyToPop) += 1,
+            status = "checked"
+        );
+
         Ok(())
     }
 
@@ -654,10 +686,18 @@
         match buffer.peek().await? {
             Peek::Empty => {
                 relay_log::trace!("EnvelopeBufferService empty");
+                relay_statsd::metric!(
+                    counter(RelayCounters::BufferTryPop) += 1,
+                    peek_result = "empty"
+                );
                 self.sleep = Duration::MAX; // wait for reset by `handle_message`.
             }
             Peek::Ready(_) => {
                 relay_log::trace!("EnvelopeBufferService pop");
+                relay_statsd::metric!(
+                    counter(RelayCounters::BufferTryPop) += 1,
+                    peek_result = "ready"
+                );
                 let envelope = buffer
                     .pop()
                     .await?
@@ -669,6 +709,10 @@
             }
             Peek::NotReady(stack_key, envelope) => {
                 relay_log::trace!("EnvelopeBufferService request update");
+                relay_statsd::metric!(
+                    counter(RelayCounters::BufferTryPop) += 1,
+                    peek_result = "not_ready"
+                );
                 let project_key = envelope.meta().public_key();
                 self.project_cache.send(UpdateProject(project_key));
                 match envelope.sampling_key() {
diff --git a/src/relay_server/statsd.rs.html b/src/relay_server/statsd.rs.html
index f0064b6360..a87c8385a4 100644
--- a/src/relay_server/statsd.rs.html
+++ b/src/relay_server/statsd.rs.html
@@ -938,6 +938,27 @@
 938
 939
 940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
 
use relay_statsd::{CounterMetric, GaugeMetric, HistogramMetric, TimerMetric};
 #[cfg(doc)]
 use tokio::runtime::RuntimeMetrics;
@@ -1464,6 +1485,12 @@
     BufferSpool,
     /// Timing in milliseconds for the time it takes for the buffer to unspool data from disk.
     BufferUnspool,
+    /// Timing in milliseconds for the time it takes for the buffer to push.
+    BufferPush,
+    /// Timing in milliseconds for the time it takes for the buffer to peek.
+    BufferPeek,
+    /// Timing in milliseconds for the time it takes for the buffer to pop.
+    BufferPop,
 }
 
 impl TimerMetric for RelayTimers {
@@ -1508,6 +1535,9 @@
             RelayTimers::BufferInitialization => "buffer.initialization.duration",
             RelayTimers::BufferSpool => "buffer.spool.duration",
             RelayTimers::BufferUnspool => "buffer.unspool.duration",
+            RelayTimers::BufferPush => "buffer.push.duration",
+            RelayTimers::BufferPeek => "buffer.peek.duration",
+            RelayTimers::BufferPop => "buffer.pop.duration",
         }
     }
 }
@@ -1561,6 +1591,14 @@
     /// Number of times an envelope stack is popped from the priority queue of stacks in the
     /// envelope buffer.
     BufferEnvelopeStacksPopped,
+    /// Number of times an envelope from the buffer is trying to be popped.
+    BufferTryPop,
+    /// Number of times the readiness check of the buffer is polled.
+    BufferReadyToPop,
+    /// Number of envelopes spool to disk.
+    BufferSpooledEnvelopes,
+    /// Number of envelopes unspooled from disk.
+    BufferUnspooledEnvelopes,
     ///
     /// Number of outcomes and reasons for rejected Envelopes.
     ///
@@ -1779,6 +1817,10 @@
             RelayCounters::BufferEnvelopesReturned => "buffer.envelopes_returned",
             RelayCounters::BufferStateTransition => "buffer.state.transition",
             RelayCounters::BufferEnvelopeStacksPopped => "buffer.envelope_stacks_popped",
+            RelayCounters::BufferTryPop => "buffer.try_pop",
+            RelayCounters::BufferReadyToPop => "buffer.ready_to_pop",
+            RelayCounters::BufferSpooledEnvelopes => "buffer.spooled_envelopes",
+            RelayCounters::BufferUnspooledEnvelopes => "buffer.unspooled_envelopes",
             RelayCounters::Outcomes => "events.outcomes",
             RelayCounters::ProjectStateGet => "project_state.get",
             RelayCounters::ProjectStateRequest => "project_state.request",