I have a working Victoria Metrics query:
avg_over_time(label_1{label_id_1 = "123", label_id_2 = "456"} [100s])
This almost all the time returns one value (vector). However, when the timeseries has a different version, it returns two values which is not desired. Eg:
[
{
"metric": {
"__name__": "label_1",
"version": "1",
"label_id_1": "123",
"label_id_2": "456",
},
"value": [
1710597352.247,
"2986.54887451"
],
"group": 1
},
{
"metric": {
"__name__": "label_1",
"version": "2",
"label_id_1": "123",
"label_id_2": "456",
},
"value": [
1710597352.247,
"369872.158964"
],
"group": 1
}
]
Is there a way to compute the average without the version label so that I get back a single value every time?
The expected result should be this way (value here is arbitrary):
[
{
"metric": {
"__name__": "label_1",
"label_id_1": "123",
"label_id_2": "456",
},
"value": [
1710597352.247,
"12346579.46694"
],
"group": 1
}]
Looks like you have two distinct time series in your data, and
versionlabel is what makes them distinct. You can't simply get rid of it. You need to decide how you want your rollup function to compute this:avg_over_time(label_1{label_id_1="123",label_id_2="456",version="1"}[100s])avg(avg_over_time(label_1{label_id_1="123",label_id_2="456"}[100s])) without(version)