Time series
Some facts change faster than objects should: a freezer temperature every 30 seconds, the fill of a raw milk silo every minute, the box temperature in a reefer trailer on the road. The Ontology reads these as time series from object types and lake tables, buckets them at query time and raises alerts when a threshold holds. A shop object stays small and readable, and its freezer history is one query away
In the platform today
Time series queries and threshold alerts run in the platform service. They read series from tables that already exist rather than from a separate points store. Every object type with a timestamp property is a source, split by its links and valued by its numeric properties or a count: Markham's health-message by aircraft, say. A lake table such as raw.edge_readings, where edge agents land readings, can be read directly by anyone who may read it in the SQL workspace, or configured under timeseries.sources with its own groups
Buckets come from DuckDB time_bucket, from 1 second to 52 weeks, in UTC or a named time zone. Aggregations are avg, min, max, sum, count, first, last, median, stddev and percentiles. Gaps are left out, set to null or zero, or filled from the previous value or linearly, and a rolling window can be added over the buckets. The object type's access label, row policy and hidden properties apply, and splitting by a link keeps only the objects the caller can see. The Metrics screen in the Markham workspace reads these series
An alert rule watches the latest buckets of a series and fires when every one of the last for buckets is above or below a threshold. Each entry into or out of breach is a row in ops.timeseries_events and an audit entry. Markham backs a series-alert object type with that table, so an automation can start from it. Rules come from ontology.yaml or the API, are evaluated every minute while the service runs, and read the series with their owner's access
timeseries:
alerts:
hangar-humidity:
source: hangar-sensors
value: value
keyBy: tag
step: 15m
agg: avg
above: 60
for: 2 # buckets in breach before it fires
severity: warning
owner: mc.lee
Time series properties, the points store and its API, rollups computed on arrival, late-data handling, the latest value in the search index, derived series, and rate, band, silence and state conditions on this page are delivered on request
Series and objects
On request, a time series becomes a property of its object type, so each shop, silo or reefer delivery carries its own series with a unit and an expected interval, and state series, such as equipment running, idle or in alarm, report time in each state. Today, a series is any object type or lake table with a timestamp, split by a key such as a shop or an aircraft, as described above
Storage and ingestion
Today, readings from edge agents and connectors land in lake tables, such as raw.edge_readings, and are read as series from there. On request, readings live in their own store with rollups, and a points API takes them in any order, correcting rollups and alerts when late ones arrive
Querying
Today, the client reads series with mso.timeseries.query({ source, value, key, step }), with the bucket size, aggregation, gap filling and rolling window described above. On request, a query asks for a time range and a number of points and the store picks the resolution from its rollups, and series can be fetched for every object in an object set
Leave gaps as gaps unless there is a reason to fill them. Interpolating across a two-hour sensor outage would draw a smooth line through the exact period nobody knows about
Series in object queries
On request, the latest value of a series is kept in the search index, so "shops whose freezer is above −20 °C right now" is a filter on an object set, and window functions over series, such as the maximum over the last hour, are available as derived properties
Derived series
On request, a derived series is a formula over other series and properties, such as a silo's volume in litres from its fill and capacity or a reefer's deviation from its setpoint, usable anywhere a stored series is
Alerts
An alert rule watches a series and fires when every one of its last for buckets is above or below a threshold, such as a hangar's humidity above 60% for two 15-minute buckets in the rule above. Each entry into or out of breach is recorded, and an automation can start an agent, a function or an action from it
On request, rules are evaluated as points arrive, each firing opens an alert object linked to its source for people to triage, and conditions also cover a band around another series, a rate of change, silence and states
An alert changes nothing in the operation by itself. It records a condition and can start work. Anything that changes state, such as moving stock or holding a batch, still goes through an action with its criteria, approvals and log
Security
A series inherits the security of its object. A reader who cannot see a shop cannot read its freezer series or its alerts. Field access applies too: hiding compressorCurrent from a group hides its series. Access labels on the object, such as QUALITY, apply to every point. Direct reads of the lake tables follow storage and catalogue grants, as for object tables
Limitations
- The points API is delivered on request; alert rules run in the platform today in the format above
- A series has no security of its own. It inherits its object's, so a series cannot be shown to someone who cannot see the object it belongs to
- An alert records a condition and never changes state by itself. Holding a batch or moving stock still needs an action
Default limits for time series are below. Most can be raised on request, as described in limits and quotas
| Item | Default |
|---|---|
| Buckets per series per request | 5,000 |
| Series per request | 1,000 |
| Points per request | 200,000 |
| Rolling window | 1 to 1,000 buckets |
| Alert evaluation | Every 60 s while the service runs |