Observability: Traces, Logs, and Execution Streaming
Stream sandbox execution events in real time, attach W3C trace context to nest Podflare spans inside your own traces, and check platform status.
Podflare gives you three observability surfaces: real-time streaming events from run_code, W3C Trace Context propagation so sandbox spans appear inside your existing traces, and a public status page. You don’t need any special setup for streaming — it works out of the box. Trace propagation requires passing a traceparent value.
Every run_code call streams structured events as they are produced. Each event has a type field (stdout, stderr, or exit) along with a sequence number and timestamp:
from podflare import Sandboxwith Sandbox() as s: for event in s.run_code_stream("for i in range(3): print(i)"): if event.type == "stdout": print(f"[{event.seq}] out: {event.data}", end="") elif event.type == "stderr": print(f"[{event.seq}] err: {event.data}", end="") elif event.type == "exit": print(f"exit code: {event.code}")
The raw HTTP API delivers events as newline-delimited JSON (NDJSON). Each line is one event:
Pass a W3C traceparent string and Podflare binds your upstream trace_id and parent_span_id to every log line it emits for that sandbox. This lets you see Podflare spans nested inside your own traces in Langfuse, LangSmith, Datadog, or any OpenTelemetry-compatible backend.
from podflare import Sandbox, Client# Option 1: per-sandboxwith Sandbox(traceparent="00-4bf92f3564d486ad-00f067aa0ba902b7-01") as s: s.run_code("print('traced')")# Option 2: per-client (reuse across many sandboxes)client = Client(traceparent="00-4bf92f3564d486ad-00f067aa0ba902b7-01")with Sandbox(client=client) as s: s.run_code("print('also traced')")# Option 3: environment variable# export PODFLARE_TRACEPARENT=00-4bf92f3564d486ad-00f067aa0ba902b7-01
Generate a fresh traceparent for each agent run so all sandbox operations within that run share the same trace_id. Use the W3C format: 00-<32-hex-trace-id>-<16-hex-span-id>-<flags>.
Check status.podflare.dev for real-time platform health, incident history, and uptime metrics. Subscribe to get notified of incidents by email or webhook.