SSE/Alerting: Support prom instant vector responses (#44865)
* SSE/Alerting: (Draft) Support prom instant vector responses fixes #35663 * reduce\classic expressions to handle mathexp.Number * use Notice for warning Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
co-authored by
Yuriy Tseretyan
parent
0215195e6d
commit
01ef899753
@@ -0,0 +1,18 @@
|
||||
package mathexp
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
|
||||
func GenerateNumber(value *float64) Number {
|
||||
size := rand.Intn(5)
|
||||
labels := make(map[string]string, size)
|
||||
for i := 0; i < size; i++ {
|
||||
labels[util.GenerateShortUID()] = util.GenerateShortUID()
|
||||
}
|
||||
result := NewNumber(util.GenerateShortUID(), labels)
|
||||
result.SetValue(value)
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user