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

# OpenTelemetry Input Plugin
# https://github.com/influxdata/telegraf/blob/release-1.36/plugins/inputs/opentelemetry/README.md
[[inputs.opentelemetry]]
  ## Override the default (0.0.0.0:4317) destination OpenTelemetry gRPC service
  ## address:port
  # service_address = "0.0.0.0:4317"

  ## Override the default (5s) new connection timeout
  # timeout = "5s"

  ## Override the default (prometheus-v1) metrics schema.
  ## Supports: "prometheus-v1", "prometheus-v2"
  ## For more information about the alternatives, read the Prometheus input
  ## plugin notes.
  # metrics_schema = "prometheus-v1"

  ## Optional TLS Config.
  ## For advanced options: https://github.com/influxdata/telegraf/blob/v1.18.3/docs/TLS.md
  ##
  ## Set one or more allowed client CA certificate file names to
  ## enable mutually authenticated TLS connections.
  # tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
  ## Add service certificate and key.
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"

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