telegraf/plugins/outputs/cratedb
Eng Zer Jun 81090be35d
refactor: replace strings.Replace with strings.ReplaceAll (#11079)
2022-05-11 09:53:34 -06:00
..
README.md chore: Fix readme linter errors for output plugins (#10951) 2022-04-21 09:45:47 -06:00
cratedb.go refactor: replace strings.Replace with strings.ReplaceAll (#11079) 2022-05-11 09:53:34 -06:00
cratedb_sample_config.go feat: migrate output plugins to new sample config format (#10910) 2022-04-07 15:55:03 -06:00
cratedb_test.go fix: CrateDB replace dots in tag keys with underscores (#9566) 2021-08-10 17:48:02 -04:00

README.md

CrateDB Output Plugin

This plugin writes to CrateDB via its PostgreSQL protocol.

Table Schema

The plugin requires a table with the following schema.

CREATE TABLE my_metrics (
  "hash_id" LONG INDEX OFF,
  "timestamp" TIMESTAMP,
  "name" STRING,
  "tags" OBJECT(DYNAMIC),
  "fields" OBJECT(DYNAMIC),
  PRIMARY KEY ("timestamp", "hash_id","day")
) PARTITIONED BY("day");

The plugin can create this table for you automatically via the table_create config option, see below.

Configuration

# Configuration for CrateDB to send metrics to.
[[outputs.cratedb]]
  # A github.com/jackc/pgx/v4 connection string.
  # See https://pkg.go.dev/github.com/jackc/pgx/v4#ParseConfig
  url = "postgres://user:password@localhost/schema?sslmode=disable"
  # Timeout for all CrateDB queries.
  timeout = "5s"
  # Name of the table to store metrics in.
  table = "metrics"
  # If true, and the metrics table does not exist, create it automatically.
  table_create = true
  # The character(s) to replace any '.' in an object key with
  key_separator = "_"