Skip to content
Merged
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
24 changes: 19 additions & 5 deletions proto/logsstateful/stateful_encoding.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,28 @@ message StructuredLog {
repeated DynamicValue dynamic_values = 2;

// JSON structured log fields. Example:
// Input log: {"msg":"Evicted 1 tags","agent":"core","time":"2026-03-31","level":"INFO"}
// Converts to:
// json_context {"agent":"core","level":"INFO","time":"2026-03-31"}
// Input log: {"msg":"Evicted user tags","agent":"core","time":"2026-03-31","level":"INFO"}
// With schema-based encoding, converts to:
// json_context_schema 44 (points to "agent,level,time" in dictionary)
// json_context_values ["core", "INFO", "2026-03-31"]
// json_message_key "msg"
// pattern_id 123 (points to "Evicted {} tags")
// dynamic_values [1]
bytes json_context = 3;
// dynamic_values ["user"]

// The key of the json object to put the message back into (e.g. "msg", "message", "log")
DynamicValue json_message_key = 4;

// Schema-based JSON context encoding: separates repeating key structure from per-log values.
// json_context_schema_id references a DictEntryDefine whose value is a comma-separated sorted
// list of JSON keys (e.g. "level,service,timestamp"). Delta-encoded across batches.
uint64 json_context_schema_id = 5;
// json_context_values contains the leaf values in the same order as the schema keys.
// Each value is encoded as a DynamicValue (int64 for numbers, dict_index for repeated strings).
// Nested objects/arrays are serialized as JSON strings.
repeated DynamicValue json_context_values = 6;

// Deprecated: Use json_context_schema_id and json_context_values instead.
bytes json_context = 3;
}

message DynamicValue {
Expand Down
Loading
Loading