How to convert Graphite query to InfluxDB query

grafana
influxdb
graphite

#1

Hello,

I’m collecting SNMP metrics from our router which are saved as incrementing octets (network traffic).
I have Grafana panel “Network Utilization per hour” which display as it says, bandwidth consumption per hour.

Using Graphite we have simple function to achieve this:
summarize(scale(collectd.192.168.0.1.snmp.if_octets-ether1.tx, 60), '1h', 'sum', false)
http://graphite.readthedocs.io/en/latest/functions.html#graphite.render.functions.summarize

Could someone help me to convert this Graphite query to InfluxDB query?


#2

Can anyone help me regarding this problem?


#3

This is just another PING :disappointed:


#4

It’s hard to say exactly how you would write this query as I don’t know what your schema looks like. If your graphite names are your measurement name and the field name for the measurement is value, then I something like the following might work:

SELECT SUM(value * 60) FROM collectd.192.168.0.1.snmp.if_octets-ether1.tx WHERE time > now() - 6hr GROUP BY time(1h)

#5

InfluxGraph can convert Graphite queries directly to Influx queries from a configurable schema optionally based on graphite templates as used by InfluxDB.

Eg, if your schema is:

measurement=snmp with tags ip=192.168.0.1, source=collectd, interface=if_octets-ether1,field=tx

Then a template:

source.ip.measurement.interface.field

will produce appropriate influx queries from the summarize(collectd.192.168.0.1.snmp.if_octets-ether1.tx <…>) and any other graphite queries. If not using any schema or templates no template configuration is needed.


#6

That’s right!
Thanks, I’ll try your suggestions.