telegraf/plugins/outputs/cratedb
Paweł Żak 0de59d48ec
chore: Enable G202 rule for gosec (#12984)
Co-authored-by: Pawel Zak <Pawel Zak>
2023-04-03 15:21:26 +02:00
..
README.md feat(tools/readme_linter): Check for global configuration section (#12426) 2023-01-12 16:55:21 +01:00
cratedb.go chore: Remove `revive:unhandled-error` - `errcheck` is more flexible (#13008) 2023-04-03 07:19:43 -06:00
cratedb_test.go chore: Enable G202 rule for gosec (#12984) 2023-04-03 15:21:26 +02:00
sample.conf chore(outputs): migrate sample configs into separate files (#11131) 2022-05-18 11:30:06 -05: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.

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

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 = "_"