traceloop icon indicating copy to clipboard operation
traceloop copied to clipboard

Keep compressed logs of retired tracers in a separate data structure

Open pothos opened this issue 5 years ago • 2 comments

When the k8s subcommand notices that a container is deleted, it keeps the tracelet for one minute. Directly retire the tracelet without any timeouts after dumping it a final time and store the rendered string compressed in a second list (which has a maximal length, appending if full will push the oldest element out). If the API functions for dump, close etc can't find an active tracelet, they fall back to the list of compressed dumps. The API function for list should include the list of compressed dumps.

pothos avatar Dec 09 '19 17:12 pothos

SGTM. But I would keep the logs in a structured format (some custom json that we can compress) and only render it to text when the user asks for it. That would leave the possibility of having different presentation format (e.g. with or without timestamps) and the user can decide that format later.

alban avatar Dec 09 '19 17:12 alban

Makes sense, maybe compressing a the binary serialization with protobuf/captnproto/bson or some other marshalling library for Go is even more efficient than just compressing text.

pothos avatar Dec 09 '19 20:12 pothos