Discussion:
[influxdb] PromQL to InfluxQL
n***@rafay.co
2018-04-14 05:43:35 UTC
Permalink
Hi Guys,
I am new to influxql and I am trying to convert PromQL query to InfluxQL syntax. Can anyone help me and correct it?

PromQL:
sum(rate(container_cpu_usage_seconds_total{}[3m])) BY (namespace, pod_name)

My InfluxQL attempt:
SELECT sum("f64") FROM "db"."default"."_" WHERE ("__name__" = 'container_cpu_usage_seconds_total' AND "namespace" = 'monitoring' AND "pod_name" = 'prometheus-k8s-1' AND time >= now() - 3m GROUP BY time(1s) fill(null)

Thanks
Regards
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/d5035a9c-2fd2-47f7-8d9b-edff8964c714%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nehal Syed
2018-04-14 06:24:36 UTC
Permalink
— Correction —
PromQL:
sum(rate(container_cpu_usage_seconds_total{__name__= “container_cpu_usage_seconds_total", namespace = "monitoring", pod_name = "prometheus-k8s-1" }[3m]))
Post by n***@rafay.co
Hi Guys,
I am new to influxql and I am trying to convert PromQL query to InfluxQL syntax. Can anyone help me and correct it?
sum(rate(container_cpu_usage_seconds_total{}[3m])) BY (namespace, pod_name)
SELECT sum("f64") FROM "db"."default"."_" WHERE ("__name__" = 'container_cpu_usage_seconds_total' AND "namespace" = 'monitoring' AND "pod_name" = 'prometheus-k8s-1' AND time >= now() - 3m GROUP BY time(1s) fill(null)
Thanks
Regards
--
Remember to include the version number!
---
You received this message because you are subscribed to a topic in the Google Groups "InfluxData" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/influxdb/j-tv2cXVbsI/unsubscribe.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/d5035a9c-2fd2-47f7-8d9b-edff8964c714%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/D43A4770-67AC-4021-8F4A-5FDEAE457AEF%40rafay.co.
For more options, visit https://groups.google.com/d/optout.
Loading...