Skip to content

Timeseries main - #2518

Draft
hu-ahmed wants to merge 1 commit into
masterfrom
timeseries-main
Draft

Timeseries main#2518
hu-ahmed wants to merge 1 commit into
masterfrom
timeseries-main

Conversation

@hu-ahmed

@hu-ahmed hu-ahmed commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Introduces a new "timeseries" microservice and module family (model, api,
mongodb, service) that records the history of Thing properties and serves
it back over HTTP, WebSocket and Connectivity.

Ingestion is opt-in per property via the WoT ditto:timeseries annotation
and is forward-only. ThingPersistenceActor hands modified events to a
per-node publisher, which resolves the Thing's model and writes matching
properties through the timeseries shard region. Nothing is backfilled, and
deployments without the service pay nothing: the publisher is left null
when the feature toggle is off.

Storage uses native MongoDB Time Series collections, one per namespace, so
per-namespace retention and dropping a tenant stay cheap. Retention
defaults to 90 days with per-namespace overrides, reconciled onto existing
collections via collMod on a namespace's first write after a restart.

Reads are authorized per path under a dedicated READ_TS permission, since
a property's history discloses more than its current value. The
single-Thing endpoint supports keyset pagination, sort order, aggregation,
time-zone-aware bucketing and linear fill.

Cross-Thing aggregation (GET /timeseries/things) spans one namespace with
groupBy and an RQL filter over ingest-time tags. Authorization is decided
live and never stored alongside the data: a namespace-wide grant gates the
request before any storage is touched, then every contributing Thing is
verified against its own policy per path, because namespace root entries
merge additively and a Thing's own policy can still revoke. Guard rails
bound the cost at 100 paths per query and 1000 verified Things; exceeding
either fails the request rather than returning a truncated answer.

The backend sits behind a TimeseriesAdapter interface with an explicit
capability declaration, so a backend that cannot push an aggregation down
falls back to a shared compute kernel. A conformance suite pins both paths
to identical results.

Also adds the Ditto Protocol adapters and the "aggregate" topic action,
the Helm chart gated behind timeseries.enabled=false, OpenAPI definitions,
documentation and UI support.

Signed-off-by: Hussein Ahmed <hussein.ahmed@beyonnex.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant