netobserv / flowlogs-pipeline

Transform flow logs into metrics
Apache License 2.0
73 stars 23 forks source link

Avoid json encoding on flow ingestion #212

Closed jotak closed 2 years ago

jotak commented 2 years ago

As commented here https://github.com/netobserv/flowlogs-pipeline/blob/main/pkg/pipeline/ingest/ingest_collector.go#L168-L169, it seems like there's an easy perf improvement we can do by avoiding json encoding during flow ingestion, especially as it kinda forces users to use json decoding as the following stage.

It seems like we can "just" remove the json encode instruction, update related tests and voila. But that's a breaking change of course, consumers need to update their pipeline to remove the following json decode stage.

What I'm not sure, is if it's still necessary to allow json encoding, as all following stages use a native map format anyway. If we think we must maintain a json-encoded option, there's several possible approaches I can see so far:

ping @eranra @KalmanMeth @ronensc

jotak commented 2 years ago

Fixed by #225