fix: nodata strategy does not work when index or tsdb down
This commit is contained in:
parent
2c285e63c1
commit
9cb07f1252
|
@ -309,8 +309,8 @@ func GetReqs(stra *model.Stra, metric string, endpoints []string, now int64) ([]
|
||||||
Endpoint: index.Endpoint,
|
Endpoint: index.Endpoint,
|
||||||
Metric: index.Metric,
|
Metric: index.Metric,
|
||||||
Tag: "",
|
Tag: "",
|
||||||
Step: index.Step,
|
Step: 10,
|
||||||
Dstype: index.Dstype,
|
Dstype: "GAUGE",
|
||||||
TS: now,
|
TS: now,
|
||||||
}
|
}
|
||||||
lostSeries = append(lostSeries, s)
|
lostSeries = append(lostSeries, s)
|
||||||
|
|
|
@ -47,6 +47,7 @@ func nodataJudge() {
|
||||||
Tags: "",
|
Tags: "",
|
||||||
TagsMap: map[string]string{},
|
TagsMap: map[string]string{},
|
||||||
DsType: "GAUGE",
|
DsType: "GAUGE",
|
||||||
|
Step: 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
nodataJob.Acquire()
|
nodataJob.Acquire()
|
||||||
|
|
|
@ -178,6 +178,9 @@ func fetchDataSync(start, end int64, consolFun, endpoint, counter string, step i
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warningf("fetch tsdb data error: %+v", err)
|
logger.Warningf("fetch tsdb data error: %+v", err)
|
||||||
stats.Counter.Set("query.data.err", 1)
|
stats.Counter.Set("query.data.err", 1)
|
||||||
|
data.Endpoint = endpoint
|
||||||
|
data.Counter = counter
|
||||||
|
data.Step = step
|
||||||
}
|
}
|
||||||
dataChan <- data
|
dataChan <- data
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue