Add this tag for queries related to MetricsQL- query language for VictoriaMetrics
Questions tagged [metricsql]
22 questions
4
votes
1 answer
Group by time and aggregate in PromQL/MetricsQL
I have a metric say x, of type gauge, And the values are reported every 5m.
Now I want to make a query such that, I get sum of values in each hour in a day.
Exmaple: from 3PM to 5PM, the gauge values are…

Chaitanya Mankala
- 1,594
- 17
- 24
2
votes
1 answer
Display daily consumption grafana using prometheus datasource
I’m using grafana v9.5.1 and my datasource is prometheus.
I'm really new to monitoring.
I have a metric called container_network_transmit_bytes_total.
I want to create a graph which the X-axis represents the date of the day and the Y-axis represents…

Hesam Norin
- 77
- 4
1
vote
1 answer
Metric with changing label
I have a label called managed that it can be changed between 0 and 1 at anytime by the host machine. I have an alert that notifies when a metric is lagging behind by more than 90s.
However, it doesn't account for the managed label change so when the…

Tommy
- 427
- 2
- 5
- 14
1
vote
1 answer
MetricQL function inside the PromQL
Im using a dashboard from here and it is using a function called topk_max I found that this is from MeticQL. But Im using prometheus.
Is there any way to replicate the function in PromQL?

TheDataGuy
- 2,712
- 6
- 37
- 89
1
vote
0 answers
How to get the last value received in Prometheus/VictoriaMetrics with promQL/metricsQL
I want to get the last value ingested by Prometheus/VictoriaMetrics for a specific time series. How can I query for that?
The value could have been ingested 5mins ago or 1sec ago.

eng007
- 93
- 2
- 8
1
vote
1 answer
Can you have multiple responses shown in the Grafana Query inspector
I have multiple queries in promQL and influxQL in the edit panel in Grafana. All of the results are shown on the graph above the queries. I also want to see the results of these queries in the Query inspector window in Grafana, but only one of the…

eng007
- 93
- 2
- 8
1
vote
2 answers
PromQL avg() on a range vector
What is the meaning of applying avg() over a range vector such as:
avg(meric_name[1d])
As per the documentation here, it only operated on an instant vector. The metric_name[1d] returns a range vector. This query still runs over the range vector…

eng007
- 93
- 2
- 8
1
vote
1 answer
Get the latest value per timeserie
How to query the latest value per timeserie in MetricsQL or PromQL?
For example, query metric_name returns two timeseries for metric_name{job="foo"} and metric_name{job="bar"} for a long…

Dzmitry Lazerka
- 1,809
- 2
- 21
- 37
1
vote
1 answer
What is a difference between rollup_rate (avg) and rate in MetricsQL?
As stated in title, what is a difference between avg from rollup_rate() and rate() in MetricsQL?
It is not clear to me from the official documentation.

TN.
- 18,874
- 30
- 99
- 157
1
vote
1 answer
PromQL/Victoria Metrics - multiply time series with different resolutions
I have a question on promql series multiplication.
I have 2 time series, that have a different sampling (5minutes and 15 minutes).
I need to bring them at the same resolution, multiply and sum
Something like:
WITH (
filter1= {testID=~"test2"},
…

RJtokenring
- 371
- 1
- 4
- 12
1
vote
1 answer
Count how many times an event occurred or a metric was reported using PromQL
I use Victoria Metrics to track IOT Devices. Whenever device connects/disconnects i insert a metric into Victoria Metrics. My metric name is devcon_s.
i can query data using this -
devcon_s{device_id="something"}
But I want to know how frequent…

Daga Arihant
- 464
- 4
- 19
1
vote
1 answer
Linear interpolation in PromQL or MetricsQL
I am evaluating VictoriaMetrics for an IoT application where we sometimes have gaps in a series due to hardware or communication issues. In some time series reporting situations it is helpful for us to interpolate values for the missing time…

mactyr
- 463
- 3
- 16
0
votes
1 answer
Cut incorrent, unwanted values from the function calculation base in VictoriaMetrics/Prometheus
I'm trying to deal with a particular problem concerning VictoriaMetrics queries lastly and still haven't found the answer how to resolve it, so I've decided to ask here.
I have a lot of data to process (range is [30d]), but some samples are…

skylighty
- 21
- 3
0
votes
1 answer
PromQL/MetricsQL if value in range divide by constant value or map function
I'm trying to divide the value by 10, if the value is inside an defined range.
Source is VictoriaMetrics and Grafana with Prometheus plugin is used to query the data.
I tested this code but either get an error message or the values to be divided end…

Johannes
- 1
- 1
0
votes
1 answer
PromQL get both delta result and current value?
I have the following query:
delta(elasticsearch_cluster_health_number_of_nodes[1m]) < 0
which will return:
{cluster="elasticsearch", container="exporter", endpoint="http", environment="production", instance="x.x.x.x", job="elasticsearch-exporter",…

Igor Hrcek
- 715
- 5
- 16