Skip to main content

traverse_runtime/trace/
mod.rs

1//! Two-tier execution trace: public (`CloudEvents`) + private (hashed).
2//!
3//! Governed by spec `012-execution-trace-tiered`. The additive durable
4//! persistence layer in [`durable`] is governed by spec
5//! `079-durable-trace-journal`.
6
7pub mod durable;
8pub mod private;
9pub mod public;
10pub mod store;
11
12pub use durable::{
13    DurableTraceConfig, DurableTraceJournal, TraceDurabilitySink, TraceJournalError,
14    TracePrunedEvidence, TraceRecoveryReport,
15};
16pub use private::PrivateTraceEntry;
17pub use public::{PublicTraceEntry, TraceOutcome};
18pub use store::TraceStore;
19
20use chrono::Utc;
21use uuid::Uuid;
22
23/// Builds a new trace `id` and RFC 3339 `time` string for use when recording a trace.
24#[must_use]
25pub fn new_trace_id_and_time() -> (String, String) {
26    let id = Uuid::new_v4().to_string();
27    let time = Utc::now().to_rfc3339();
28    (id, time)
29}