pub struct EnvelopeMetadata {
pub timestamp: Option<u64>,
pub source: Option<String>,
pub trace_id: Option<String>,
pub sequence: Option<u64>,
pub labels: HashMap<String, String>,
}Expand description
Operational metadata fields for an LNMP envelope
All fields are optional to provide flexibility. Applications should set fields based on their requirements:
- Timestamp: For temporal reasoning and freshness
- Source: For routing, multi-tenant, and trust scoring
- TraceID: For distributed tracing integration
- Sequence: For conflict resolution and ordering
Fields§
§timestamp: Option<u64>Event timestamp in milliseconds since Unix epoch (UTC)
Recommended for all events. Used for:
- Temporal ordering
- Freshness/decay calculations
- Event replay
source: Option<String>Source service/device/tenant identifier
Examples: “auth-service”, “sensor-12”, “tenant-acme”
Recommendation: Keep ≤ 64 characters
trace_id: Option<String>Distributed tracing correlation ID
Compatible with W3C Trace Context and OpenTelemetry. Can hold full traceparent or just trace-id portion.
Recommendation: Keep ≤ 128 characters
sequence: Option<u64>Monotonically increasing sequence number
Used for ordering and conflict resolution. Should increment for each version of the same entity.
labels: HashMap<String, String>Extensibility labels (reserved for future use)
V1: Optional, implementations may ignore Future: tenant, environment, region, priority, etc.
Implementations§
Trait Implementations§
Source§impl Clone for EnvelopeMetadata
impl Clone for EnvelopeMetadata
Source§fn clone(&self) -> EnvelopeMetadata
fn clone(&self) -> EnvelopeMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more