[prometheus-users] Porting PromQL to InfluxQL

2020-05-23 Thread Yogesh Jadhav


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)

[image: Screenshot from 2020-05-23 20-12-49]
Screenshot from 2020-05-23 20-12-491920×1080 212 KB

 
[image: Screenshot from 2020-05-23 15-52-09]
Screenshot from 2020-05-23 15-52-091920×1080 212 KB



   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.

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/6c765d1a-d097-4cd5-81e6-e7809297028c%40googlegroups.com.


[prometheus-users] Re: InfluxQL queries for Data collected by Prometheus

2020-05-10 Thread Yogesh Jadhav
Thanks for the reply, Brian.

I don't mind writing recording rules. My only worry is will I be able to 
use Grafana dashboards without any issues (especially when we access data 
over years) as InfluxDB stores it internally in a different format.

Our's is a small organization with a small network ( a few thousand devices 
to monitor) and a small team ( I am the only one working on this). Keeping 
disk space usage (relatively) small and fixed even after storing data for 
years is  

Thanos has a lot of overheads, it supports only object/cloud storage. I 
don't think it supports custom resolutions/retentions. The most important 
point is it's downsampling is intended for query performance optimization 
instead of reducing storage footprint. In fact, it increases it by 3 times.

VictoriaMetrics can't be considered for production systems (yet) as it is 
basically a one-man show. Also similar to other tools like Thanos, cortex, 
m3, etc, it has installation and maintenance overheads. 

Are you suggesting that a sophisticated long term solution setup is better 
than using an external DB with remote read/write?

On Thursday, May 7, 2020 at 8:20:58 PM UTC+5:30, Brian Candler wrote:
>
> If you are using prometheus' remote_write feature to write to influxdb, 
> then I would have thought you would be able to query it via prometheus' 
> remote_read via the same PromQL interface - that is, you should not have to 
> write influxQLqueries (I'm not sure why you've found this).  But you may 
> end up having to write recording rules to do downsampling.
>
> I'd suggest you consider using something else for long term storage which 
> supports the same PromQL language natively, so your dashboards don't have 
> to change.  Popular options include VictoriaMetrics (very easy to set up) 
> and Thanos (a bit more work).
>
> Thanos includes down-sampling as a built-in feature.  With VictoriaMetrics 
> you can scrape the /federate endpoint as described here 
> .  So 
> either way, you don't have to write recording rules.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/9fb7ba93-1bd4-4414-9b0f-62856efb0114%40googlegroups.com.


[prometheus-users] InfluxQL queries for Data collected by Prometheus

2020-05-07 Thread Yogesh Jadhav


Hi All,
I am using Prometheus with SNMP exporter to fetch metrics from network 
devices like router, switch, etc. After creating dashboards in Grafana, I 
realized that Prometheus does not provide downsampling for long term 
storage over years such that footprint is fixed and small. So InfluxDB is 
installed along with Prometheus with the intention of using it for long 
term storage for Prometheus data employing different RPs & CQs for 
downsampling data depending on retention period.

I want Grafana to now display data from InfluxDB instead of Prometheus.

I find porting PromQL dashboards to InfluxQL for Prometheus collected data 
stored into InfluxDB a very challenging task. For example, In all 
dashboards, I use template variable Job (say with value=ubiquiti) to select 
from available devices and then use another template variable Instance ( 
value=ip.address.of.device) to select particular device among the pool of 
Ubiquiti devices.

But in InfluxQL I can either query Jobs or Instances not both.

show tag values from "ifInOctets" with key="instance" 
show tag values from "ifInOctets" with key="job"

Any pointers are welcome.

I have enabled both remote read and write in Prometheus for InfluxDB. Is it 
possible to keep existing PromQL dashboards with the ability to read 
historic and current data simultaneously?

Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/d0d0cd33-7150-45c7-8bab-708680b54911%40googlegroups.com.