intelsdi-x / snap-plugin-publisher-influxdb

Publishes Snap metrics to InfluxDB
http://snap-telemetry.io/
Apache License 2.0
8 stars 40 forks source link

Feature request for handling measurment names, tags etc #116

Closed discoduck2x closed 7 years ago

discoduck2x commented 7 years ago

Hi,

Is there any plan for possibility of overriding current measurment naming e.g "intel/procfs/cpu/0" to say just "cpu" from inside the task json file ?

kjlyon commented 7 years ago

Hi @discoduck2x. Great question! Thank you for reaching out to us. The answer to your question is, no. That is because you could have multiple plugins loaded that collect the same metric so we need to be able to differentiate by using the whole namespace to avoid potential confusion. I hope this answers your question. Feel free to open another issue or message us on Slack if you want to discuss further.

jcooklin commented 7 years ago

@discoduck2x: I just wanted to throw out there the configuration option for this plugin called isMultiField. When its set to true the leafs of cpu in your example would be published to a single time series (/intel/procfs/cpu) with fields containing all of the values.

Using load from the psutil plugin as an example the following shows how the data would be published when using isMultiField.

Sample isMultiField=true

select * from "/intel/psutil/load"
time load1 load15 load5 source unit
1483996289995839909 2.05 egu-mac01.lan Load/1M
1483996289995839909 6.21 egu-mac01.lan Load/1M
1483996289995839909 5.26 egu-mac01.lan Load/1M
mbbroberg commented 7 years ago

+1 to explanations above. Namespacing is a basic functionality to avoid conflicting data written to a general metric. @jcooklin has a great example of how to work around that with InfluxDB specifically.

Others have mentioned stripping the namespace out and rebuilding it with config management data, like facts from a Puppet deployment. That's a way more advanced process we haven't had someone write up just yet.

@discoduck2x I'm curious what are you hoping to achieve? I want t make sure we're taking it into consideration as we design going forward. Thanks for sharing 🤝

discoduck2x commented 7 years ago

@jcooklin @mbbroberg , thanks for getting back so fast.

As ive just started testing snap as a possible replacement for other metric collectors i was thinking down the path where if I do make the swap then i would like as far as possible to be able to get make a one to one replacement. What i mean is that for example my current use of influx´s telegraf for cpu/procstat metrics i would like to be able to reuse the dashboards etc already in place and not having to change/recreate based on snaps namespace standards.

I guess i was looking for something similar to how telegraf lets you "rename" your measurments / series by:

https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md

Input Configuration: name_override: Override the base name of the measurement. (Default is the name of the input). name_prefix: Specifies a prefix to attach to the measurement name. name_suffix: Specifies a suffix to attach to the measurement name. tags: A map of tags to apply to a specific input's measurements.

its not a showstopper of course, just me perhaps beeing lazy :)

Im really hyped about what the future holds for the grafana snap app aswell - exciting times and great opensource effort you´ve pulled together