# Logs and metrics

> See what your instance is doing, from its output and resource use to its history.

This page covers where to read an instance's output, how to get your own programs' output into it, what the metrics tell you, and where to see what happened to an instance.

## Read the logs

Logs show what the instance's main process writes to standard output and error: its start command, or the image's own command when there's none. Open the instance and select the **Logs** tab, or use the CLI:

```bash
featherless-cloud instance logs my-instance
featherless-cloud instance logs my-instance --follow
featherless-cloud instance logs my-instance --head
```

Each start or restart begins a new run, and you can pick the run to view. For each run, the first and last 50 MB of output are kept; longer output loses its middle part. Output is kept for 30 days after its last line.

<tip>

Logs are for debugging. For records you need to keep, write them to a network volume or send them to your own logging service.

</tip>

## Send your program's output to the logs

Programs you start in the terminal or over SSH don't write to the logs; their output stays in that terminal. To send it to the logs as well, write to the main process's output:

```bash
python train.py 2>&1 | tee -a /proc/1/fd/1
echo "checkpoint saved" > /proc/1/fd/1
```

To have a program's output in the logs from the start, make it the instance's start command.

## Watch resource use

The **Metrics** tab charts CPU, memory and network use, and on GPU instances each GPU's utilization and memory, over the last hour, 24 hours, 7 days or 30 days. Use it to spot:

- **GPU utilization low while a job runs:** the GPU is waiting on data or on the CPU. Load data in parallel, for example with more `DataLoader` workers.
- **Memory close to its limit:** processes can be killed when memory runs out. Deploy a larger size; each GPU comes with its own share of memory.
- **GPU memory close to full:** lower the batch size, or use more GPUs.

For a live view inside the instance, the PyTorch (ROCm) template includes `nvtop` and `amd-smi`.

## See what happened to an instance

The **Activity** tab lists every event in the instance's life, with the time and who caused it: compute being assigned, starts, stops, failures and automatic stops with their reason, and setting changes such as public ports. From the CLI:

```bash
featherless-cloud instance history my-instance
```

## Next steps

<card-group>
<card icon="i-lucide-sliders-horizontal" title="Manage instances" to="/instances/manage">

Restart or edit an instance.

</card>

<card icon="i-lucide-plug" title="Connect to an instance" to="/instances/connect">

Open a terminal or connect with SSH.

</card>
</card-group>
