@@ -46,14 +46,41 @@ pub struct SeqPathParam {
4646 pub seq : Generation ,
4747}
4848
49- /// An error report .
49+ /// An entry in the ereport batch returned by a reporter .
5050#[ derive( Clone , Debug , Deserialize , JsonSchema , Serialize ) ]
51- pub struct Ereport {
51+ pub struct Entry {
5252 /// UUID of the entity that generated this ereport.
5353 pub reporter_id : Uuid ,
5454 /// The ereport's sequence number, unique with regards to ereports generated
5555 /// by the entity with the `reporter_id`.
5656 pub seq : Generation ,
57+
58+ pub value : EntryKind ,
59+ }
60+
61+ /// Kinds of entry in a batch.
62+ #[ derive( Clone , Debug , Deserialize , JsonSchema , Serialize ) ]
63+ pub enum EntryKind {
64+ /// An ereport.
65+ Ereport ( Ereport ) ,
66+ /// Ereports may have been lost.
67+ DataLoss {
68+ /// The number of ereports that were discarded, if it is known.
69+ ///
70+ /// If ereports are dropped because a buffer has reached its capacity,
71+ /// the reporter is strongly encouraged to attempt to count the number
72+ /// of ereports lost. In other cases, such as a reporter crashing and
73+ /// restarting, the reporter may not be capable of determining the
74+ /// number of ereports that were lost, or even *if* data loss actually
75+ /// occurred. Therefore, a `None` here indicates *possible* data loss,
76+ /// while a `Some(u32)` indicates *known* data loss.
77+ dropped : Option < u32 > ,
78+ } ,
79+ }
80+
81+ /// An error report.
82+ #[ derive( Clone , Debug , Deserialize , JsonSchema , Serialize ) ]
83+ pub struct Ereport {
5784 /// A string indicating the kind of ereport.
5885 ///
5986 /// This may be used by diagnosis engines as an indication of what `facts`
0 commit comments