pub struct StreamObservability { /* private fields */ }
Expand description
Advanced observability system for streaming operations
Implementations§
Source§impl StreamObservability
impl StreamObservability
Sourcepub fn new(config: TelemetryConfig, alert_config: AlertConfig) -> Self
pub fn new(config: TelemetryConfig, alert_config: AlertConfig) -> Self
Create a new observability system
Sourcepub async fn start_span(
&self,
operation_name: &str,
parent_span_id: Option<String>,
) -> String
pub async fn start_span( &self, operation_name: &str, parent_span_id: Option<String>, ) -> String
Start a new distributed trace span
Sourcepub async fn finish_span(&self, span_id: &str, status: SpanStatus) -> Result<()>
pub async fn finish_span(&self, span_id: &str, status: SpanStatus) -> Result<()>
Finish a trace span
Sourcepub async fn add_span_tag(
&self,
span_id: &str,
key: &str,
value: &str,
) -> Result<()>
pub async fn add_span_tag( &self, span_id: &str, key: &str, value: &str, ) -> Result<()>
Add a tag to an active span
Sourcepub async fn add_span_log(
&self,
span_id: &str,
level: &str,
message: &str,
) -> Result<()>
pub async fn add_span_log( &self, span_id: &str, level: &str, message: &str, ) -> Result<()>
Add a log entry to an active span
Sourcepub async fn record_event(
&self,
event: &StreamEvent,
processing_duration: Duration,
) -> Result<()>
pub async fn record_event( &self, event: &StreamEvent, processing_duration: Duration, ) -> Result<()>
Record a streaming event for metrics collection
Sourcepub async fn record_error(&self, error: &Error, context: &str) -> Result<()>
pub async fn record_error(&self, error: &Error, context: &str) -> Result<()>
Record an error for metrics and alerting
Sourcepub async fn update_system_metrics(
&self,
memory_mb: f64,
cpu_percent: f64,
network_bps: f64,
) -> Result<()>
pub async fn update_system_metrics( &self, memory_mb: f64, cpu_percent: f64, network_bps: f64, ) -> Result<()>
Update system resource metrics
Sourcepub async fn get_streaming_metrics(&self) -> StreamingMetrics
pub async fn get_streaming_metrics(&self) -> StreamingMetrics
Get current streaming metrics
Sourcepub async fn get_business_metrics(&self) -> BusinessMetrics
pub async fn get_business_metrics(&self) -> BusinessMetrics
Get current business metrics
Sourcepub async fn get_metrics_history(&self) -> Vec<StreamingMetrics>
pub async fn get_metrics_history(&self) -> Vec<StreamingMetrics>
Get metrics history for trend analysis
Sourcepub fn subscribe_to_alerts(&self) -> Receiver<AlertEvent>
pub fn subscribe_to_alerts(&self) -> Receiver<AlertEvent>
Subscribe to alert notifications
Sourcepub async fn generate_observability_report(&self) -> Result<String>
pub async fn generate_observability_report(&self) -> Result<String>
Generate a comprehensive observability report
Auto Trait Implementations§
impl Freeze for StreamObservability
impl !RefUnwindSafe for StreamObservability
impl Send for StreamObservability
impl Sync for StreamObservability
impl Unpin for StreamObservability
impl !UnwindSafe for StreamObservability
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
Mutably borrows from an owned value. Read more
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>
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 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.