# Stored Records

_Peios / Using Peios / Reading Records_

> The three kinds of eventd records and the limits of stored history.

eventd stores events, logs, and metrics so that you can inspect what a
Peios machine recorded. Each kind answers a different question and has a
different delivery guarantee.

The stores hold these records:

| Kind | Contents | Delivery |
|---|---|---|
| Events | Structured records from kernel rings | Sequence receipts and detected-loss records |
| Logs | Text with an origin and output-stream flag | Best effort through the trusted output broker |
| Metrics | Numeric samples identified by names and labels | Best effort with publication authorization |

A metric series combines a name with its labels. Samples from different
label sets belong to different series even when they share a name.

## Producers and record meaning

Service output reaches eventd through peinit's output broker. A log retains
its origin, stream, and run context. Hooks and health checks can have their
own origin suffixes under the service name; jobs have job identifiers. A
service attached through `TTYPath` writes to its terminal instead of that
capture path. Standard error identifies a stream, not necessarily an error.
Read [Service Output and
Logging](/peios/using-peios/services-and-jobs/output-and-logging.md) for capture and
backpressure behavior.

Structured events identify a type and carry fields defined by its event
catalog. Use `evman` to interpret those fields rather than inferring identity
or causation from the event name. A kernel ring is volatile; eventd supplies
stored history within collection and retention limits.

Counters describe accumulating quantities, gauges describe changing levels,
and histograms describe distributions. Compare samples within the same label
set and account for producer restarts before interpreting a counter's rate.
eventd publishes its own health under `eventd.*`.

Use [Event Viewer](/peios/using-peios/reading-records/event-viewer.md) for interactive
inspection, or [query records](/peios/using-peios/reading-records/querying-records.md) with
`evctl`. Its read policy is the same boundary for either client.

## Visibility

Queries run with the caller's socket identity. eventd checks access to
record names and individual fields before returning data. It omits denied
records and fields without announcing their existence. An empty result
therefore does not establish that nothing happened.

Use the query client rather than opening the databases directly. Direct
file access bypasses eventd's query authorization.

## Retention and loss

Stored history is finite. Retention removes old records and can remove
records to meet configured size limits. Kernel event rings can overwrite
records before eventd reads them; log and metric sockets can drop input.
A successful send is not a persistence acknowledgment.

The `eventd.events.lost` event describes detected missing event sequences.
It cannot reconstruct their payloads. `eventd.store.quarantined` describes
a corrupt database moved aside. Use the eventd evman records to interpret
the fields of either event.

See [Finding Missing Records](/peios/using-peios/reading-records/finding-missing-records.md)
when a result differs from what you expect.
