Skip to main content
Observability helps you answer what happened to a sandbox, whether long-running work is still healthy, and which events your application should react to. Use lifecycle events for durable state transitions, webhooks for application notifications, and monitor streams for live metrics and process snapshots.

Choose A Signal

NeedUse
List or stream create, pause, resume, hibernate, fork, and destroy transitionsLifecycle events
Notify your service when lifecycle events happenWebhooks
Watch live CPU, memory, process, update, and error eventsMonitor sandboxes
Inspect timeout behavior and resource usageMetrics and timeouts

Quick Examples

List recent lifecycle events:
from nullspace import Lifecycle

lifecycle = Lifecycle()
events = lifecycle.list_events(limit=20)
for event in events.events:
    print(event.operation, event.status, event.sandbox_id)
lifecycle.close()
Subscribe to live monitor metrics:
from nullspace import Monitor

monitor = Monitor()
subscription = monitor.subscribe(
    interval_ms=1_000,
    include_processes=True,
    on_metrics=lambda event: print(event.metrics),
    on_processes=lambda event: print(event.processes),
    on_error=lambda event: print(event.message),
)
subscription.stop()

Operational Guidance

SituationGuidance
A workflow owns a specific sandboxUse per-sandbox lifecycle and metrics helpers.
A control plane watches many sandboxesUse lifecycle list/stream filters and webhooks.
A process may be alive but not readyCombine monitor data with command, process, or preview readiness checks.
You need retryable automationPersist event IDs and resume streams with after_event_id.

Observability Guides

Lifecycle events

Understand state changes such as create, pause, resume, hibernate, and stop.

Webhooks

Receive event notifications in your own service.

Monitor sandboxes

Inspect resource usage and operational state.