e2b-dev / E2B

Secure open source cloud runtime for AI apps & AI agents
https://e2b.dev/docs
Apache License 2.0
7.02k stars 458 forks source link

Start command logs have wrong timestamps #392

Open ValentaTomas opened 4 months ago

ValentaTomas commented 4 months ago

Problem

Logs from the start command can have timestamps that do not correspond to the actual time if they were captured before starting the sandbox because we might be adding the timestamp later (either in the log collector or right before sending the log). This can cause confusion both because the log timestamp is wrong and because if there is a timestamp inside the stdout from the start command it will not match the log timestamp.

Fix

Because we don't want to skip sending logs that were created before the sandbox was created we need to set the timestamp in the envd at the time the log was created plus ensure that the timestamps are not overwritten in the logs collector.