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 can't get result of arithmetic binary operators between two scalars #2245

Closed
wangyanzhao opened this issue Mar 10, 2020 · 12 comments
Closed

Comments

@wangyanzhao
Copy link

wangyanzhao commented Mar 10, 2020

Thanos used: v0.10.1

Object Storage Provider: no use of object store

What happened: can't get result of arithmetic binary operators between two scalars, "No datapoints found". But it can get result from Prometheus.

image

What you expected to happen:

image

How to reproduce it (as minimally and precisely as possible):

Full logs to relevant components:

Anything else we need to know:

@wangyanzhao wangyanzhao changed the title query can't get "Arithmetic binary operators Between two scalars" query can't get result of arithmetic binary operators between two scalars Mar 10, 2020
@GiedriusS
Copy link
Member

GiedriusS commented Mar 10, 2020

What's :node_cpu_utilisation:avg1m? Does it have any label? FWIW I can query sum(up) * 2 on 0.10.1 just fine. Could you please write some instructions on how to reproduce it? Do you have Thanos Sidecar connected to your Thanos Query?

@wangyanzhao
Copy link
Author

wangyanzhao commented Mar 10, 2020

All separate query is ok. Such as

  1. :node_cpu_utilisation:avg1m

image

  1. sum(kube_node_status_capacity_cpu_cores)

image

  1. :node_cpu_utilisation:avg1m * 2

image

@wangyanzhao
Copy link
Author

@GiedriusS

@wangyanzhao
Copy link
Author

wangyanzhao commented Mar 11, 2020

query "sum(:node_cpu_utilisation:avg1m) * sum(kube_node_status_capacity_cpu_cores)" is ok.

image

but in Promtheus, no need sum, ":node_cpu_utilisation:avg1m * sum(kube_node_status_capacity_cpu_cores)" is ok.

@GiedriusS
Copy link
Member

Still haven't gotten around to this exact issue but brainstormed an idea that we could run these correctness tests of PromQL in our CI: https://github.com/prometheus/prometheus/tree/master/promql/testdata on a simple Sidecar+Query setup.

@stale
Copy link

stale bot commented Apr 18, 2020

This issue/PR has been automatically marked as stale because it has not had recent activity. Please comment on status otherwise the issue will be closed in a week. Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2020
@bwplotka
Copy link
Member

bwplotka commented Apr 18, 2020 via email

@stale stale bot removed the stale label Apr 18, 2020
@GiedriusS
Copy link
Member

I couldn't reproduce this last time I have tried.

@bwplotka
Copy link
Member

Awesome, let's close - if anyone can repro, just comment we will reopen 🤗

@yeya24
Copy link
Contributor

yeya24 commented Apr 22, 2020

Still haven't gotten around to this exact issue but brainstormed an idea that we could run these correctness tests of PromQL in our CI: https://github.com/prometheus/prometheus/tree/master/promql/testdata on a simple Sidecar+Query setup.

That sounds interesting. Cortex has cortexproject/cortex#2203 to test the performance between its chunk and block storage. We can use a similar idea to do some AB testing between Prometheus and Thanos

@GiedriusS
Copy link
Member

Still haven't gotten around to this exact issue but brainstormed an idea that we could run these correctness tests of PromQL in our CI: https://github.com/prometheus/prometheus/tree/master/promql/testdata on a simple Sidecar+Query setup.

That sounds interesting. Cortex has cortexproject/cortex#2203 to test the performance between its chunk and block storage. We can use a similar idea to do some AB testing between Prometheus and Thanos

Maybe let's put this into a separate issue? What do you think? :P

@yeya24
Copy link
Contributor

yeya24 commented Apr 22, 2020

Sounds good to me. Would you like to open it?
I think https://github.com/prometheus/prometheus/tree/master/promql/testdata is not sufficient to cover all cases. If there is a promql fuzzer to randomly generate query, then it would be amazing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants