influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.59k stars 5.56k forks source link

Data types using statsd #469

Closed smebberson closed 8 years ago

smebberson commented 8 years ago

I have telegraf configured as follows:

# Telegraf configuration

# Configuration for telegraf agent
[agent]
  interval = "10s"
  round_interval = true
  flush_interval = "10s"
  flush_jitter = "0s"
  debug = false
  hostname = ""

[outputs]

# Configuration for influxdb server to send metrics to
[[outputs.influxdb]]
  urls = ["http://localhost:8086"] # required
  database = "fb" # required
  precision = "s"
  timeout = "5s"
  username = "fb"
  password = "fb"

[plugins]

# Statsd Server
[[plugins.statsd]]
  service_address = ":8125"
  delete_gauges = false
  delete_counters = true
  delete_sets = false
  delete_timings = false
  percentiles = [90]
  allowed_pending_messages = 10000
  percentile_limit = 1000

I'm using the Node.js module statsy to send through metrics via the statsd protocol. This is an example of the label I create in statsy:

timeentry.create,sessionCompleted=false,minutes=1,session=true,usingLabel=true,usingClient=true,user=53860645a169511b4e517111

However, when viewing this information within the InfluxDB query viewer, everything is coming out as strings. That includes the minutes, session, usingLabel, usingClient tags. I expected them to appear as integer, boolean, boolean and boolean, respectively.

Any ideas on how to make this all hang together properly?

smebberson commented 8 years ago

I should have also stated I'm using Telegraf v0.2.4 and InfluxDB v0.9.6.1 both compiled from source.

sparrc commented 8 years ago

@smebberson Currently the influx statsd implementation does not support multiple fields on a measurement. The way you are sending the metrics, they are being interpreted as tags, which are always strings (see here: https://docs.influxdata.com/influxdb/v0.9/concepts/key_concepts/#tag-value).

I can't tell exactly what you should be sending, could you include the full statsd line? What type of measurement is this? A timing? I don't see the value or type in the included line (ie, it should end with :<value>|<type>)

Maybe you want minutes to be your value for a timing, and the rest to be tags, like this:

timeentry.create,sessionCompleted=false,session=true,usingLabel=true,usingClient=true,user=53860645a169511b4e517111:60000|ms
sparrc commented 8 years ago

@smebberson I think this is solved, please feel free to re-open if not, or if you have additional questions