FIND US ONProduct HuntAgent ObservabilitySee how we help you debug AI agents, and share your feedback.

E2B + Oodle: What your sandbox knows that your agent doesn't

E2B sandbox monitoring: E2B sandboxes send metrics and lifecycle logs over OpenTelemetry (OTLP) straight to Oodle, with no collector in between
On this pageWhat E2B sees that your agent can'tHow the E2B integration worksHow to send E2B telemetry to OodleWhat you can do with E2B telemetry in OodleDemo: debugging an E2B sandbox OOMParting thoughtsFrequently asked questions

An agent writes some Python, runs it in an E2B sandbox, and the run fails with this error:

TimeoutException: The sandbox is running but port is not open ...
This error is likely due to sandbox timeout.

The error says timeout, so you raise the timeout. Nothing changes. The sandbox never timed out: the process inside it ran out of memory and was killed. From the agent's side, the two look the same.

E2B can tell them apart, since it runs the sandbox. E2B now exports sandbox telemetry over OpenTelemetry, and Oodle has a native E2B integration to receive it.

What E2B sees that your agent can't

The three points of view on one sandbox. The agent outside the sandbox sees a TimeoutException. The code inside it goes silent. E2B, outside the VM, logs Out of memory: process was killed. All three send to Oodle, joined on sandbox_id
Three ways to look at one sandbox, joined on sandbox_id

Your agent sees a sandbox only through the E2B SDK. The code inside the sandbox stops reporting the moment it is killed. E2B watches the VM from outside, so it sees the whole life of the sandbox:

QuestionYour agentE2B
Why did the run fail?The SDK reports a timeout or a closed connectionOut of memory: process was killed
Is the sandbox still up?Can't tellYes, until it logs Sandbox stopped
How much memory did it use?Can't telle2b_sandbox_ram_used, sampled every 5 seconds
How many sandboxes are running?Only the ones it thinks it holdse2b_team_sandbox_running
Why did a sandbox end?Can't tellkill_reason: request or timeout

How the E2B integration works

  1. Your app starts sandboxes with the E2B SDK, exactly as it does today.
  2. E2B samples each sandbox from outside the VM and logs its lifecycle: created, paused, resumed, killed, stopped.
  3. E2B sends the metrics and logs over OTLP straight to Oodle. Nothing extra runs in your sandboxes or your cluster.
  4. In Oodle, every metric and log line carries sandbox_id. If your agent logs it too, a failed run leads straight to E2B's logs for that sandbox.

How to send E2B telemetry to Oodle

The E2B tile on Oodle's integrations page shows these values with your instance filled in:

endpoint: "https://<OODLE_INSTANCE>-otlp.collector.oodle.ai"
protocol: "http/protobuf"
headers:
  X-OODLE-INSTANCE: "<OODLE_INSTANCE>"
  X-API-KEY: "<OODLE_API_KEY>"
  1. Send them to E2B support or to enterprise@e2b.dev. The export is part of E2B's Enterprise and BYOC plans, and the E2B team turns it on. There is no setting for it in the E2B console.
  2. Start a sandbox. E2B only sends data while sandboxes run.
  3. From the same tile, provision the E2B Sandboxes dashboard and the recommended monitors.

What you can do with E2B telemetry in Oodle

Debug sandbox OOM kills that look like timeouts

When code needs more memory than the sandbox has, Linux kills the process, but the sandbox stays up. The SDK only sees the connection drop. Filter Oodle's logs on the sandbox_id and service: e2b, and the cause is right there:

Sandbox created
Process with pid 1633 started
Out of memory: process was killed   process=python

There's no Sandbox stopped line, so it wasn't a timeout. The sandbox's memory chart agrees: memory climbs, then falls to idle at the kill.

Catch leaked sandboxes before they hit your concurrency limit

It's easy for an agent to give up on a failed run without killing its sandbox. That sandbox keeps running, and billing, until its timeout, and the agent never counts it. e2b_team_sandbox_running shows what is really running, and kill_reason on each Killing sandbox log tells you whether your code killed it or it expired.

Leaks add up quietly. Once running sandboxes reach your team's limit, every new one fails, for every user:

