# Logs, events and metrics

Every Endpoint has three read-only views of what it is doing. None of them
contains a prompt or generated text. In the Console they are the Endpoint's
**Activity**, **Events** and **Metrics**.

## Request logs

One record per request, newest first: request ID, revision and replica that
served it, caller (person or key ID), status and error code, latency, time to
first token, token counts and whether it was streamed.

```sh
nestor inference endpoints logs endp_… --limit 20
```

```python
for log in client.inference.endpoints.logs(endpoint, page_size=20):
    print(log.request_id, log.status, log.latency_ms, log.input_tokens, log.output_tokens)
```

Match the request ID against the `X-Nestor-Request-Id` header your client
received. Asynchronous container requests appear once they finish, with their
invocation ID and final state.

## Events

Deployment and runtime events for each revision and replica: hardware
allocation, model loading, runtime start, readiness, failed health checks,
restarts, replacements and switch-over. Events stay readable after the Endpoint
is deleted, so they are where to look when a deployment fails.

```sh
nestor inference endpoints events endp_…
nestor inference endpoints events endp_… --category runtime
```

## Metrics

Summaries over `1h`, `6h`, `24h` or `7d`: requests and rate, success rate,
latency p50/p95/p99, time to first token, input and output tokens, output
tokens per second and replica readiness.

```sh
nestor inference endpoints metrics endp_… --window 24h
nestor inference endpoints metrics-series endp_… --window 24h
```

```python
m = client.inference.endpoints.metrics(endpoint, window="24h")
print(m.requests, m.success_rate, m.latency_ms_p95)
```

`metrics-series` returns the same facts in fixed UTC buckets for charting. In a
bucket with no requests, counts and request rate are zero, while latency, time
to first token and success rate are `null` because there is nothing to measure. Request logs are written after
each response on a best-effort basis, so a bucket can undercount traffic; it
never invents requests.

Console Playground timings measure the round trip from your browser, including
network time. Activity and Metrics report server-side measurements.

## When something goes wrong

1. Read the failed Operation's error code and message.
2. `events --category deployment` shows which deployment step failed.
3. `events --category runtime` shows health-check and restart history for a
   `DEGRADED` or `UNAVAILABLE` Endpoint.
4. Request logs show each call's outcome. Quote request IDs when you contact
   support.

`nestor operations list` shows every deployment, update and deletion with its
state. Every change to an Endpoint is also in its audit log.
