fixed agg rate bug
This commit is contained in:
parent
a3bf7a16ad
commit
4cf91d7a40
|
@ -485,6 +485,7 @@ func (engine *Engine) GetTargetMetricData(rule *alerting.Rule, isFilterNaN bool,
|
||||||
if len(parameters) == 0 {
|
if len(parameters) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := expression.Evaluate(parameters)
|
result, err := expression.Evaluate(parameters)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, queryResult, err
|
return nil, queryResult, err
|
||||||
|
@ -1008,6 +1009,9 @@ func collectMetricData(agg interface{}, groupValues string, metricData *[]alerti
|
||||||
if k == "key" || k == "key_as_string" || k== "doc_count"{
|
if k == "key" || k == "key_as_string" || k== "doc_count"{
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if len(k) > 5 { //just store a,b,c
|
||||||
|
continue
|
||||||
|
}
|
||||||
if vm, ok := v.(map[string]interface{}); ok {
|
if vm, ok := v.(map[string]interface{}); ok {
|
||||||
if metricVal, ok := vm["value"]; ok {
|
if metricVal, ok := vm["value"]; ok {
|
||||||
md.Data[k] = append(md.Data[k], alerting.TimeMetricData{bkM["key"], metricVal})
|
md.Data[k] = append(md.Data[k], alerting.TimeMetricData{bkM["key"], metricVal})
|
||||||
|
|
Loading…
Reference in New Issue