代码之家  ›  专栏  ›  技术社区  ›  Yuval Pruss

如何设置telegraf statsd(XDB)的时间精度?

  •  6
  • Yuval Pruss  · 技术社区  · 6 年前

    我正在使用 telegraf 具有 influxdb 电传电报 我正在使用statsd_输入插件。

    这个 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
    

    . 我试图在未来的日子里做到这一点 telegram.conf 文件,但注释中写道精度设置不会影响statsd插件:

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

    我还没有看到一个场景 precision statsd_input.conf 实现这一目标的正确方法是什么?

    1 回复  |  直到 6 年前
        1
  •  2
  •   AnonymousSB    6 年前

    不幸的是,XDB不支持这一点。解决方法是使用 socket_listener 使用正确的时间戳。

    这个信息是 per the issues logged