pub struct ObservationContext {
pub run_id: Option<String>,
pub workflow_name: Option<String>,
pub node_id: Option<String>,
pub metadata: HashMap<String, String>,
}Expand description
Context information for correlated observation of workflow executions.
Provides run_id and workflow metadata for correlating DI events with n8n-style workflow execution traces.
Fields§
§run_id: Option<String>Unique identifier for the current workflow run
workflow_name: Option<String>Name of the workflow being executed
node_id: Option<String>Current node/step being executed
metadata: HashMap<String, String>Additional metadata for the execution context
Implementations§
Source§impl ObservationContext
impl ObservationContext
Sourcepub fn with_run_id(run_id: impl Into<String>) -> Self
pub fn with_run_id(run_id: impl Into<String>) -> Self
Creates an observation context with a run ID.
Sourcepub fn workflow(
run_id: impl Into<String>,
workflow_name: impl Into<String>,
node_id: Option<impl Into<String>>,
) -> Self
pub fn workflow( run_id: impl Into<String>, workflow_name: impl Into<String>, node_id: Option<impl Into<String>>, ) -> Self
Creates a full workflow context.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Adds metadata to the context.
Sourcepub fn correlation_id(&self) -> String
pub fn correlation_id(&self) -> String
Gets a correlation string for logging/tracing.
Trait Implementations§
Source§impl Clone for ObservationContext
impl Clone for ObservationContext
Source§fn clone(&self) -> ObservationContext
fn clone(&self) -> ObservationContext
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 moreSource§impl Debug for ObservationContext
impl Debug for ObservationContext
Auto Trait Implementations§
impl Freeze for ObservationContext
impl RefUnwindSafe for ObservationContext
impl Send for ObservationContext
impl Sync for ObservationContext
impl Unpin for ObservationContext
impl UnwindSafe for ObservationContext
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