Reads and the log
A read is a snapshot. A subscription is the same snapshot, continued by events. The log store is queried by page and followed as it is written.
One record, two operations
read and subscribe answer with the same record, computed the same way from the same filter. They
differ in one thing: what is sent after the record.
The readable subjects
A readable subject is a subject some event's level is about, so the six subject kinds of the event model are exactly the six readable subjects.
| Read | Returns |
|---|---|
instance | its identity and form; whether it is ready or stopping, and since when; the version running and its version stamp; the resolved parameter values; the description in force, as a path and the digest it was read at; the declared weaker arrangements in force |
unit | its declared identity, kind and backend; the plugin it runs, for a Plugin unit; its state and incarnation, with the moment of the last transition; its condition — a grade, a line of text and when it began — or none if it has never reported; the streams currently activated |
plugin | declared: its identity, protocol integer and Manifest digest, and the version, language and SDK line of its last registration. authorized: its enablement, its granted capabilities, its credential mode. observed: whether a Manifest is present, whether anything composes it, the units running it |
channel | its declared name, projection and address class; whether it is attached and by which client; whether it is suspended, why, and what it retains |
document | the document as it was read — a path — what it resolved to, and the digest it was read at |
connection | its identity, projection and actor, its opening instant, and the subscriptions it holds |
- A read naming a kind with no identity returns every subject of that kind. That is the listing; there is no other.
- Every record marks each field group's class: declared, authorized or observed. What is authorized comes from the Registry; what is observed is derived when asked.
- A read of a unit that runs a Plugin carries its plugin's record beside its own, so why is this unit doing nothing is answered in one call.
- Every field is either fixed for the life of the instance or kept current by an event. A plugin's
declared version, language and SDK line are refreshed when a unit of it registers; a consumer that
must be current on them subscribes to the units as well and follows the state change's
cause.
| Kept out of every record | Where it is |
|---|---|
| a unit's restart count | held by the supervisor, for one life of the instance |
| the size of a unit's own data | the manager, which reads the filesystem |
| the retention override in force for a group | the answer to the operation that set or cleared it |
| anything about another instance | the guardian's channel, or the init system |
The log store
log.query and log.follow read one table, in one order, with a cursor the client can hold: the
entry's sequence number.
log.query | log.follow | |
|---|---|---|
| Answers | what happened, between these times, to this unit, at or above this severity | what is being written now |
| Selects on | unit, incarnation, a time range, a severity floor | the same four |
| Starts at | a cursor, or the oldest surviving entry | a cursor, or the next entry to be written |
| Carries | a page of entries, and the cursor to continue from | entries, pushed, until the caller ends it |
| Ends | when the page is delivered | when the caller cancels it, or the instance stops |
- A page is 500 entries. To continue, ask again with the cursor given. There is no offset.
- A cursor whose entry retention removed resumes at the next surviving entry, and the answer says so.
- A follow is bounded at 256 entries. When it overflows, the caller is told the sequence it was current to. No snapshot follows: the entries are durable, so the gap is recovered by a query from that sequence.
- Following the log is not subscribing to events. A subscription carries occurrences as the Core concludes them, including ones not yet written; a follow carries entries, in the order they were stored, readable again later.
Figures
| a query's page | 500 entries, with the next cursor |
| a follow's queue | 256 entries, then an announcement carrying the sequence reached |
| the cursor | the entry's sequence number |
| a listing | a read naming a kind and no identity |