Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query getting escaped weird #352

Closed
WillPlatnick opened this issue Nov 2, 2019 · 0 comments · Fixed by #353
Closed

Query getting escaped weird #352

WillPlatnick opened this issue Nov 2, 2019 · 0 comments · Fixed by #353
Labels
kind/bug Something isn't working

Comments

@WillPlatnick
Copy link

In my canary, I have this for a metric to capture requests:

      - name: "status"
        threshold: 1
        interval: 1m
        query: ((sum(rate(nginx_http_requests_total{kubernetes_namespace="movies",host="_",status=~"499",kubernetes_pod_name=~"staging-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)",}[1m])) or vector(0)) + sum(rate(nginx_http_requests_total{kubernetes_namespace="movies",host="_",status=~"5..",kubernetes_pod_name=~"staging-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)",}[1m])) or vector(0)) / sum(rate(nginx_http_requests_total{kubernetes_namespace="movies",host="_",kubernetes_pod_name=~"staging-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)",}[1m])) * 100

In my logs, I get the error "Metrics server http://flagger-prometheus:9090 query failed for status: error response: {\"status\":\"error\",\"errorType\":\"bad_data\",\"error\":\"invalid parameter 'query': parse error at char 165: unexpected identifier \\\"orvector\\\" in paren expression, expected \\\")\\\"\"}"

It looks like it's getting rid of my spaces. I tried escaping spaces via \ and \\ but that didn't work either.

Does anybody have any hints on how to format this query? If I copy and paste the query into Prom it works just fine.

@stefanprodan stefanprodan added the kind/bug Something isn't working label Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants