package stage2 import ( "crypto/rand" "encoding/hex" "time" ) type Trace struct { ID string `json:"id"` Started time.Time `json:"started"` EngineMS int64 `json:"engine_ms"` AIMS int64 `json:"ai_ms"` } func NewTrace() (Trace, error) { b := make([]byte, 12) if _, e := rand.Read(b); e != nil { return Trace{}, e } return Trace{ID: hex.EncodeToString(b), Started: time.Now().UTC()}, nil }