stackdriver-prometheus-sidecar
stackdriver-prometheus-sidecar copied to clipboard
Using operator in filter
Is there a way to use an operator in a filter? I want to send only metric with value greater than 0 to stackdriver. ex) PromQL: {name="kube_pod_status_phase", namespace="kubeflow", phase=~"Pending|Failed"} >0
When I run it on a filter, I get the following error:
--include=({__name__="kube_pod_status_phase", namespace="kubeflow", phase=~"Pending|Failed"}>0)
# Error
"Error parsing --include (or --filter)" err="cannot parse --include flag '({__name__=\"kube_pod_status_phase\", namespace=\"kubeflow\", phase=~\"Pending|Failed\"}>0)': \"parse error at char 1: vector selector must contain label matchers or metric name\""
I had a similar problem
--include='{__name__!~"cadvisor_.+"} didn't actually work
Got errors like
parse error at char 19: vector selector must contain at least one non-empty matcher
Had to move negation into the regexp instead like that --include='{__name__=~"^cadvisor_.+"}