pub struct ObservabilityService { /* private fields */ }Expand description
Main observability service that coordinates all monitoring aspects
Implementations§
Source§impl ObservabilityService
impl ObservabilityService
Sourcepub async fn new(config: ObservabilityConfig) -> Result<Self>
pub async fn new(config: ObservabilityConfig) -> Result<Self>
Create a new observability service with the given configuration
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize observability for the entire system
Sourcepub fn create_trace_context(&self, operation: &str) -> TraceContext
pub fn create_trace_context(&self, operation: &str) -> TraceContext
Create a new trace context for an operation
Sourcepub fn start_timer(
&self,
operation: &str,
labels: MetricLabels,
) -> OperationTimer
pub fn start_timer( &self, operation: &str, labels: MetricLabels, ) -> OperationTimer
Start timing an operation
Sourcepub fn log_event(&self, level: LogLevel, message: &str, context: &TraceContext)
pub fn log_event(&self, level: LogLevel, message: &str, context: &TraceContext)
Log an event with full observability context
Sourcepub fn record_metric(&self, name: &str, value: f64, labels: MetricLabels)
pub fn record_metric(&self, name: &str, value: f64, labels: MetricLabels)
Record metrics for an operation
Sourcepub async fn get_performance_metrics(&self) -> PerformanceMetrics
pub async fn get_performance_metrics(&self) -> PerformanceMetrics
Get current performance metrics
Sourcepub async fn start_profiling(
&self,
profile_type: ProfileType,
metadata: HashMap<String, String>,
) -> Result<String>
pub async fn start_profiling( &self, profile_type: ProfileType, metadata: HashMap<String, String>, ) -> Result<String>
Start a profiling session
Sourcepub async fn end_profiling(&self, session_id: &str) -> Result<ProfileEntry>
pub async fn end_profiling(&self, session_id: &str) -> Result<ProfileEntry>
End a profiling session
Sourcepub async fn generate_flame_graph(
&self,
profile_type: ProfileType,
time_range: Option<(SystemTime, SystemTime)>,
) -> Result<FlameGraph>
pub async fn generate_flame_graph( &self, profile_type: ProfileType, time_range: Option<(SystemTime, SystemTime)>, ) -> Result<FlameGraph>
Generate a flame graph
Sourcepub async fn detect_regressions(
&self,
operation: &str,
) -> Result<Option<RegressionDetection>>
pub async fn detect_regressions( &self, operation: &str, ) -> Result<Option<RegressionDetection>>
Detect performance regressions
Sourcepub async fn identify_bottlenecks(
&self,
profile_type: ProfileType,
) -> Result<BottleneckAnalysis>
pub async fn identify_bottlenecks( &self, profile_type: ProfileType, ) -> Result<BottleneckAnalysis>
Identify bottlenecks
Sourcepub async fn set_baseline(&self, operation: &str) -> Result<()>
pub async fn set_baseline(&self, operation: &str) -> Result<()>
Set baseline metrics for regression detection
Trait Implementations§
Source§impl Clone for ObservabilityService
impl Clone for ObservabilityService
Source§fn clone(&self) -> ObservabilityService
fn clone(&self) -> ObservabilityService
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ObservabilityService
impl !RefUnwindSafe for ObservabilityService
impl Send for ObservabilityService
impl Sync for ObservabilityService
impl Unpin for ObservabilityService
impl !UnwindSafe for ObservabilityService
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> 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>
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 more