StatsDΒΆ

StatsD logo

About

StatsD provides easy but powerful system and application metrics and stats aggregation.

This network daemon runs on the Node.js platform and listens for statistics, like counters and timers, sent over UDP or TCP. It then sends aggregates to one or more pluggable backend services.

StatsD traditionally uses the Graphite backend and its successors, but you can also configure it to use CrateDB as a backend by relaying data through Telegraf with its built-in CrateDB Output Plugin for Telegraf.

Synopsis

Configure Telegraf using the StatsD input plugin and the CrateDB output plugin.

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

Learn

Use StatsD with CrateDB

How to configure StatsD and Telegraf to submit statistics to CrateDB.

Load data into CrateDB using StatsD and Telegraf