cratedb

package
v0.0.0-...-bdb06d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2018 License: MIT Imports: 12 Imported by: 0

README

CrateDB Output Plugin for Telegraf

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 connection string.
  # See https://godoc.org/github.com/jackc/pgx#ParseDSN
  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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrateDB

type CrateDB struct {
	URL         string
	Timeout     itscripts.Duration
	Table       string
	TableCreate bool `toml:"table_create"`
	DB          *sql.DB
}

func (*CrateDB) Close

func (c *CrateDB) Close() error

func (*CrateDB) Connect

func (c *CrateDB) Connect() error

func (*CrateDB) Description

func (c *CrateDB) Description() string

func (*CrateDB) SampleConfig

func (c *CrateDB) SampleConfig() string

func (*CrateDB) Write

func (c *CrateDB) Write(metrics []tinymonitor.Metric) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL