Skip to content

Telemetry query & retention

This page is the reference for reading telemetry back out of CORE-M and for the data-governance controls that surround it: how long data is kept, how it is rolled up, how it is exported, and how it is deleted without falsifying blockchain proofs. For how data is written in the first place, see Sending telemetry.

CORE-M supports querying multiple devices and multiple metrics over a time range, with aggregation, downsampling, timezone-aware bucketing, and pagination. A query returns one series per device/metric pair.

ParameterDescription
devicesOne or more device IDs.
metricsOne or more metric names.
start / endTime range bounds (ISO 8601).
aggregationReduction per bucket, e.g. avg, min, max, sum, count.
intervalBucket width, e.g. 5m, 1h, 1d.
timezoneBucket-alignment timezone (defaults to the tenant timezone).
fillHow missing buckets are represented (fill policy).
POST /api/v1/telemetry (query via QueryTelemetrySeries)
{
"devices": ["D1", "D2"],
"metrics": ["temperature", "humidity"],
"start": "2026-05-01T00:00:00Z",
"end": "2026-05-08T00:00:00Z",
"aggregation": "avg",
"interval": "5m"
}

When an aggregation interval is a calendar unit (a day, for example), bucket boundaries align to the tenant’s local days, not to UTC. A daily query that spans a daylight-saving transition still produces correctly aligned local-day buckets, and the response carries timezone metadata so the client can interpret them.

A query that would return more raw points than the tenant’s max_query_points is rejected rather than served partially.

ConditionResult
Estimated result within max_query_pointsQuery runs
Estimated result exceeds max_query_pointsRESOURCE_EXHAUSTED; response suggests a coarser interval that would satisfy the limit

CORE-M maintains downsampled rollups at fixed resolutions so dashboards and long-range queries never scan raw telemetry.

ResolutionUse
1mShort-range, high-detail views
5mMedium-range views
1hMulti-day to multi-week views
1dMulti-month views
  • Rollups are computed as TimescaleDB continuous aggregates and indexed in Aerospike (telemetry namespace, rollups set).
  • A scheduler refreshes the aggregates as new telemetry arrives and updates the corem_telemetry_rollup_lag_seconds metric.
  • The query planner selects the appropriate rollup automatically. For example, a 90-day hourly request resolves against the 1h rollup, and the response metadata reports source="rollup_1h".

Retention is policy-driven and applied per selector. A policy never deletes blockchain proof records needed to verify already-anchored data.

FieldMeaning
policy_idPolicy identifier
tenant_idOwning tenant
selectorWhat the policy targets — device, group/profile, metric, or tag
raw_retention_daysHow long raw telemetry is kept
rollup_retention_daysHow long rollups are kept
proof_retentionRetention for proof records (preserved independently of raw data)
delete_behaviorWhat cleanup does on expiry: redact, delete, or archive
legal_holdIf set, suspends all deletion for the selector
created_at / updated_atAudit timestamps
ScenarioOutcome
Raw telemetry past raw_retention_days, point is finalRaw TimescaleDB rows may be deleted; the proof row and portable proof metadata remain; the proof lifecycle record remains or is compacted to a final summary
Selector under legal holdNo raw, rollup, proof, alarm, or audit data is deleted; cleanup reports a skipped_legal_hold count
Policy updated (e.g. 90 → 365 days)Future cleanup uses the new value; audit event retention.policy.updated records old and new values

legal_hold on a selector freezes deletion entirely. While a device, group, or tenant is under hold, retention cleanup skips all of its raw telemetry, rollups, proofs, alarms, and audit data and reports the skipped count in cleanup metrics. Lifting the hold resumes normal policy-driven cleanup.

Exports are asynchronous jobs covering telemetry, rollups, alarms, audit logs, and proof bundles. Job records live in the Aerospike telemetry namespace, export_jobs set, keyed {tenant_id}:{job_id}.

StepBehaviour
CreateRequires the exports permission; job is created with status="queued" and event export.requested.{tenant}.{job} is published
BuildA worker writes a manifest of telemetry files plus proof-bundle references (when include_proofs=true)
Size guardIf estimated size exceeds max_export_size_bytes, the job is rejected with RESOURCE_EXHAUSTED, returning estimated_size_bytes and max_export_size_bytes
DownloadThe completed job exposes a signed, expiring download URL (e.g. 24 h); after expiry, an authorized user can regenerate one

Compliance deletion with proof preservation

Section titled “Compliance deletion with proof preservation”

Operational deletion and immutable proof preservation are deliberately separated. Deleting telemetry for compliance must not falsify or remove blockchain proof facts.

ScenarioOutcome
Redact a personal field (e.g. operator_name) for a deviceQuery APIs stop returning the field; proof records keep the hashes and metadata needed to prove historical existence; verification discloses the raw payload is no longer retained
Request deletion of a final proof rowRejected. The system refuses direct proof deletion, suggests redaction/export workflows, and writes audit event proof.delete.denied

See Security & compliance for the data-subject workflows and audit trail around deletion.

Quotas are enforced per resource and reject with RESOURCE_EXHAUSTED when exceeded. They are distinct from the gateway’s per-tenant request rate limit (see API overview).

QuotaEnforced on
Ingest ratePoints per minute accepted at ingest
StorageTotal stored bytes per tenant
Query rangemax_query_points per query
Export sizemax_export_size_bytes per export job
Dashboard connectionsConcurrent WebSocket connections
API requestsPer-tenant request rate
Anchoring backlogPending batches per tenant
ScenarioOutcome
Ingest quota exceededTelemetry request rejected with RESOURCE_EXHAUSTED; no proof lifecycle record is created; corem_quota_rejections_total{quota="ingest_points"} increments
Storage at 85% of quotaEvent quota.warning.{tenant}.storage published; tenant admins see a warning in settings

CORE-M tracks per-tenant usage so quotas and billing can be reasoned about.

CounterGranularityDescription
Points ingestedper dayAccepted data points per tenant per day
Storageper dayStored bytes per tenant per day