Porting PromQL to InfluxQL

26 views
Skip to first unread message

Yogesh Jadhav

unread,
May 23, 2020, 12:32:03 PM5/23/20
to Prometheus Users

I am trying a Prometheus/PromQL Grafana Dashboard to InfluxDB/InfluxQL(OSS/1.8). I am facing two major problems regarding this.

  1. Lack of Join for different Measurements
    I have the following query which in Prometheus which shows packet loss with the following query

(ifOutDiscards) * ignoring(ifDescr) group_left(ifDescr) ifDescr {job="$Job", instance="$Device"}

Then I use “Out {{ifDescr}}” as a legend to get ifDescr of each ifIndex in tooltip. How to achieve this in InfluxQl. So far I am able to this

SELECT mean(“value”) FROM “ifOutDiscards” WHERE (“job” =~ /^Job/ AND “instance” =~ /^Instance/) AND timeFilter GROUP BY time(__interval), “ifIndex” fill(linear)

 

  1. Lack of “irate” function
    I have a scrape interval of 25 minutes ( I plan to reduce it to 15 seconds) so I have the following query

irate(ifOutOctets{job="$Job",instance="$Device", ifIndex="$IfIndexAth0"}[30m])*8

I converted it to InfluxQL like this, but results are not the same

SELECT non_negative_derivative(mean(“value”), 30m) *8 FROM “ifOutOctets” WHERE (“job” =~ /^Job/ AND “instance” =~ /^Instance/ AND “ifIndex” =~ /^IfIndexAth0/) AND timeFilter GROUP BY time(__interval) fill(linear)

Any help is appreciated.

Brian Candler

unread,
May 24, 2020, 9:58:49 AM5/24/20
to Prometheus Users
Questions about InfluxDB and InfluxQL would be better directed to an InfluxDB forum. Try here:

Reply all
Reply to author
Forward
0 new messages