fix:explore补充查询自定义step

This commit is contained in:
zyh
2023-11-21 15:23:49 +08:00
parent 0fcf02a5ea
commit b1db4e7402

View File

@@ -3898,7 +3898,8 @@ export default {
if (item != '' && this.promqlKeys[index].state) {
const isMetric = this.validateMetric(item)
if (!isMetric) {
const step = bus.getStep(bus.formateTimeToTime(this.filterTime[0]), bus.formateTimeToTime(this.filterTime[1]))
let step = bus.getStep(bus.formateTimeToTime(this.filterTime[0]), bus.formateTimeToTime(this.filterTime[1]))
step = this.promqlKeys[index].step + 's' || step
const supplementaryExpr = `sum by (level) (count_over_time(${item}[${step}]))`
requestArr.push(this.$get('/logs/loki/api/v1/query_range?query=' + encodeURIComponent(supplementaryExpr) + '&start=' + start + '&end=' + end))
}