6

I'm using telegraf with influxdb, and in the telegraf I'm using the statsd_input plugin.

The statsd_input.conf:

[[inputs.statsd]]
  ## Address and port to host UDP listener on
  service_address = ":8126"

  ## The following configuration options control when telegraf clears it's cache
  ## of previous values. If set to false, then telegraf will only clear it's
  ## cache when the daemon is restarted.
  ## Reset gauges every interval (default=true)
  delete_gauges = true
  ## Reset counters every interval (default=true)
  delete_counters = true
  ## Reset sets every interval (default=true)
  delete_sets = true
  ## Reset timings & histograms every interval (default=true)
  delete_timings = true

  ## Percentiles to calculate for timing & histogram stats
  percentiles = [90]

  ## separator to use between elements of a statsd metric
  metric_separator = "."

  ## Parses tags in the datadog statsd format
  ## http://docs.datadoghq.com/guides/dogstatsd/
  parse_data_dog_tags = true

  ## Statsd data translation templates, more info can be read here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md#graphite
  # templates = [
  #     "cpu.* measurement*"
  # ]

  ## Number of UDP messages allowed to queue up, once filled,
  ## the statsd server will start dropping packets
  allowed_pending_messages = 10000

  ## Number of timing/histogram values to track per-measurement in the
  ## calculation of percentiles. Raising this limit increases the accuracy
  ## of percentiles but also increases the memory usage and cpu time.
  percentile_limit = 1000

I'm trying to set the time precision to seconds. I tried to accomplish this in the telegram.conf file, but it's written in the notes that the precision setting does not affect the statsd plugin:

## By default, precision will be set to the same timestamp order as the
## collection interval, with the maximum being 1s.
## Precision will NOT be used for service inputs, such as logparser and statsd.
## Valid values are "ns", "us" (or "µs"), "ms", "s".
precision = ""

I haven't seen a setting of the precision in the statsd_input.conf file. What is the correct way to accomplish this?

Yuval Pruss
  • 8,716
  • 15
  • 42
  • 67
  • There is an enhancement posted for this here: https://github.com/influxdata/telegraf/issues/1589 but it has been there for two years, so it doesn't look promising. One of the workarounds listed is to `send the data with the desired timestamp to socket_listener.` – Guilherme Lopes Dec 02 '18 at 07:05
  • @GuilhermeLopes Yes I'm already doing this... there is no way to make sure it's certainly with a setting in this or others conf files? – Yuval Pruss Dec 02 '18 at 07:37
  • Wouldn't letting it go as it is on the agent side & manipulating precision on the DB side (or reshaping it in Kapacitor) be a better solution? What's that ultimate need to set it right on collection point, could you elaborate plz? – Yuri G Dec 03 '18 at 23:30

1 Answers1

3

Unfortunately this isn't supported by influxdb. The workaround is to send the information using socket_listener with the correct timestamp.

This information is per the issues logged against influxdb's GitHub

AnonymousSB
  • 3,516
  • 10
  • 28