Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/bitdrift_public/fbs/common/v1/common.fbs
Original file line number Diff line number Diff line change
@@ -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);
}
15 changes: 15 additions & 0 deletions src/bitdrift_public/fbs/issue-reporting/v1/report.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -365,6 +367,11 @@ table SDKInfo {
version:string;
}

table FeatureFlag {
name:string;
value:string;
}

table Report {
sdk:SDKInfo;

Expand All @@ -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;
26 changes: 4 additions & 22 deletions src/bitdrift_public/fbs/logging/v1/buffer_log.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
Loading