Git Product home page Git Product logo

Comments (6)

beorn7 avatar beorn7 commented on September 23, 2024 1

It's not so much the grouping or the join that creates these artifacts, but the multiplication. At least I can create the same "noisy" heatmap by multiplying with a 1 literal.

I'm confused why this is happening, as multiplication by 1 should be a no-op (and with the query linked above, it should be guaranteed that an actual 1.0 float arrives in the engine).

from prometheus.

gabrieljones avatar gabrieljones commented on September 23, 2024

compare (prometheus_http_request_duration_seconds_bucket)

from prometheus.

beorn7 avatar beorn7 commented on September 23, 2024

Fundamentally, I would say there must be a different code path in the PromQL engine for "sum the result of a function call" and "sum the result of a bin-op", but from the top of my head, I cannot imagine how that would happen.

from prometheus.

gabrieljones avatar gabrieljones commented on September 23, 2024

One possible workaround is to use something like round(_, 0.00001). Does this give the same result as the unmultiplied query?

compare:

  • round(sum by (le) (increase(prometheus_http_request_duration_seconds_bucket[1m]) * 1), 0.00001) link
  • sum by (le) (increase(prometheus_http_request_duration_seconds_bucket[1m])) link

from prometheus.

beorn7 avatar beorn7 commented on September 23, 2024

We discussed on the chat-system-that-shall-not-be-named. I guess the most likely reason for this is what @bboreham said there: "At a high level, it’s likely that each new expression changes the order of evaluation, which will give different results since addition is non-commutative."

from prometheus.

bboreham avatar bboreham commented on September 23, 2024

Just wanted to highlight #14074, which I think could improve the optics, at some CPU cost.
I didn't understand this issue enough to make a test case.

from prometheus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.