> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ns.rocks/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor And Snapshots

> Subscribe to monitor updates and manage snapshot metadata.

Monitor streams provide live machine observations, while snapshot APIs create,
list, inspect, and delete reusable snapshot records.

## Monitor

```python theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
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()
```

## Snapshots

```python theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
from nullspace import Machine, Snapshot

machine = Machine.create()
snapshot = machine.create_snapshot()
print(Snapshot.get(snapshot.id))
Snapshot.delete(snapshot.id)
```

Shared volumes remount as external storage on compatible resume, reusable
snapshot restore, and fork. They are not embedded in the VM snapshot.

Concepts: [Hibernate](../../concepts/hibernate), [Resume](../../concepts/resume).
API reference: [listSnapshots](../../api-reference), [getSnapshot](../../api-reference),
[deleteSnapshot](../../api-reference), and [monitorWebsocketUpgrade](../../api-reference).
