TrimmingProcessor

Struct TrimmingProcessor 

Source
pub struct TrimmingProcessor { /* private fields */ }
Expand description

Processor for trimming EAP items (logs, V2 spans).

This primarily differs from the regular TrimmingProcessor in the handling of [Attributes]. This processor handles attributes as follows:

  1. Sort them by combined key and value size, where the key size is just the string length and the value size is given by size::attribute_size.
  2. Trim attributes one by one. Key lengths are counted for the attribute’s size, but keys aren’t trimmed—if a key is too long, the attribute is simply discarded.
  3. If we run out of space, all subsequent attributes are discarded.

This means that large attributes will be trimmed or discarded before small ones.

Implementations§

Source§

impl TrimmingProcessor

Source

pub fn new(removed_key_byte_budget: usize) -> Self

Creates a new trimming processor.

Trait Implementations§

Source§

impl Default for TrimmingProcessor

Source§

fn default() -> TrimmingProcessor

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

impl Processor for TrimmingProcessor

Source§

fn before_process<T: ProcessValue>( &mut self, _: Option<&T>, _: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult

Source§

fn after_process<T: ProcessValue>( &mut self, _value: Option<&T>, _: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult

Source§

fn process_u64( &mut self, _value: &mut u64, _meta: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult

Source§

fn process_i64( &mut self, _value: &mut i64, _meta: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult

Source§

fn process_f64( &mut self, _value: &mut f64, _meta: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult

Source§

fn process_bool( &mut self, _value: &mut bool, _meta: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult

Source§

fn process_string( &mut self, value: &mut String, meta: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult

Source§

fn process_array<T>( &mut self, value: &mut Array<T>, meta: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult
where T: ProcessValue,

Source§

fn process_object<T>( &mut self, value: &mut Object<T>, meta: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult
where T: ProcessValue,

Source§

fn process_attributes( &mut self, attributes: &mut Attributes, meta: &mut Meta, state: &ProcessingState<'_>, ) -> ProcessingResult

§

fn process_finite_f64( &mut self, value: &mut FiniteF64, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_value( &mut self, value: &mut Value, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_pairlist<T>( &mut self, value: &mut PairList<T>, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>
where T: ProcessValue + AsPair,

§

fn process_values<T>( &mut self, value: &mut Values<T>, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>
where T: ProcessValue,

§

fn process_timestamp( &mut self, value: &mut Timestamp, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_event( &mut self, value: &mut Event, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_replay( &mut self, value: &mut Replay, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_exception( &mut self, value: &mut Exception, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_raw_stacktrace( &mut self, value: &mut RawStacktrace, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_stacktrace( &mut self, value: &mut Stacktrace, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_frame( &mut self, value: &mut Frame, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_request( &mut self, value: &mut Request, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_user( &mut self, value: &mut User, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_client_sdk_info( &mut self, value: &mut ClientSdkInfo, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_debug_meta( &mut self, value: &mut DebugMeta, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_debug_image( &mut self, value: &mut DebugImage, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_geo( &mut self, value: &mut Geo, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_logentry( &mut self, value: &mut LogEntry, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_thread( &mut self, value: &mut Thread, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_context( &mut self, value: &mut Context, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_breadcrumb( &mut self, value: &mut Breadcrumb, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_template_info( &mut self, value: &mut TemplateInfo, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_header_name( &mut self, value: &mut HeaderName, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_ourlog( &mut self, value: &mut OurLog, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_trace_metric( &mut self, value: &mut TraceMetric, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_span( &mut self, value: &mut Span, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_trace_context( &mut self, value: &mut TraceContext, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_native_image_path( &mut self, value: &mut NativeImagePath, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_contexts( &mut self, value: &mut Contexts, meta: &mut Meta, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

§

fn process_other( &mut self, other: &mut BTreeMap<String, Annotated<Value>>, state: &ProcessingState<'_>, ) -> Result<(), ProcessingAction>

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.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

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

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

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. 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

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T