TimescaleDB
This type of distribution sends incoming data to a TimescaleDB server to be recorded.
TimescaleDB is a modified version of PostGRESQL designed to handle long term, high-speed time-series data without experiencing the major performance issues that arise when storing this sort of data in a traditional database engine.
Type Name
The type name to use in your configuration is timescale.
Configuration
The following configuration options are accepted…
| Name | Notes | Purpose |
|---|---|---|
| hostname | Required | The full path to your API endpoint, including /api/v2/write. |
| port | Default=5432 | The host port number |
| database | Required | The name of the database to write to |
| table | The name of the table to write to | |
| namefield | The name of the field that contains the measurement name | |
| valuefield | The name of the field that contains the final value | |
| timefield | The name of the field that contains the timestamp | |
| username | The username to connect with | |
| password | The password to connect with | |
{ "type": "timescale", "config": { "hostname": "mydb.tsdb.cloud.timescale.com", "database": "tsdb", "username": "tsdbadmin", "password": "passwd", "table": "values", "port": 64463, "namefield": "name" } }
Setup
This recording technique expects a simple table structure made up of three fields - a value name, a value and a time.
To create a hypertable with this structure, try the following…
CREATE TABLE VALUES (name VARCHAR(120),VALUE DECIMAL,TIME TIMESTAMPTZ NOT NULL) WITH ( timescaledb.hypertable, timescaledb.chunk_interval = '1 day' );
Suggestions
Keep the individual point names quite simple - we suggest not using options like 'fullpath'.