diff --git a/src/bitdrift_public/protobuf/client/v1/api.proto b/src/bitdrift_public/protobuf/client/v1/api.proto index 84a904e..24b6127 100644 --- a/src/bitdrift_public/protobuf/client/v1/api.proto +++ b/src/bitdrift_public/protobuf/client/v1/api.proto @@ -147,8 +147,12 @@ message LogUploadRequest { string upload_uuid = 1 [(validate.rules).string = {min_len: 1}]; // A repeated set of flatbuffer encoding of a number of log lines. Each log line is of type - // Log defined in buffer_log.fbs. - repeated bytes logs = 2 [(validate.rules).repeated = {min_items: 1}]; + // Log defined in buffer_log.fbs. This is deprecated. New clients send protobuf encoded logs + // in the 'logs' field. + repeated bytes legacy_flatbuffer_logs = 2; + + // Logs encoded in bitdrift_public.protobuf.logging.v1.Log format. + repeated bytes proto_logs = 5; // The UUID (v4) of the buffer that is producing the logs. string buffer_uuid = 3 [(validate.rules).string = {min_len: 1}]; diff --git a/src/bitdrift_public/protobuf/logging/v1/payload.proto b/src/bitdrift_public/protobuf/logging/v1/payload.proto index e6442ce..e13575c 100644 --- a/src/bitdrift_public/protobuf/logging/v1/payload.proto +++ b/src/bitdrift_public/protobuf/logging/v1/payload.proto @@ -22,3 +22,51 @@ message Data { BinaryData binary_data = 2; } }; + +enum LogType { + // Normal logs, from application code. + NORMAL = 0; + // Session replay logs. + REPLAY = 1; + // Application lifecycle logs. + LIFECYCLE = 2; + // Resource monitoring logs, such as memory, CPU, and battery consumption. + RESOURCE = 3; + // Internal SDK logs. + INTERNAL_SDK = 4; + // View lifecycle. + VIEW = 5; + // Device state. + DEVICE = 6; + // UX interaction. + UX = 7; + // Span start/end pairs. + SPAN = 8; +} + +message Log { + message Field { + string key = 1; + Data value = 2; + } + + // The timestamp in unix microseconds indicating when this log was recorded. + // NOTE: This was intentionally chosen to be the first field for trivial extraction without + // parsing the full message. + uint64 timestamp_unix_micro = 1; + // The log level. + uint32 log_level = 2; + // The message associated with the log. + Data message = 3; + // An optional list of high cardinality fields. + repeated Field fields = 4; + // The ID of the session associated with this log. + string session_id = 5; + // The list of action IDs that were triggered by this log line. + repeated string action_ids = 6; + // The type of log. + LogType log_type = 7; + // The list of stream IDs that were associated with this streaming log. + // This should only be set when the log has been streamed. + repeated string stream_ids = 8; +}