Skip to content

Store flow logs as JSON, matching info/metrics - #157

Open
milan-zededa wants to merge 1 commit into
lf-edge:masterfrom
milan-zededa:flowlog-json-format
Open

Store flow logs as JSON, matching info/metrics#157
milan-zededa wants to merge 1 commit into
lf-edge:masterfrom
milan-zededa:flowlog-json-format

Conversation

@milan-zededa

Copy link
Copy Markdown
Contributor

flowLogProcess still wrote raw protobuf FlowMessage bytes. With the file driver, multiple messages accumulate in the same file, and concatenated protobuf messages are not self-delimiting -- worse, FlowMessage's DevId field (number 1, wire type 2) has tag byte 0x0A, the same byte deviceDataGet appends as a chunk separator when serving GET requests, so naive newline-splitting on the client side would routinely split messages mid-field.

Convert to JSON at write time instead, the same treatment applied to info/metrics in 3af1f41.

flowLogProcess still wrote raw protobuf FlowMessage bytes. With the file
driver, multiple messages accumulate in the same file, and concatenated
protobuf messages are not self-delimiting -- worse, FlowMessage's DevId
field (number 1, wire type 2) has tag byte 0x0A, the same byte
deviceDataGet appends as a chunk separator when serving GET requests, so
naive newline-splitting on the client side would routinely split messages
mid-field.

Convert to JSON at write time instead, the same treatment applied to
info/metrics in 3af1f41.

Signed-off-by: Milan Lenco <milan@zededa.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant