pub struct OtelValidator { /* private fields */ }Expand description
OpenTelemetry validator with real span data validation
Implementations§
Source§impl OtelValidator
impl OtelValidator
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new OTel validator with default configuration
Following core team standards:
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
- No unwrap() or expect()
Sourcepub fn with_config(config: OtelValidationConfig) -> Self
pub fn with_config(config: OtelValidationConfig) -> Self
Create a new OTel validator with custom configuration
Following core team standards:
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
- No unwrap() or expect()
Sourcepub fn with_span_exporter(self, exporter: InMemorySpanExporter) -> Self
pub fn with_span_exporter(self, exporter: InMemorySpanExporter) -> Self
Create a new OTel validator with in-memory span exporter for testing
Following core team standards:
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
- No unwrap() or expect()
Sourcepub fn with_validation_processor(
self,
processor: ValidationSpanProcessor,
) -> Self
pub fn with_validation_processor( self, processor: ValidationSpanProcessor, ) -> Self
Create a new OTel validator with validation span processor for real span collection
Following core team standards:
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
- No unwrap() or expect()
Sourcepub fn with_global_tracer_provider() -> Result<Self>
pub fn with_global_tracer_provider() -> Result<Self>
Create a new OTel validator that connects to the global tracer provider
This method creates a validator that can access real span data from the global OpenTelemetry tracer provider. Following core team standards:
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
- No unwrap() or expect()
Sourcepub fn validate_span(
&self,
assertion: &SpanAssertion,
) -> Result<SpanValidationResult>
pub fn validate_span( &self, assertion: &SpanAssertion, ) -> Result<SpanValidationResult>
Validate a span assertion (legacy method with simulated data)
This method validates that a span with the expected attributes exists. Following core team standards:
- No .unwrap() or .expect()
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
Sourcepub fn validate_span_real(
&self,
assertion: &SpanAssertion,
) -> Result<SpanValidationResult>
pub fn validate_span_real( &self, assertion: &SpanAssertion, ) -> Result<SpanValidationResult>
Validate a span assertion using real span data from OpenTelemetry
This method performs actual validation against real span data collected from the OpenTelemetry tracer provider. Following core team standards:
- No .unwrap() or .expect()
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
- No false positives - validates against actual telemetry data
Sourcepub fn validate_trace(
&self,
assertion: &TraceAssertion,
) -> Result<TraceValidationResult>
pub fn validate_trace( &self, assertion: &TraceAssertion, ) -> Result<TraceValidationResult>
Validate a trace assertion
This method validates that a complete trace with all expected spans exists. Following core team standards:
- No .unwrap() or .expect()
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
Sourcepub fn validate_export(&self, endpoint: &str) -> Result<bool>
pub fn validate_export(&self, endpoint: &str) -> Result<bool>
Validate telemetry export
This method validates that telemetry data reaches configured destinations. Following core team standards:
- No .unwrap() or .expect()
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
Sourcepub fn validate_export_real(&self, endpoint: &str) -> Result<bool>
pub fn validate_export_real(&self, endpoint: &str) -> Result<bool>
Validate export functionality using real OTLP export testing
This method performs actual validation of OTLP export functionality by:
- Validating endpoint format and connectivity
- Testing basic network connectivity to the endpoint
- Validating OTLP protocol format
Note: Full end-to-end validation with mock collectors would require significant additional infrastructure. This provides basic connectivity validation as a foundation.
Following core team standards:
- No .unwrap() or .expect()
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
- No false positives - validates actual connectivity
Sourcepub fn validate_trace_real(
&self,
assertion: &TraceAssertion,
) -> Result<TraceValidationResult>
pub fn validate_trace_real( &self, assertion: &TraceAssertion, ) -> Result<TraceValidationResult>
Validate trace relationships using real span data from OpenTelemetry
This method performs actual validation of trace relationships by:
- Querying real spans from the validation processor
- Validating parent-child relationships between spans
- Checking trace completeness if required
Following core team standards:
- No .unwrap() or .expect()
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
- No false positives - validates against actual telemetry data
Sourcepub fn validate_performance_overhead(
&self,
baseline_duration_ms: f64,
with_telemetry_duration_ms: f64,
) -> Result<bool>
pub fn validate_performance_overhead( &self, baseline_duration_ms: f64, with_telemetry_duration_ms: f64, ) -> Result<bool>
Validate performance overhead
This method measures telemetry performance impact. Following core team standards:
- No .unwrap() or .expect()
- Sync method (dyn compatible)
- Returns Result<T, CleanroomError>
Sourcepub fn config(&self) -> &OtelValidationConfig
pub fn config(&self) -> &OtelValidationConfig
Get validation configuration
Sourcepub fn set_config(&mut self, config: OtelValidationConfig)
pub fn set_config(&mut self, config: OtelValidationConfig)
Update validation configuration
Trait Implementations§
Source§impl Clone for OtelValidator
impl Clone for OtelValidator
Source§fn clone(&self) -> OtelValidator
fn clone(&self) -> OtelValidator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OtelValidator
impl Debug for OtelValidator
Auto Trait Implementations§
impl Freeze for OtelValidator
impl RefUnwindSafe for OtelValidator
impl Send for OtelValidator
impl Sync for OtelValidator
impl Unpin for OtelValidator
impl UnwindSafe for OtelValidator
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request