pub struct EventMetadata {
pub batch_id: Uuid,
pub pipeline_id: String,
pub source_time: Option<SystemTime>,
pub ingestion_time: SystemTime,
pub source_id: ComponentId,
pub upstream_id: Option<OutputId>,
pub tenant_profile: Option<String>,
}Expand description
Core metadata attached to every batch of events flowing through the pipeline.
This is wrapped in an Arc when attached to an EventBatch to ensure
cheap cloning during fanout operations.
Fields§
§batch_id: UuidA globally unique identifier for this specific batch. Used for end-to-end tracing of data flow.
pipeline_id: StringThe ID of the pipeline this batch belongs to.
source_time: Option<SystemTime>The time the data was originally generated at the source (if known). For example, the S3 object last-modified time, or Kafka message timestamp.
ingestion_time: SystemTimeThe time the data was ingested by Kinetic’s source component.
source_id: ComponentIdThe component that originally produced this batch.
upstream_id: Option<OutputId>The specific output of the component that produced this batch.
This is None until the batch actually leaves a source or transform.
tenant_profile: Option<String>Optional tenant profile name. Used primarily by multi-tenant sources like the OTLP source to tag which tenant generated the data.
Implementations§
Source§impl EventMetadata
impl EventMetadata
Sourcepub fn new(pipeline_id: impl Into<String>, source_id: ComponentId) -> Self
pub fn new(pipeline_id: impl Into<String>, source_id: ComponentId) -> Self
Creates a new EventMetadata with a random UUID and current ingestion time.
Sourcepub fn with_source_time(self, time: SystemTime) -> Self
pub fn with_source_time(self, time: SystemTime) -> Self
Sets the source time (e.g., from external metadata).
Sourcepub fn with_tenant_profile(self, profile: impl Into<String>) -> Self
pub fn with_tenant_profile(self, profile: impl Into<String>) -> Self
Sets the tenant profile.
Sourcepub fn with_upstream_id(self, upstream_id: OutputId) -> Self
pub fn with_upstream_id(self, upstream_id: OutputId) -> Self
Sets the upstream output ID. This is typically called by a component just before sending the batch to the next component.
Trait Implementations§
Source§impl Clone for EventMetadata
impl Clone for EventMetadata
Source§fn clone(&self) -> EventMetadata
fn clone(&self) -> EventMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more