Open nascentcore-eng opened 1 year ago
The schema of the output from WASM should match the actual data as shown in the code. Length prefixed data allow Tricorder to create data table accordingly on the Observability data store (right now is timescale db)
Right now, WASM C guest uses cJSON APIs to serialize C struct into JSON string, and then write the JSON string as output to WASM host environment. Tricorder then writes JSON string a
JSONB
column type to postgreSQL DB.Choosing JSON as serialization format is because of it's self-explanatory. In other words, Tricorder does not need to provide human-readable enrichment to the output data.
We want to provide length-prefixed serialization, with the data schema specified by the users on the management Web UI. This would be an alternative option to JSON.