Skip to main content
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.

Streaming execution events

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 Sandbox

with 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:
{"type":"stdout","data":"0\n","seq":1,"ts":1776510028036}
{"type":"stdout","data":"1\n","seq":2,"ts":1776510028037}
{"type":"stdout","data":"2\n","seq":3,"ts":1776510028038}
{"type":"exit","data":0,"seq":4,"ts":1776510028039}

Attaching your trace context

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-sandbox
with 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>.

Platform status

Check status.podflare.dev for real-time platform health, incident history, and uptime metrics. Subscribe to get notified of incidents by email or webhook.

Python REPL

run_code and run_code_stream details

Authentication

API key setup and request headers