Skip to content

Observations

Markdown

Adapters turn anything into observations with one shape:

id, source, type, timestamp, ingested_at, fields, tags, raw_ref

The structure is the same for every source; only fields is domain-specific. Raw payloads stay at the source when it is durable: raw_ref points back to it.

You do not write a parser per source. The adapter’s normalize block maps a raw record to an observation by path:

normalize:
mode: declarative
identity: { strategy: natural_key, key: ["$.data.id"] }
timestamp_from: "$.data.date"
type: expense
fields:
amount: { path: "$.data.amount" }
note: { path: "$.data.note" }

identity decides when two records are the same one, so re-reading a source never double-counts.

Measures are aggregates over observations, recomputed each cycle:

measures:
spent:
aggregation: sum
field: fields.amount
filter: "type == 'expense'"
window: 30d
default: 0

Old data is rolled up rather than deleted, so a standing goal can run indefinitely under a fixed storage cap.

See Connect data for the adapter types.