diff --git a/src/bitdrift_public/fbs/common/v1/common.fbs b/src/bitdrift_public/fbs/common/v1/common.fbs new file mode 100644 index 0000000..6fcb047 --- /dev/null +++ b/src/bitdrift_public/fbs/common/v1/common.fbs @@ -0,0 +1,22 @@ +namespace bitdrift_public.fbs.common.v1; + +// Table wrapper for binary data. +table BinaryData { + data_type:string (id: 0); + data:[ubyte] (id: 1, required); +} + + +// Union of different data types. +union Data { + string_data:StringData, + binary_data:BinaryData +} + +table Field { + // Field key. Required to be a UTF-8 string. + key:string (id: 0, required); + + // Field value. (Union uses 2 ID slots) + value:Data (id: 2, required); +} diff --git a/src/bitdrift_public/fbs/issue-reporting/v1/report.fbs b/src/bitdrift_public/fbs/issue-reporting/v1/report.fbs index 5127893..14bedf4 100644 --- a/src/bitdrift_public/fbs/issue-reporting/v1/report.fbs +++ b/src/bitdrift_public/fbs/issue-reporting/v1/report.fbs @@ -8,6 +8,8 @@ // Specification for the format of reporting programmatic issues namespace bitdrift_public.fbs.issue_reporting.v1; +import "bitdrift_public/fbs/common/v1/common.fbs"; + enum ReportType : int8 { Unknown = 0, AppNotResponding, @@ -365,6 +367,11 @@ table SDKInfo { version:string; } +table FeatureFlag { + name:string; + value:string; +} + table Report { sdk:SDKInfo; @@ -387,6 +394,14 @@ table Report { // Thread stack traces binary_images:[BinaryImage]; + // arbitrary key/value pairs representing custom fields added to the report + // by the application at runtime + state:[common.v1.Field] + + // arbitrary key/value pairs representing feature flags and their values at + // the time the report was generated + feature_flags:[FeatureFlag] + } root_type Report; diff --git a/src/bitdrift_public/fbs/logging/v1/buffer_log.fbs b/src/bitdrift_public/fbs/logging/v1/buffer_log.fbs index 9c0ba6f..fc6e3f1 100644 --- a/src/bitdrift_public/fbs/logging/v1/buffer_log.fbs +++ b/src/bitdrift_public/fbs/logging/v1/buffer_log.fbs @@ -7,17 +7,13 @@ namespace bitdrift_public.fbs.logging.v1; +import "src/bitdrift_public/fbs/common/v1/common.fbs"; + // Table wrapper for UTF-8 data. table StringData { data:string (id: 0, required); } -// Table wrapper for binary data. -table BinaryData { - data_type:string (id: 0); - data:[ubyte] (id: 1, required); -} - // Flatbuffer representation of a google.protobuf.Timestamp // The first attempt of this tried to make this a struct for a smaller wire size, but the // generated Rust code has the wrong alignment. Using a table fixes this. @@ -26,20 +22,6 @@ table Timestamp { nanos:int32 (id: 1); } -// Union of different data types. -union Data { - string_data:StringData, - binary_data:BinaryData -} - -table Field { - // Field key. Required to be a UTF-8 string. - key:string (id: 0, required); - - // Field value. (Union uses 2 ID slots) - value:Data (id: 2, required); -} - enum LogType: uint32 { // Normal logs, from application code. Normal = 0, @@ -74,10 +56,10 @@ table Log { log_level:uint32 (id: 0); // The message associated with the log. (Union uses 2 ID slots) - message:Data (id: 2, required); + message:common.v1.Data (id: 2, required); // An optional list of high cardinality fields. - fields:[Field] (id: 3); + fields:[common.v1.Field] (id: 3); // The ID of the session associated with this log. session_id:string (id: 4);