TimeSeries History
The TimeSeries History table stores the historic values of the tags registered in TimeSeries ConfigurationTimeSeries Configuration. Every reading is numeric.
The unique constraint on this table is sourceWellId + sourceTimeSeriesId + timestamp. Re-posting an existing timestamp for the same tag upserts (overwrites) the previous value, and if a payload carries the same point twice, one row is written.
TimeSeries Configuration for a given sourceTimeSeriesId must be added to the system before attempting to add TimeSeries History to that sourceTimeSeriesId.
Variable | Data Type | Is Nullable? | Description |
|---|---|---|---|
sourceWellId | String | No | Source ID for the well From WellView: wvwellheader table, idwell column From OpenWells: cd_well table, well_id column |
sourceTimeSeriesId | String | No | Time series tag identifier, which must already exist in TimeSeries ConfigurationTimeSeries Configuration OSI PI Use Tag ID: xxx.yyy.zzz OSI PI AF use AttributeID: \\server\\element\\attributeID |
timestamp | Datetime Offset | No | Timestamp of the reading. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28:37+0000 |
value | Double | No | The numeric value of the reading, in the unit of measure declared on the tag's configuration |
Data Integrity Checks
Condition | Response |
|---|---|
(sourceWellId, sourceTimeSeriesId) does not match a TimeSeries Configuration | Row Rejected |
sourceWellId, sourceTimeSeriesId, timestamp, or value is null | Record Rejected |
Duplicate (tag + timestamp) | Record Upserted |
Partial success on bulk ingest
Unlike configuration upserts, history ingest does not abort the batch on bad rows. All valid rows are written first; rows referencing an unknown (sourceWellId, sourceTimeSeriesId) pair are then reported in the error response. An error response therefore does not mean nothing was written — check the message, which states how many rows were written and which pairs were rejected.
Common Error Messages
API | Scenario | Error Response |
|---|---|---|
Bulk add history | Some rows reference unknown tags | TimeSeries history upsert wrote N row(s) but rejected rows for M unknown (sourceWellId, sourceTimeSeriesId) pair(s): ... |