Data / events over time
P2 · Advanced
Timeseries Database
Capture measurements, events, and metrics over time. Analyze trends, aggregate readings, and build dashboards.
Define a metric, write points, and query them by time and dimension.
Paths in the tables are relative to https://api.ultrahost.com/v1/projects/{projectId}. Pagination, idempotency, and errors are described in Conventions.
Create
| SDK | REST | Description |
|---|---|---|
timeseries.createMetric(name, config?) | POST /timeseries/metrics | Define a metric |
timeseries.getMetric(name) | GET /timeseries/metrics/{name} | Retrieve metric configuration |
timeseries.listMetrics() | GET /timeseries/metrics | List metrics |
timeseries.updateMetric(name, config) | PATCH /timeseries/metrics/{name} | Update retention and aggregation settings |
timeseries.deleteMetric(name) | DELETE /timeseries/metrics/{name} | Delete a metric and its readings |
await ultrahost.timeseries.createMetric("temperature", {
unit: "celsius",
retentionDays: 365,
resolution: "minute"
});Configure
The metric declares what the API will actually do. Do not promise arbitrary real-time grouping when the store only supports scheduled rollups.
Supported requirements:
- Several measurements in one request
- Configurable time resolution
- Retention policies
- Aggregations:
min,max,avg,sum,count - Dimension filters where the metric says they are supported
- Historical queries and latest-value reads
- Cursor pagination
projects.getCapabilities() surfaces which of these a deployment implements.
Use
| SDK | REST | Description |
|---|---|---|
timeseries.write(metric, point) | POST /timeseries/{metric}/points | Record a measurement |
timeseries.writeBatch(metric, points) | POST /timeseries/{metric}/points/batch | Record several measurements |
timeseries.query(metric, options) | POST /timeseries/{metric}/query | Retrieve measurements |
timeseries.latest(metric, options?) | POST /timeseries/{metric}/latest | Get the latest reading |
timeseries.aggregate(metric, options) | POST /timeseries/{metric}/aggregate | Calculate aggregates |
timeseries.stats(metric) | GET /timeseries/{metric}/stats | Retrieve metric statistics |
await ultrahost.timeseries.write("temperature", {
value: 24.5,
timestamp: new Date(),
dimensions: {
building: "A",
sensor: "42"
}
});
const history = await ultrahost.timeseries.query("temperature", {
from: "2026-11-01",
to: "2026-11-14",
dimensions: { building: "A" },
interval: "hour",
aggregation: "avg"
});React apps can read a series with useTimeseries(metric, query).