pub struct CorrelationManager { /* private fields */ }
Expand description
Correlation manager
Implementations§
Source§impl CorrelationManager
impl CorrelationManager
Sourcepub fn new(config: CorrelationConfig) -> Self
pub fn new(config: CorrelationConfig) -> Self
Create a new correlation manager
Sourcepub fn create_context(
&self,
service_name: &str,
parent_context: Option<&CorrelationContext>,
) -> CorrelationContext
pub fn create_context( &self, service_name: &str, parent_context: Option<&CorrelationContext>, ) -> CorrelationContext
Create a new correlation context
Sourcepub fn extract_from_headers(
&self,
headers: &HashMap<String, String>,
) -> Option<CorrelationContext>
pub fn extract_from_headers( &self, headers: &HashMap<String, String>, ) -> Option<CorrelationContext>
Extract correlation context from HTTP headers
Sourcepub fn inject_into_headers(
&self,
context: &CorrelationContext,
headers: &mut HashMap<String, String>,
)
pub fn inject_into_headers( &self, context: &CorrelationContext, headers: &mut HashMap<String, String>, )
Inject correlation context into HTTP headers
Sourcepub async fn start_request_tracking(
&self,
context: CorrelationContext,
method: &str,
params: Value,
) -> Result<(), CorrelationError>
pub async fn start_request_tracking( &self, context: CorrelationContext, method: &str, params: Value, ) -> Result<(), CorrelationError>
Start tracking a request
Sourcepub async fn complete_request_tracking(
&self,
request_id: &str,
response: Option<Value>,
error: Option<String>,
) -> Result<(), CorrelationError>
pub async fn complete_request_tracking( &self, request_id: &str, response: Option<Value>, error: Option<String>, ) -> Result<(), CorrelationError>
Complete request tracking
Sourcepub async fn get_request_trace(
&self,
request_id: &str,
) -> Option<RequestTraceEntry>
pub async fn get_request_trace( &self, request_id: &str, ) -> Option<RequestTraceEntry>
Get request trace by ID
Sourcepub async fn get_correlation_traces(
&self,
correlation_id: &str,
) -> Vec<RequestTraceEntry>
pub async fn get_correlation_traces( &self, correlation_id: &str, ) -> Vec<RequestTraceEntry>
Get all traces for a correlation ID
Sourcepub async fn get_stats(&self) -> CorrelationStats
pub async fn get_stats(&self) -> CorrelationStats
Get statistics about correlation tracking
Auto Trait Implementations§
impl Freeze for CorrelationManager
impl !RefUnwindSafe for CorrelationManager
impl Send for CorrelationManager
impl Sync for CorrelationManager
impl Unpin for CorrelationManager
impl !UnwindSafe for CorrelationManager
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