Ingest
Ingesting data - or posting data - to Obelisk Core can be done through a simple HTTP POST message. You will first have to acquire an access token that you can send along. If you are authorized, your sent data will be stored.
Format
You should always send an Array of IncomingDataPoint objects. These object have the following fields:
property | required | description | default |
|---|---|---|---|
timestamp | ✗ | ISO 8601 datetime format | Current server timestamp |
metric | ✓ | Name of the metric. Must include a type suffix that indicates the type of the data point value. Supported types are: | |
value | ✓ | Value of the data point. Obelisk time-series are type-safe: the type must match the type suffix of the metric name. | |
labels | ✗ | Labels associated with the data point. Labels are key-value pairs that can be used to filter and group data points. |
|
location | ✗ | Location associated with the data point. Location is a geographical coordinate represented by a latitude and longitude pair, along with an optional elevation in meters above sea-level. |
Examples
- Sending all possible metadata
- POST /datasets/{datasetId}/data/ingest Content-Type: application/json Authorization: Bearer {ACCESS_TOKEN} [{ "timestamp" : "2022-03-10T16:15:50Z", "metric" : "temperature.celsius::number", "value" : 23.5, "labels": { "site": "BuildingA-Wing132", "sensor": "device-5bce" }, "location" : { "lat": 51.5074, "lng": 0.1278, "elevation": 6.0 } }, ...]
- Sending the minimum possible metadata
- POST /datasets/{datasetId}/data/ingest Content-Type: application/json Authorization: Bearer {ACCESS_TOKEN} [{ "metric" : "temperature.celsius::number", "value" : 23.5 }]
- Sending integer array data (e.g., accelerometer)
- POST /datasets/{datasetId}/data/ingest Content-Type: application/json Authorization: Bearer {ACCESS_TOKEN} [{ "timestamp" : "2022-03-10T16:15:50.123Z", "metric" : "wearable.acceleration::integer[]", "value" : [102, -45, 987], "labels": { "device_id": "watch-5bce" } }]
Data Type Considerations
Integer vs Number Types
Obelisk supports both floating-point (number, number[]) and integer (integer, integer[]) numeric types.
When to use integer/integer[]:
Data contains only whole numbers (no decimal points)
Examples: counts, IDs, timestamps in milliseconds, certain accelerometer/sensor data that reports integers
When to use number/number[]:
Data contains or may contain decimal values
Examples: temperature with decimals, percentages, precise floating-point measurements
Note: If you consistently store only integer values in a
numberfield, you'll still achieve good compression. However, dedicatedintegertypes provide superior performance for integer-only data.Note: For arrays, storing consistent float-only data in
number[]achieves good compression, but mixing integers and floats reduces compression efficiency.