429: Rate limit exceeded ... you have reached the maximum number of concurrent E2B sandboxes (20).
Chain of events: a prompt change ships, generated code needs too much memory, the process is OOM killed, the SDK reports a sandbox timeout, the agent retries while the old sandbox stays up, leaked sandboxes pile up to the team limit, and every user gets a 429
How one OOM can turn into 429s for every user

The fix on your side is small: kill sandboxes in a finally block.

Debug each sandbox with high-cardinality metrics

Every E2B sandbox metric carries a sandbox_id label, and sandboxes are short-lived. An agent that starts thousands of sandboxes a day creates thousands of new series a day for every metric. That is high cardinality, and the usual advice is to drop a label like that to keep the bill down. As Premature Cost Optimization Is the Root of All Blind Spots puts it, you then find out in the next incident that the signal you need isn't there.

Oodle is built to keep high-cardinality labels, so you don't have to drop sandbox_id. Introducing Oodle AI explains the architecture behind it, and Has ClickHouse conquered metrics? benchmarks it on 25M high-cardinality series.

With sandbox_id on every metric, a fleet average stops hiding the one sandbox that is in trouble:

  • Which sandbox ran out of memory? Open the memory chart for that sandbox_id, right next to its OOM log.

  • Which sandboxes are close to the limit right now? Rank them:

    topk(10, max by (sandbox_id) (e2b_sandbox_ram_used / e2b_sandbox_ram_total))
    
  • Which sandboxes leaked? Look for sandboxes that are still running but doing nothing, and check their kill_reason when they end.

  • Which user or session was it? If your agent's metrics and logs carry the same sandbox_id, you can go from one sandbox to the request that started it.

Right-size sandbox CPU and memory

The dashboard shows running sandboxes, starts, and vCPUs and memory used against what you allocated, with the busiest sandboxes below. If most sandboxes use a fraction of their memory, a smaller template costs less. If they sit near the limit, the next large input gets killed.

Alert on sandbox CPU, memory and disk

The tile provisions three monitors:

MonitorFires when
CPU saturatedA sandbox uses more than 90% of its vCPUs for 10 minutes
Memory near limitA sandbox uses more than 85% (warning) or 95% (critical) of its memory for 5 minutes
Disk near fullA sandbox uses more than 85% (warning) or 95% (critical) of its disk for 5 minutes

Two more are worth adding: a log monitor on Out of memory: process was killed, and a metric monitor on e2b_team_sandbox_running set below your team's limit.

Demo: debugging an E2B sandbox OOM

This video shows both problems in a sample AI data analyst that runs pandas code in E2B. The code is in oodle-onboarding.

Parting thoughts

More and more agents run code that an LLM wrote a few seconds earlier. When that code crashes inside a sandbox, the error your agent gets is often wrong, and the sandbox platform is the one system that knows what happened. That's why we wanted E2B's telemetry in the same place as the agent's traces and logs.

If you're on E2B Enterprise or BYOC, turning this on is one email to E2B. Start with the E2B integration docs, and see how Oodle's Agent Observability covers the agent side. New to it? Start with What is agent observability?

Try Oodle Playground

Frequently asked questions

How do I monitor E2B sandboxes?

Ask E2B to turn on its OpenTelemetry export and point it at your Oodle endpoint. E2B then sends CPU, memory and disk metrics and lifecycle logs for every sandbox. The E2B tile in Oodle sets up a dashboard and monitors on top of them.

Which E2B plans include the telemetry export?

Enterprise and BYOC. The E2B team turns it on for your team, and for BYOC it sends the data from your own environment.

Why does my E2B sandbox report a timeout when it ran out of memory?

When a process in the sandbox uses more memory than the sandbox has, Linux kills it, but the sandbox keeps running. The SDK only sees the connection drop and reports a timeout. E2B logs Out of memory: process was killed for that sandbox.

Does the export slow down my sandboxes?

No. E2B collects the data from outside the VM, so nothing extra runs inside your sandbox. E2B calls the export best effort: if Oodle can't be reached, some data may arrive late or be dropped.

See your own telemetry in Oodle

Start debugging in minutes.

Start freeBook a demo

Get new posts by email

Engineering write-ups from the team.