pub struct LineageContext {
pub run_id: Option<Uuid>,
pub job_namespace: Option<String>,
pub job_name: Option<String>,
pub parent_run: Option<ParentRunFacet>,
pub run_facets: Map<String, Value>,
pub job_facets: Map<String, Value>,
pub sql: Option<String>,
}Expand description
Top-level context an integration contributes to each emitted run.
All fields are optional; unset values fall back to OpenLineageConfig
defaults and plan-derived identity.
Fields§
§run_id: Option<Uuid>Correlate with an orchestrator-owned run id (else a fresh UUIDv7 is used).
job_namespace: Option<String>Namespace of the emitting job (else the configured default namespace).
job_name: Option<String>Name of the emitting job (else a plan-derived job name).
parent_run: Option<ParentRunFacet>Standard OpenLineage parent run facet.
run_facets: Map<String, Value>Arbitrary extra run facets merged into the emitted event.
job_facets: Map<String, Value>Arbitrary extra job facets merged into the emitted event.
sql: Option<String>The SQL text of the query, if the host has it. Populates the sql job
facet. A plan walk cannot recover this, so the integration supplies it
from the request boundary.
Implementations§
Source§impl LineageContext
impl LineageContext
Sourcepub fn from_env(config: &OpenLineageConfig) -> LineageContext
pub fn from_env(config: &OpenLineageConfig) -> LineageContext
Build a context from the established OpenLineage parent-run environment
conventions, returning None-filled fields when nothing is set.
Reads OPENLINEAGE_PARENT_ID (slash form {namespace}/{name}/{runId}),
falling back to the discrete OPENLINEAGE_PARENT_JOB_NAMESPACE /
OPENLINEAGE_PARENT_JOB_NAME / OPENLINEAGE_PARENT_RUN_ID variables.
Trait Implementations§
Source§impl Clone for LineageContext
impl Clone for LineageContext
Source§fn clone(&self) -> LineageContext
fn clone(&self) -> LineageContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LineageContext
impl Debug for LineageContext
Source§impl Default for LineageContext
impl Default for LineageContext
Source§fn default() -> LineageContext
fn default() -> LineageContext
Auto Trait Implementations§
impl Freeze for LineageContext
impl RefUnwindSafe for LineageContext
impl Send for LineageContext
impl Sync for LineageContext
impl Unpin for LineageContext
impl UnsafeUnpin for LineageContext
impl UnwindSafe for LineageContext
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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 more