GithubHelp home page GithubHelp logo

Comments (4)

zekker6 avatar zekker6 commented on June 20, 2024

Hello @tekert

This is caused by implicit query conversion:

If something other than series selector is passed to rollup function, then a subquery with 1i lookbehind window and 1i step is automatically formed. For example, rate(sum(up)) is automatically converted to rate((sum(default_rollup(up)))[1i:1i]). This behavior can be disabled or logged via cmd-line flags -search.disableImplicitConversion and -search.logImplicitConversion since v1.101.0.

So {__name__=~"node_netstat_Ip(6|)_(Reasm|Frag).*", job="node_exporter"} * 30 is evaluated as a subquery. Also, this will be further transformed into default_rollup({__name__=~"node_netstat_Ip(6|)_(Reasm|Frag).*", job="node_exporter"}) + 30.
In order to make that work as you expect you need to use the following query: rate({__name__=~"node_netstat_Ip(6|)_(Reasm|Frag).*", job="node_exporter"} * 30 keep_metric_names) keep_metric_names.
See this for example.

Also, starting from v1.101.0 it is possible to either enable logging for implicit query conversions or disable this completely by using -search.logImplicitConversion or -search.disableImplicitConversion command-line flags respectively.

from victoriametrics.

tekert avatar tekert commented on June 20, 2024

Thanks @zekker6 , "other than series selector" mean a subquery that returns multiple metrics in this case?

So to understand correctly if i disable implicit conversion, what would i have to write? if I write the query without * 30 :
rate(default_rollup({__name__=~"node_netstat_Ip(6|)_(Out|In).*"})[30s]) keep_metric_names
Works, and to add a binary operation, seems i have to do it inside the selection like this
rate(default_rollup({__name__=~"node_netstat_Ip(6|)_(Out|In).*"} * 30 keep_metric_names)) keep_metric_names
And not like this:
rate(default_rollup({__name__=~"node_netstat_Ip(6|)_(Out|In).*"}) * 30 keep_metric_names) keep_metric_names

edit: funny if i multiply doing * 30s (s at the end) it works too, wonder what is doing.

from victoriametrics.

zekker6 avatar zekker6 commented on June 20, 2024

@tekert

"other than series selector" mean a subquery that returns multiple metrics in this case?

No, in this case rate() takes a binary operation expression as an argument(a * b) which leads to using implicit convertion.

So to understand correctly if i disable implicit conversion, what would i have to write? if I write the query without * 30 :
edit: funny if i multiply doing * 30s (s at the end) it works too, wonder what is doing.

The idea is to pass a metric selector to the rollup function, so when you're using rate(a) * b there will be no subquery since rate argument is a metric selector.

from victoriametrics.

tekert avatar tekert commented on June 20, 2024

I see, thanks @zekker6 closing this.

from victoriametrics.

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.