License
MIT License
v0.1.0 · public · Published over 4 years ago
The Sensu TimescaleDB Handler is a Sensu Event Handler that sends metrics to
the time series database TimescaleDB. Sensu can collect metrics using
check output metric extraction or the StatsD listener. Those collected metrics
pass through the event pipeline, allowing Sensu to deliver the metrics to the
configured metric event handlers. This TimescaleDB handler will allow you to
store, instrument, and visualize the metric data from Sensu.
Download the latest version of the sensu-timescaledb-handler from releases,
or create an executable script from this source.
From the local path of the sensu-timescaledb-handler repository:
go build -o /usr/local/bin/sensu-timescaldb-handler main.go
Example Sensu Go handler definition:
{
"api_version": "core/v2",
"type": "Handler",
"metadata": {
"namespace": "default",
"name": "timescaledb"
},
"spec": {
"type": "pipe",
"command": "sensu-timescaledb-handler -d postgresql://127.0.0.1:5432/sensu",
"timeout": 10,
"filters": [
"has_metrics"
]
}
}
Help:
Usage:
sensu-timescaledb-handler [flags]
Flags:
-d, --dsn string the DSN of the TimescaleDB database, should be in DSN (Data Source Name) format (e.g. postgresql://localhost:5432/sensu) (default "postgres://localhost:5432/sensu")
-h, --help help for sensu-timescaledb-handler
-t, --table string the PostgreSQL table to store metrics in (default "metrics")
CREATE database sensu;
CREATE TABLE metrics (
time TIMESTAMPTZ NOT NULL,
name TEXT NOT NULL,
value DOUBLE PRECISION NULL,
source TEXT NOT NULL,
tags JSONB
);
See https://github.com/sensu/sensu-go/blob/master/CONTRIBUTING.md
Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.
×