traceloop
traceloop copied to clipboard
Keep compressed logs of retired tracers in a separate data structure
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.
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.
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.