TimescaleDB
ENTERPRISE: Built-in integrations are available for Sensu Enterprise
users only.
Overview
TimescaleDB is an open source time series database powered by PostgreSQL.
This integration allows Sensu Enterprise to send metrics directly to TimescaleDB using the PostgreSQL protocol.
Configuration
The TimescaleDB integration requires a TimescaleDB table with following columns and types.
For example, the following commands create a sensu
database, a metrics
table with the required table structure, and a sensu
user with access privileges for the metrics
table:
CREATE database sensu;
\c sensu
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;
CREATE TABLE metrics (
time TIMESTAMPTZ NOT NULL,
name TEXT NOT NULL,
value DOUBLE PRECISION NULL,
source TEXT NOT NULL,
tags JSONB
);
SELECT create_hypertable('metrics', 'time');
CREATE USER sensu WITH PASSWORD 'secret';
GRANT ALL PRIVILEGES ON TABLE metrics TO sensu;
Examples
The following is an example global configuration for the Sensu Enterprise
TimescaleDB integration.
{
"timescaledb": {
"host": "timescaledb.example.com",
"port": 5432,
"user": "sensu",
"password": "secret",
"database": "sensu",
"table": "metrics",
"tags": {
"dc": "us-west-2"
}
}
}
Integration specification
timescaledb
attributes
The following attributes are configured within the {"timescaledb": {} }
configuration scope.
host |
|
description |
The TimescaleDB host address. |
required |
false |
type |
String |
default |
127.0.0.1 |
example |
"host": "timescaledb.example.com"
|
port |
|
description |
The TimescaleDB port. |
required |
false |
type |
Integer |
default |
5432 |
example |
|
user |
|
description |
The TimescaleDB username. This user must have access privileges for the table specified in the table attribute. |
required |
false |
type |
String |
default |
postgres |
example |
|
password |
|
description |
The TimescaleDB user password. |
required |
false |
type |
String |
default |
nil |
example |
|
database |
|
description |
The TimescaleDB database name. |
required |
false |
type |
String |
default |
sensu |
example |
|
table |
|
description |
The TimescaleDB table where Sensu will send metrics, configured with required columns and types. See the TimescaleDB docs for information about creating a table. |
required |
false |
type |
String |
default |
metrics |
example |
|
tags |
|
description |
Configurable custom tags (key/value pairs) to add to every TimescaleDB measurement. |
required |
false |
type |
Hash |
default |
|
example |
"tags": {
"dc": "us-central-1"
}
|