Comments (4)
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.
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.
"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.
I see, thanks @zekker6 closing this.
from victoriametrics.
Related Issues (20)
- How to add label ? HOT 4
- Alerting rule `RecordingRulesNoData`'s annotations use missing `recording` label HOT 1
- In the victoria-logs ui make the relative range control relative to the time when the query is run.
- victorialogs: optimize sort performance
- Vm auth: if the request does not fully cache the body to buf due to server connection disconnection, it will not be retried. HOT 1
- No data for several endpoints, including Active Targets HOT 2
- vmauth: a way to stop proxying Host header
- vmselect gets timeout when request /api/v1/label/.../values HOT 8
- The metric `process_resident_memory_bytes` was not calculated correctly HOT 1
- Global WITH templates in vmselect / vmsingle
- vmauth cannot start with empty configuration. HOT 1
- vmauth: default httpserver incorrectly exposed
- VMAlert oauth2 error HOT 1
- vmagent using k8s endpoint role for pod role jobs HOT 5
- kube-scheduler and kube-controller-manager scrape tls issue on victoria-metrics-k8s-stack HOT 3
- Add type parameter to prometheus metrics in vmagent HOT 2
- GetRowsDiff func takes a lot of time when vmagent pushes kube-state-metrics data HOT 3
- Using Query from the beginning of the day HOT 1
- Allow VMAlert to replay alerts till the current time HOT 2
- Different authorization for different targets, via relabel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from victoriametrics.