mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 01:16:31 -06:00
Cloud monitoring: fix missing title and text from cloud monitoring annotations (#27187)
* cloudmonitoring: fix empty title and text annotation * cloudmonitoring: use metricQuery value
This commit is contained in:
parent
6a9bfa19be
commit
561920f18b
@ -25,9 +25,11 @@ func (e *CloudMonitoringExecutor) executeAnnotationQuery(ctx context.Context, ts
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
title := firstQuery.Model.Get("title").MustString()
|
||||
text := firstQuery.Model.Get("text").MustString()
|
||||
tags := firstQuery.Model.Get("tags").MustString()
|
||||
|
||||
metricQuery := firstQuery.Model.Get("metricQuery")
|
||||
title := metricQuery.Get("title").MustString()
|
||||
text := metricQuery.Get("text").MustString()
|
||||
tags := metricQuery.Get("tags").MustString()
|
||||
err = e.parseToAnnotations(queryRes, resp, queries[0], title, text, tags)
|
||||
result.Results[firstQuery.RefId] = queryRes
|
||||
|
||||
|
@ -302,7 +302,7 @@ func migrateLegacyQueryModel(query *tsdb.Query) {
|
||||
if mq == nil {
|
||||
migratedModel := simplejson.NewFromAny(map[string]interface{}{
|
||||
"queryType": metricQueryType,
|
||||
"metricQuery": query.Model,
|
||||
"metricQuery": query.Model.MustMap(),
|
||||
})
|
||||
query.Model = migratedModel
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user