# Telegraf configuration with CrateDB output.
# https://cratedb.com/docs/guide/integrate/statsd/

# StatsD Input Plugin
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd
[[inputs.statsd]]
  ## Protocol, must be "tcp", "udp4", "udp6" or "udp" (default=udp)
  protocol = "udp"

  ## Address and port to host UDP listener on
  service_address = ":8125"

  interval = "5s"

# CrateDB Output Plugin
# https://github.com/influxdata/telegraf/tree/master/plugins/outputs/cratedb
[[outputs.cratedb]]
  ## Connection parameters for accessing the database see
  ##   https://pkg.go.dev/github.com/jackc/pgx/v4#ParseConfig
  ## for available options
  url = "postgres://crate:crate@cratedb/?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 = "_"
