diff --git a/common/tsdb/kairosdb.go b/common/tsdb/kairosdb.go index 931ea65..6eda2a9 100644 --- a/common/tsdb/kairosdb.go +++ b/common/tsdb/kairosdb.go @@ -1,6 +1,7 @@ package tsdb import ( + "errors" "fmt" "strconv" "strings" @@ -35,6 +36,9 @@ func (k *KairosDbClient) newQueryBuilder(start, end, rawTags, aggregator, metric if _, ok := tags[tagKV[0]]; !ok { tagks = append(tagks, tagKV[0]) } + if tagKV[1] == "all" { + continue + } tags[tagKV[0]] = append(tags[tagKV[0]], strings.Split(tagKV[1], "|")...) } } @@ -59,6 +63,10 @@ func (k *KairosDbClient) Query(start, end, rawTags, aggregator, metric string, i if err != nil { return } + errs := queryResp.GetErrors() + if len(errs) > 0 { + err = errors.New(strings.Join(errs, "|")) + } if len(queryResp.QueriesArr) > 0 { for _, r := range queryResp.QueriesArr[0].ResultsArr { result := new(Result) diff --git a/common/tsdb/opentsdb.go b/common/tsdb/opentsdb.go index a6ace42..7249684 100644 --- a/common/tsdb/opentsdb.go +++ b/common/tsdb/opentsdb.go @@ -81,6 +81,9 @@ func (c *OpenTsdbClient) newQueryParams(start, end, rawTags, aggregator, metric tagsPairs := strings.Split(rawTags, ",") for _, tagPair := range tagsPairs { tagKV := strings.Split(tagPair, "=") + if tagKV[1] == "all" { + tagKV[1] = "*" + } tags[tagKV[0]] = tagKV[1] } }