Skip to main content

E2B

Send metrics and logs from E2B sandboxes to Oodle with the E2B OTel telemetry export.

E2B sends the CPU, memory and disk of every sandbox, the sandbox count of your team, and sandbox lifecycle logs over OTLP HTTP. E2B sends them straight to Oodle, so you run no collector.

Oodle ships an E2B dashboard and three recommended monitors. You provision both from the integration tile.

Prerequisites​

  • An E2B Enterprise or BYOC plan. E2B makes the telemetry export available on these plans only, and the E2B team turns it on for your team.
  • OODLE_INSTANCE: Your Oodle instance ID. Go to the Settings icon -> API Keys page in your Oodle UI to find it. (Oodle UI links: ap1, us1)
  • OODLE_API_KEY: Your Oodle API key for authentication. Go to the Settings icon -> API Keys in your Oodle UI to choose an appropriate key. (Oodle UI links: ap1, us1)
  • An Oodle account (navigate to ap1, us1 to start setup)

Ask E2B for the export​

There is no setting for the export in the E2B console or SDK. Give these values to E2B support or to [email protected]. The E2B tile in Oodle shows them with your instance values 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>"

E2B adds /v1/metrics and /v1/logs to the endpoint. Use a dedicated API key, so that you can revoke it without effect on other senders.

Verify​

E2B exports only while sandboxes run, so start one or more sandboxes first.

  1. Go to ap1, us1 and search for e2b_sandbox_cpu_used. There is one series for each running sandbox.
  2. Go to ap1, us1 and filter on service: e2b. Look for Sandbox created and Sandbox stopped lines.
  3. Open the E2B tile (ap1, us1) and provision the dashboard and monitors.

Dashboard​

Open the Dashboards tab in the E2B tile and click Provision & View Dashboards. Provisioning overwrites by name, so it is safe to repeat.

The E2B Sandboxes dashboard has two rows:

RowCovers
FleetRunning sandboxes, peak running sandboxes, sandbox starts, vCPUs in use against allocated, memory used against allocated
SandboxesCPU, memory, disk and page cache of each sandbox, and the busiest sandboxes by peak CPU and memory

The Team, Sandbox type and Sandbox variables filter every panel.

Monitors​

Open the Monitors tab in the tile and click Provision Recommended Monitors. Monitors are matched by name, so your edits are kept and provisioning again restores only the ones you removed.

MonitorSeverityFires when
E2B Sandbox CPU SaturatedWarningA sandbox uses more than 90% of its vCPUs for 10 minutes
E2B Sandbox Memory Near LimitWarning, CriticalA sandbox uses more than 85% (warning) or 95% (critical) of its memory for 5 minutes
E2B Sandbox Disk Near FullWarning, CriticalA sandbox uses more than 85% (warning) or 95% (critical) of its disk for 5 minutes

Metrics collected​

E2B names its metrics e2b.*. Oodle stores them with underscores.

MetricTypeDescription
e2b_sandbox_cpu_usedGaugeCPU usage, as a percent of the sandbox vCPUs
e2b_sandbox_cpu_totalGaugevCPUs of the sandbox
e2b_sandbox_ram_usedGaugeUsed memory in bytes, without the page cache
e2b_sandbox_ram_cacheGaugeMemory that the page cache uses, in bytes
e2b_sandbox_ram_totalGaugeMemory of the sandbox, in bytes
e2b_sandbox_disk_usedGaugeUsed disk, in bytes
e2b_sandbox_disk_totalGaugeDisk of the sandbox, in bytes
e2b_team_sandbox_runningGaugeSandboxes that run now
e2b_team_sandbox_createdCounterSandboxes started. A resume of a paused sandbox counts as a start.

Every sandbox metric has the sandbox_id, team_id, build_id and sandbox_type labels. Team metrics have team_id.

E2B samples the sandbox gauges every 5 seconds. When a sandbox stops, E2B stops its samples too. A plain selector keeps the last value for the 5 minute query lookback, so a stopped sandbox still shows for a few minutes. To drop a stopped sandbox sooner, the dashboard reads each gauge with last_over_time(...[30s]) and the monitors with last_over_time(...[1m]). The monitors use the longer window so that a late sample does not hide a sandbox.

When a paused sandbox resumes, its gauges can start a second series with new labels, so group by sandbox_id to count each sandbox once.

Logs collected​

Every log record has service: e2b. The records include:

  • Sandbox lifecycle: Sandbox created, Pausing sandbox, Started resuming sandbox, Killing sandbox, Sandbox stopped
  • Processes in a sandbox: Process with pid <pid> started and ended
  • CPU warnings: CPU usage threshold exceeded, with the cpu_used_percent and cpu_threshold_percent attributes

The sandbox_id, team_id, template_id and logger attributes are on every record. The logger attribute names the E2B component that wrote it, for example orchestrator, orchestration-api, envd or process.

Troubleshooting​

IssueResolution
No metrics or logs arriveStart a sandbox. E2B exports only while sandboxes run.
Still no data with a running sandboxAsk E2B to confirm that the export is on for your team ID, and that it uses the endpoint and headers above.
Metrics arrive but logs do notAsk E2B to confirm that it sends logs to the same endpoint.
The sandbox count is higher than the running countA stopped sandbox shows until its last sample leaves the query window. Use e2b_team_sandbox_running for the exact count.

Demo​

A workload that starts sandboxes and puts CPU, memory and disk load on them is in oodle-onboarding.


Support

If you need assistance or have any questions, please reach out to us through: