Commit 561920f1 by Ato Araki Committed by GitHub

Cloud monitoring: fix missing title and text from cloud monitoring annotations (#27187)

* cloudmonitoring: fix empty title and text annotation

* cloudmonitoring: use metricQuery value
parent 6a9bfa19
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment