mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
CloudMonitoring: Correctly set title and text fields for annotations (#71888)
Correctly set title and text fields
This commit is contained in:
parent
8c86a46440
commit
c4d6509145
@ -26,19 +26,19 @@ func (s *Service) executeAnnotationQuery(ctx context.Context, req *backend.Query
|
|||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
mq := struct {
|
tslq := struct {
|
||||||
MetricQuery struct {
|
TimeSeriesList struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
} `json:"metricQuery"`
|
} `json:"timeSeriesList"`
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
firstQuery := req.Queries[0]
|
firstQuery := req.Queries[0]
|
||||||
err = json.Unmarshal(firstQuery.JSON, &mq)
|
err = json.Unmarshal(firstQuery.JSON, &tslq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
err = parseToAnnotations(req.Queries[0].RefID, queryRes, dr, mq.MetricQuery.Title, mq.MetricQuery.Text)
|
err = parseToAnnotations(req.Queries[0].RefID, queryRes, dr, tslq.TimeSeriesList.Title, tslq.TimeSeriesList.Text)
|
||||||
resp.Responses[firstQuery.RefID] = *queryRes
|
resp.Responses[firstQuery.RefID] = *queryRes
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
|
Loading…
Reference in New Issue
Block a user