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

Multiplication between two series returns no values #4729

Closed
rmeleromira opened this Issue Oct 12, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@rmeleromira
Copy link

rmeleromira commented Oct 12, 2018

Bug Report

What did you do?

Try to multiply two time series.

What did you expect to see?

The first value multiplied by the second value and then a final value.

What did you see instead? Under which circumstances?

I get no records back, if I hard code the multiplication it works.

Environment

  • System information:
root@monitoring:~# uname -srm
Linux 4.4.0-130-generic x86_64
  • Prometheus version:
root@monitoring:~# prometheus --version
prometheus, version 2.4.3 (branch: HEAD, revision: 167a4b4e73a8eca8df648d2d2043e21bdb9a7449)
  build user:       root@1e42b46043e9
  build date:       20181004-08:42:02
  go version:       go1.11.1
  • Alertmanager version:
root@monitoring:~# alertmanager --version
alertmanager, version 0.15.2 (branch: HEAD, revision: d19fae3bae451940b8470abb680cfdd59bfa7cfa)
  build user:       root@3101e5b68a55
  build date:       20180814-10:53:39
  go version:       go1.10.3

First query

secure_nodes_last_earn{instance="localhost:7980",job="secure_nodes_exporter"}

output

0.0492

Second query

zen_usd_price{instance="localhost:7981",job="secure_nodes_exporter"}

output

13.64

Multiplication

zen_usd_price{instance="localhost:7981",job="secure_nodes_exporter"}*secure_nodes_last_earn{instance="localhost:7980",job="secure_nodes_exporter"}

No results

Hard coding the multiplication works

secure_nodes_last_earn{instance="localhost:7980",job="secure_nodes_exporter"}*13.6

output

0.6691199999999999
@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Oct 12, 2018

Label names need to match on both sides, use ignoring/on to specify on which labels you want to join:

zen_usd_price{instance="localhost:7981",job="secure_nodes_exporter"} * ignoring(instance) secure_nodes_last_earn{instance="localhost:7980",job="secure_nodes_exporter"}

I'm closing it for now. If you have further questions, please use our user mailing list, which you can also search.

@lock lock bot locked and limited conversation to collaborators Apr 10, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.