pub struct TermTelemetry {
pub detailed_metrics: bool,
pub record_timing: bool,
pub custom_attributes: HashMap<String, String>,
}Expand description
Configuration for Term’s telemetry integration.
This struct follows the BYOT (Bring Your Own Tracer) pattern where users configure their own OpenTelemetry setup and pass in a tracer. Term will use this tracer to create spans and record metrics.
Fields§
§detailed_metrics: boolWhether to record detailed constraint-level metrics
record_timing: boolWhether to record execution timing information
custom_attributes: HashMap<String, String>Custom attributes to add to all spans
Implementations§
Source§impl TermTelemetry
impl TermTelemetry
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
Creates a disabled telemetry configuration.
This is useful when telemetry feature is enabled but you want to disable telemetry for specific validation runs.
Sourcepub fn with_detailed_metrics(self, enabled: bool) -> Self
pub fn with_detailed_metrics(self, enabled: bool) -> Self
Sets whether to record detailed constraint-level metrics.
Sourcepub fn with_timing(self, enabled: bool) -> Self
pub fn with_timing(self, enabled: bool) -> Self
Sets whether to record execution timing information.
Sourcepub fn with_attribute(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_attribute( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Adds a custom attribute that will be added to all spans.
Sourcepub fn with_attributes<I, K, V>(self, attributes: I) -> Self
pub fn with_attributes<I, K, V>(self, attributes: I) -> Self
Adds multiple custom attributes.
Sourcepub fn start_suite_span(
&self,
_suite_name: &str,
_check_count: usize,
) -> TermSpan
pub fn start_suite_span( &self, _suite_name: &str, _check_count: usize, ) -> TermSpan
Creates a span when telemetry feature is disabled.
pub fn start_check_span( &self, _check_name: &str, _constraint_count: usize, ) -> TermSpan
pub fn start_constraint_span( &self, _constraint_name: &str, _column: Option<&str>, ) -> TermSpan
pub fn start_datasource_span( &self, _source_type: &str, _table_name: &str, ) -> TermSpan
Trait Implementations§
Source§impl Clone for TermTelemetry
A wrapper around OpenTelemetry spans that provides a consistent interface
impl Clone for TermTelemetry
A wrapper around OpenTelemetry spans that provides a consistent interface
Auto Trait Implementations§
impl Freeze for TermTelemetry
impl RefUnwindSafe for TermTelemetry
impl Send for TermTelemetry
impl Sync for TermTelemetry
impl Unpin for TermTelemetry
impl UnwindSafe for TermTelemetry
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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